Back and forth updates within the Particle Analyzer

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

Back and forth updates within the Particle Analyzer

CARL Philippe (LBP)
Dear all (probably mostly Michael and Wayne),
Within the version 1.52k and the following correction:
Thanks to Johannes Wibisana, fixed a bug in the Particle Analyzer that caused ROIs added to overlays and the ROI Manager to not exclude interior holes.
when analyzing the following picture:
[ http://punias.free.fr/ImageJ/The_Ring.tif ] [ http://punias.free.fr/ImageJ/The_Ring.tif | http://punias.free.fr/ImageJ/The_Ring.tif ]
the Analyze> Analyze _ Particle... method was nicely identifying a ring ROI.
But in the next update (i.e. 1.52l) with the following correction:
Thanks to Gilles Carpentier, fixed a 1.52k regression that caused the particle analyzer to unexpectedly create composite ROIs.
these lines have been erased from the addToRoiManager and drawOutline methods within the ParticleAnalyzer.java file:
if (floodFill && mask!=null) {
mask.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE);
roi2 = new ThresholdToSelection().convert(mask);
if (roi2!=null && (roi2 instanceof ShapeRoi)) {
roi2.setLocation(roi.getXBase(), roi.getYBase());
((ShapeRoi)roi2).setPaPerim(roi.getLength());
} else
roi2 = (Roi)roi.clone();
} else
roi2 = (Roi)roi.clone();
which make The_Ring.tif picture to be only recognized as a circular ROI.
Thus would it be possible to make a compilation of this, i.e. having the Analyze> Analyze _ Particle... method correctly recognize The_Ring example picture as a ring ROI, while not generating the bug reported by Johannes Wibisana?
I thank you very much in advance for your help on this issue.
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: Back and forth updates within the Particle Analyzer

Michael Schmid
Hi Philippe,

there were a few problems with the ParticleAnalyzer creating Composite
ROIs, i.e., ROIs that cannot be described by a single border line.
Looking into previous email discussions with Wayne, I find these issues;
but there may be more:

- Perimeter: Traditionally, for particles with holes the Particle
analyzer gives only the perimeter of the outer outline, it does not
include the border lengths of interior holes. Changing this could break
existing macros and protocols.
On the other hand, perimeter measurements on a Composite ROI (ShapeRoi
class) include all perimeters, also the border of inner holes. It would
be much work to change this, and it might also break other
procedures/macros.
(A Composite ROI only knows its corner coordinates, it does not know
what is an inner and what is an outer border, and the code even allows
Composite Roi types consisting of self-intersecting Bezier curves where
it would be close to impossible to get a decent solution for the outer
perimeter; not sure whether these ROI types are actually used anywhere).
In some versions, Wayne had added code to save the perimeter created by
the ParticleAnalyzer as a property of the ROI, but that would have made
the perimeter measurement of a Composite ROI dependent on whether it has
been created by the ParticleAnalyzer or some other way, which is also
unsatisfactory - and then what to do with the perimeter if that roi gets
slighly modified, e.g. by moving one of its corner points or by 'OR' or
'AND' (=intersection) operations with other rois? Such an operation
might result in an actual change or not, so should it make the
ParticleAnalyzer-created perimeter invalid or not?

- Area to Line: There are macros (by Gilles Carpentier) that use "Area
to Line" on ROIs created by the ParticleAnalyzer. This does not work
with Composite ROIs.


If you need composite ROIs from the ParticleAnalyzer, you could use the
'Record starts' option and the call the VersatileWand plugin [1] at each
of the XStart, YStart positions. The VersatileWand creates composite
ROIs if its 'include holes' option is off.

[1]
https://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:versatile_wand:start



Michael
________________________________________________________________
On 12.09.19 15:06, CARL Philippe (LBP) wrote:

> Dear all (probably mostly Michael and Wayne),
> Within the version 1.52k and the following correction:
> Thanks to Johannes Wibisana, fixed a bug in the Particle Analyzer that caused ROIs added to overlays and the ROI Manager to not exclude interior holes.
> when analyzing the following picture:
> [ http://punias.free.fr/ImageJ/The_Ring.tif ] [ http://punias.free.fr/ImageJ/The_Ring.tif | http://punias.free.fr/ImageJ/The_Ring.tif ]
> the Analyze> Analyze _ Particle... method was nicely identifying a ring ROI.
> But in the next update (i.e. 1.52l) with the following correction:
> Thanks to Gilles Carpentier, fixed a 1.52k regression that caused the particle analyzer to unexpectedly create composite ROIs.
> these lines have been erased from the addToRoiManager and drawOutline methods within the ParticleAnalyzer.java file:
> if (floodFill && mask!=null) {
> mask.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE);
> roi2 = new ThresholdToSelection().convert(mask);
> if (roi2!=null && (roi2 instanceof ShapeRoi)) {
> roi2.setLocation(roi.getXBase(), roi.getYBase());
> ((ShapeRoi)roi2).setPaPerim(roi.getLength());
> } else
> roi2 = (Roi)roi.clone();
> } else
> roi2 = (Roi)roi.clone();
> which make The_Ring.tif picture to be only recognized as a circular ROI.
> Thus would it be possible to make a compilation of this, i.e. having the Analyze> Analyze _ Particle... method correctly recognize The_Ring example picture as a ring ROI, while not generating the bug reported by Johannes Wibisana?
> I thank you very much in advance for your help on this issue.
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Back and forth updates within the Particle Analyzer

