Login  Register

Problems with the ROIs and mask

Posted by Jose Luis Asensio on Dec 04, 2008; 11:12am
URL: http://imagej.273.s1.nabble.com/radial-distribution-function-tp3694338p3694340.html

Hi,

I have just realized that the ROIs behave in a very strange way the  
first time they are created when they are not rectangular.

Debugging the code and working with the Z_Profiler plugin, when a ROI  
is created the first time, the ROI is Wx pixels width and Hy pixels  
height, so the number of pixels in the rectangle is Wx*Hy. But when a  
ROI with a mask is used (Oval ROI for example), the first time the roi  
is created, the mask is not this size so when the Z_Profiler sets the  
ROI to calculate the mean value of the roi for the ImageProcessor and  
shows the Z axis, it does not use the mask because of this size  
diference.

So, the very first time the roi is created and until the size of the  
roi is modified (once one property is modified the mask cache is  
erased and calculated again this time correctly), every roi works as a  
rectangular roi, with mask equal to null.

As anyone relizes this problem? is there a way to avoid this problem?

You can see it in the ImageProcessor class, in the setRoi(ij.gui.Roi  
roi) method afther the mask is stored, the boundary rectangle is  
stored and due to size diferences when the rectangle is stored the  
mask is erased.

Thanks a lot.
Jose Luis


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.