getMask() not working properly

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

getMask() not working properly

piedrahitapablo
Hi, I'm currently working on a plugin to reconstruct digital holograms, to do so, the plugin needs to take the fourier transform of the hologram and the user must select a ROI on the spectrum. After this, the plugin just needs the information on the ROI to reconstruct the hologram. I'm trying to get that information using the getRoi() and getMask() methods from the ImageProcessor class, first I get the rectangular coordinates with getRoi(), and then apply the mask from getMask(), but no matter the ROI's type, getMask() is always returning null values. Do you have some advices about getMask() or another way to achieve this?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: getMask() not working properly

Rasband, Wayne (NIH/NIMH) [E]
On Jan 19, 2015, at 5:02 PM, piedrahitapablo <[hidden email]> wrote:

>
> Hi, I'm currently working on a plugin to reconstruct digital holograms, to do
> so, the plugin needs to take the fourier transform of the hologram and the
> user must select a ROI on the spectrum. After this, the plugin just needs
> the information on the ROI to reconstruct the hologram. I'm trying to get
> that information using the getRoi() and getMask() methods from the
> ImageProcessor class, first I get the rectangular coordinates with getRoi(),
> and then apply the mask from getMask(), but no matter the ROI's type,
> getMask() is always returning null values. Do you have some advices about
> getMask() or another way to achieve this?

The Roi, ImagePlus and ImageProcessor classes all have getMask() methods. The following JavaScript code uses the three methods to get and display the mask of an oval ROI.

-wayne

  img = IJ.createImage("Untitled", "8-bit black", 250, 250, 1);
  roi = new OvalRoi(30,30,160,120);
  mask1 = roi.getMask();
  new ImagePlus("mask1",mask1).show();
  img.setRoi(roi);
  mask2 = img.getMask();
  new ImagePlus("mask2",mask2).show();
  ip = img.getProcessor();
  mask3 = ip.getMask();
  new ImagePlus("mask3",mask3).show();
 
> --
> View this message in context: http://imagej.1557.x6.nabble.com/getMask-not-working-properly-tp5011288.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>

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

Re: getMask() not working properly

piedrahitapablo
Thanks Wayne, calling getMask() from the ImagePlus class solved my problem.