Small issues about Roi and the roiManager

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Small issues about Roi and the roiManager

CARL Philippe (LBP)
Dear all,

 

Please consider the following small macro :

                newImage("Untitled", "8-bit black", 50, 50, 1);

                xCoord = newArray(29, 29, 29, 28, 27, 26, 25, 24, 23, 22,
21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 29);

                yCoord = newArray(25, 24, 23, 22, 21, 21, 21, 21, 21, 22,
23, 24, 25, 26, 27, 28, 29, 29, 29, 29, 29, 28, 27, 26, 25);

                makeSelection("polygon", xCoord, yCoord);

                Roi.setName(0);

                roiManager ("Add");

                for(i = 1; i != 10; i++)

                {

                               roiManager("select", 0);

                               run("Enlarge...", "enlarge=" + i);


                               Roi.setName(i);

                               roiManager ("Add");

                }

                roiManager("Show All");

Is there a reason why the obtained enlarged Rois aren’t symmetrical?

 

Also if I select several Rois within the roiManager (either by using the
Shift or Ctrl key) why is only the first selected Roi shown up within the
picture and not all the selected ones?

 

I thank you very much in advance for your help and lightings.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Small issues about Roi and the roiManager

Gabriel Landini
On Thursday, 14 February 2019 15:50:35 GMT you wrote:
> Is there a reason why the obtained enlarged Rois aren't symmetrical?

Because the first ROI does not really generate a symmetric discrete region.
Try to fill it and you will see the assymetry. I believe the enlarging of ROIs
is done by a dilation, so subsequent enlargements carry the assymetry to the
next level.

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Small issues about Roi and the roiManager

CARL Philippe (LBP)
Dear Gabriel,

> Because the first ROI does not really generate a symmetric discrete
region.
> Try to fill it and you will see the assymetry.

Indeed, but why? This is the question...
The defined Roi is symmetric so I don't understand the issue.

My best regards,

Philippe

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Small issues about Roi and the roiManager

Michael Schmid
In reply to this post by CARL Philippe (LBP)
Hi Philippe,

enlarging Rois (except for Rectangles, ovals) is based on the mask,
i.e., the area that gets filled based on the Roi.

The 45° lines in your polygon Roi cut some pixels in their center, so
one cannot unambiguously decide whether these pixels are inside or not.
One needs a convention for how to treat such pixels.
ImageJ uses the convention that a if a pixel center is exactly at the
boundary of the Roi, it is considered outside if the area at the left is
outside. This convention is roughly consistent with the fact that lines
are always drawn to the right of pixel boundaries (it is not fully
consistent at some line angles, because lines are also drawn below pixel
boundaries).

This convention is the reason for the asymmetry. You can also see the
asymmetry with a fill/clear/Process>Math etc. operation on your Polygon
Roi.

Michael
________________________________________________________________


On 2019-02-14 16:50, Philippe CARL wrote:

> Dear all,
>
>
>
> Please consider the following small macro :
>
>                 newImage("Untitled", "8-bit black", 50, 50, 1);
>
>                 xCoord = newArray(29, 29, 29, 28, 27, 26, 25, 24, 23,
> 22,
> 21, 21, 21, 21, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 29);
>
>                 yCoord = newArray(25, 24, 23, 22, 21, 21, 21, 21, 21,
> 22,
> 23, 24, 25, 26, 27, 28, 29, 29, 29, 29, 29, 28, 27, 26, 25);
>
>                 makeSelection("polygon", xCoord, yCoord);
>
>                 Roi.setName(0);
>
>                 roiManager ("Add");
>
>                 for(i = 1; i != 10; i++)
>
>                 {
>
>                                roiManager("select", 0);
>
>                                run("Enlarge...", "enlarge=" + i);
>
>
>                                Roi.setName(i);
>
>                                roiManager ("Add");
>
>                 }
>
>                 roiManager("Show All");
>
> Is there a reason why the obtained enlarged Rois aren’t symmetrical?
>
>
>
> Also if I select several Rois within the roiManager (either by using
> the
> Shift or Ctrl key) why is only the first selected Roi shown up within
> the
> picture and not all the selected ones?
>
>
>
> I thank you very much in advance for your help and lightings.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Bioimagerie et Pathologies
>
> UMR 7021 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html