Point selections from a multi-slice image

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

Point selections from a multi-slice image

cihat eldeniz
Hello,

If one would like to make point selections from a multi-slice image, with
the possibility that the slices can be associated with different roi's, how
does one

a) select the points on each slice? [If I am not mistaken, every ImagePlus
object seems to have a single roi associated with it no matter what the
number of slices is, and it is accessed through the function getRoi().]

b) access these points? [The getRoi functions of the classes ImageStack and
ImageProcessor return a Rectangle. I believe I can use the function
getMaskArray of the processor to find the points. Is that right? But the
multi-slice case still remains unsolved.]

c) access these points if they were picked on not a stack, but a
single-channel hyperstack with 14 z values and 50 t values?

Thanks very much...
Reply | Threaded
Open this post in threaded view
|

Re: Point selections from a multi-slice image

Michael Schmid
Hi,

(a) use the PointRoi class.

(b, c) it seems that the easiest would be using the ROI Manager,  
there you can store points together with the (hyper-)stack slice. In  
interactive mode, just type "t" or CTRL-t to store them.

Selecting a line in the roi manager will automatically set the  
correct slice.

When doing it from a plugin, you have quite a few public RoiManager  
functions that you can use:

get the RoiManager:
   public static RoiManager getInstance()
if null, create a new RoiManager;
if non-null, use getCount to get the length of its current contents,  
so you know where you start.

adding:
   public void add(ImagePlus imp, Roi roi, int n)

analyzing/restoring:
   public int getCount()
   public static String getName(String index)
   public int getSliceNumber(String label)
   public void select(int index)

Hope this helps,

Michael
________________________________________________________________

On 28 Apr 2009, at 20:39, cihat eldeniz wrote:

> Hello,
>
> If one would like to make point selections from a multi-slice  
> image, with
> the possibility that the slices can be associated with different  
> roi's, how
> does one
>
> a) select the points on each slice? [If I am not mistaken, every  
> ImagePlus
> object seems to have a single roi associated with it no matter what  
> the
> number of slices is, and it is accessed through the function getRoi
> ().]
>
> b) access these points? [The getRoi functions of the classes  
> ImageStack and
> ImageProcessor return a Rectangle. I believe I can use the function
> getMaskArray of the processor to find the points. Is that right?  
> But the
> multi-slice case still remains unsolved.]
>
> c) access these points if they were picked on not a stack, but a
> single-channel hyperstack with 14 z values and 50 t values?
>
> Thanks very much...