Login  Register

Re: how to get multi-point Z coordinates

Posted by Wayne Rasband-2 on Oct 20, 2019; 5:50pm
URL: http://imagej.273.s1.nabble.com/how-to-get-multi-point-Z-coordinates-tp5022551p5022554.html

> On Oct 20, 2019, at 6:35 AM, CARL Philippe (LBP) <[hidden email]> wrote:
>
> Dear Wayne,
> How are you doing?
> Don't you rather want to call this new macro method: Roi.getStackPosition(i)
> or something similar which would make it a little bit more self explaining?

The new Roi.getPointPosition(index) macro function corresponds to the PointRoi.getPointPosition(index) method. It is needed because each point in a point selection can have a different position. For other types of selection, use the new Roi.getPosition(channel,slice,frame) function.

The macro functions added in ImageJ 1.52r are described at

     http://wsr.imagej.net/developer/macro/functions.html

To find them, search for "Requires 1.52r".

-wayne

> I guess this the macro method corresponding to the ij.gui.Roi.java getPosition() method, or am I wrong?
> Have a nice week-end.
> Kindest regards,
> Philippe
>
> ----- Mail original -----
> De: "Wayne Rasband" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Dimanche 20 Octobre 2019 07:25:09
> Objet: Re: how to get multi-point Z coordinates
>
>> On Oct 18, 2019, at 5:04 AM, Leroy Olivier <[hidden email]> wrote:
>>
>> Hello,
>>
>> I have a Z stack with a multi-point selection.
>> Points are in different slices.
>> To get X and Y coordinates of all points is easy with getSelectionCoordinates(x, y) macro function.
>> But I don't know how to get the Z coordinates.
>> Any idea ?
>
> The latest ImageJ daily build (1.52r48) adds the Roi.getPointPosition(index) macro function, which returns the stack position of the point with the specified index. Here is an example:
>
>   for (i=0; i<Roi.size; i++)
>      print(i+" "+Roi.getPointPosition(i));
>
> -wayne

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