Re: get Subimage from ImagePlus
Posted by
Bill Mohler on
Oct 21, 2009; 4:53pm
URL: http://imagej.273.s1.nabble.com/get-Subimage-from-ImagePlus-tp3690681p3690684.html
Are the cropped-out pixels of the image automatically flushed from
memory when setProcessor(null,ip.crop()) is performed?
Also, can this be run on each slice of a virtual stack as it is called
up in an imageProcessor to be displayed? In other words, can one
dynamically crop display of a VirtualStack without the data all being
loaded into memory?
Thanks,
Bill
Wayne Rasband wrote:
> > Hello community
> >
> > I need to cut a subimage from an ImagePlus object. For
> > example I have an ImagePlus object with the size 800X800
> > and I need just a part of this image of the size 400X400.
> >
> > Is there a simple way to do this?
>
> Yes. Here is an example (in JavaScript):
>
> imp = IJ.openImage("
http://rsb.info.nih.gov/ij/images/ct.dcm.zip");
> ip = imp.getProcessor();
> ip.setRoi(233, 0, 400, 400);
> imp.setProcessor(null, ip.crop());
> imp.show();
>
> -wayne
>
>