ROIDescriptor:can not retrieve mean intenity of an ROI

19 views
Skip to first unread message

Igothigh

unread,
Aug 17, 2018, 10:08:26 AM8/17/18
to Icy imaging
Hi,

I just want to retrieve the mean intensity of a unique picture using javascript. I can retrieve "interior" and "area" for example but not values related to intensity. Here is the code:

importClass(Packages.icy.roi.ROI2DRectangle)
importClass(Packages.icy.roi.ROIDescriptor)

seq=getSequence()
roi=new ROI2DRectangle(seq.getBounds2D())
meanIntensity=ROIDescriptor.computeDescriptor("Mean intensity", roi, seq)
println("Mean=" + meanIntensity)

I got this as a result:
Wrapped java.lang.UnsupportedOperationException: ROIMeanIntensityDescriptor: cannot compute descriptors for 'Rectangle2D' (script#9)

I tried by setting up ROI channel to 0 instead of all, and it doesn't work. Any idea?

Thank you for your help.
Best.

Stéphane

Stephane

unread,
Aug 18, 2018, 4:10:31 PM8/18/18
to Icy imaging
Hi Stephane,

You were close, you just need to setup the channel where you want to compute the mean intensity.
I don't why it didn't worked for you but just doing that :

importClass(Packages.icy.roi.ROI2DRectangle)
importClass
(Packages.icy.roi.ROIDescriptor)

seq
=getSequence()
roi
=new ROI2DRectangle(seq.getBounds2D())

roi
.setC(0)

meanIntensity
=ROIDescriptor.computeDescriptor("Mean intensity", roi, seq)

println
("Mean=" + meanIntensity)


Is ok to get things working :)

Best,

- Stephane

Igothigh

unread,
Aug 20, 2018, 4:34:57 AM8/20/18
to Icy imaging
Hi Stéphane,

Thanks a lot. It works now. I do not know why it did not work when I changed manually the channel for the ROI... It probably did not take it into account.
Best.

Stéphane
Reply all
Reply to author
Forward
0 new messages