CARL Philippe (LBP)
Servus Michael,
How are you doing?
Thanks a lot for your very detailed explanations!
Very unfortunately, being quite stubborn, I tried not to listen to you by trying to create a parallel "1.52k like" version of the Particle Analyzer tool.
But as I saw it, the ParticleAnalyzer class is connected with the Analyzer class and when I had solved this issue I saw that the daily build version of the ShapeRoi class that is connected with the Roi one isn't anymore compatible with the Rois I wanted to generate.
And since I wasn't really able to create ad hoc ShapeRoi and Roi classes, I gave it finally up and I will thus stuck with your suggestion of using the VersatileWand tool.
Have a nice week-end.
Kindest regards,
Philippe

----- Mail original -----
De: "Michael Schmid" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Jeudi 12 Septembre 2019 15:59:30
Objet: Re: Back and forth updates within the Particle Analyzer

Hi Philippe,

there were a few problems with the ParticleAnalyzer creating Composite
ROIs, i.e., ROIs that cannot be described by a single border line.
Looking into previous email discussions with Wayne, I find these issues;
but there may be more:

- Perimeter: Traditionally, for particles with holes the Particle
analyzer gives only the perimeter of the outer outline, it does not
include the border lengths of interior holes. Changing this could break
existing macros and protocols.
On the other hand, perimeter measurements on a Composite ROI (ShapeRoi
class) include all perimeters, also the border of inner holes. It would
be much work to change this, and it might also break other
procedures/macros.
(A Composite ROI only knows its corner coordinates, it does not know
what is an inner and what is an outer border, and the code even allows
Composite Roi types consisting of self-intersecting Bezier curves where
it would be close to impossible to get a decent solution for the outer
perimeter; not sure whether these ROI types are actually used anywhere).
In some versions, Wayne had added code to save the perimeter created by
the ParticleAnalyzer as a property of the ROI, but that would have made
the perimeter measurement of a Composite ROI dependent on whether it has
been created by the ParticleAnalyzer or some other way, which is also
unsatisfactory - and then what to do with the perimeter if that roi gets
slighly modified, e.g. by moving one of its corner points or by 'OR' or
'AND' (=intersection) operations with other rois? Such an operation
might result in an actual change or not, so should it make the
ParticleAnalyzer-created perimeter invalid or not?

- Area to Line: There are macros (by Gilles Carpentier) that use "Area
to Line" on ROIs created by the ParticleAnalyzer. This does not work
with Composite ROIs.


If you need composite ROIs from the ParticleAnalyzer, you could use the
'Record starts' option and the call the VersatileWand plugin [1] at each
of the XStart, YStart positions. The VersatileWand creates composite
ROIs if its 'include holes' option is off.

[1]
https://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:versatile_wand:start



Michael
________________________________________________________________
On 12.09.19 15:06, CARL Philippe (LBP) wrote:

> Dear all (probably mostly Michael and Wayne),
> Within the version 1.52k and the following correction:
> Thanks to Johannes Wibisana, fixed a bug in the Particle Analyzer that caused ROIs added to overlays and the ROI Manager to not exclude interior holes.
> when analyzing the following picture:
> [ http://punias.free.fr/ImageJ/The_Ring.tif ] [ http://punias.free.fr/ImageJ/The_Ring.tif | http://punias.free.fr/ImageJ/The_Ring.tif ]
> the Analyze> Analyze _ Particle... method was nicely identifying a ring ROI.
> But in the next update (i.e. 1.52l) with the following correction:
> Thanks to Gilles Carpentier, fixed a 1.52k regression that caused the particle analyzer to unexpectedly create composite ROIs.
> these lines have been erased from the addToRoiManager and drawOutline methods within the ParticleAnalyzer.java file:
> if (floodFill && mask!=null) {
> mask.setThreshold(255, 255, ImageProcessor.NO_LUT_UPDATE);
> roi2 = new ThresholdToSelection().convert(mask);
> if (roi2!=null && (roi2 instanceof ShapeRoi)) {
> roi2.setLocation(roi.getXBase(), roi.getYBase());
> ((ShapeRoi)roi2).setPaPerim(roi.getLength());
> } else
> roi2 = (Roi)roi.clone();
> } else
> roi2 = (Roi)roi.clone();
> which make The_Ring.tif picture to be only recognized as a circular ROI.
> Thus would it be possible to make a compilation of this, i.e. having the Analyze> Analyze _ Particle... method correctly recognize The_Ring example picture as a ring ROI, while not generating the bug reported by Johannes Wibisana?
> I thank you very much in advance for your help on this issue.
> 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

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