NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 364 - the stack.getProcessor(n) does not keep the roi information
the stack.getProcessor(n) does not keep the roi information
Status: RESOLVED WONTFIX
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
Macintosh Mac OS
: P2 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2011-09-15 23:02 CDT by Francesco Maccherozzi
Modified: 2011-09-16 04:48 CDT
1 user (show)

See Also:

Description Francesco Maccherozzi 2011-09-15 23:02:39 CDT
The getProcessor method of ImageStack class loses roi information.
Example:

1) bound an ImagePlus stack called imp, where a roi has been set:
>>> imp = IJ.getImage()

>>> print imp.getRoi()
Roi[Rectangle, x=314, y=46, width=104, height=52]

>>> ip_slice = imp.getProcessor()

2) if we print the roi of the processor, we get the right result, that is the same roi as imp
>>> print ip_slice.getRoi()
java.awt.Rectangle[x=314,y=46,width=104,height=52]

3) now we bound the ImageStack of 'imp' to 'stack' 
>>> stack = imp.getStack()

4) we verify that 'stak' has the right roi
>>> print stack.getRoi()
java.awt.Rectangle[x=314,y=46,width=104,height=52]

5) but if we get the ImageProcessor of one slice
>>> stack_slice = stack.getProcessor(1)

6) the ImageProcessor of the slide does not have the right roi
>>> print stack_slice.getRoi()
java.awt.Rectangle[x=0,y=0,width=512,height=512]

I have MacOs, Fiji, ImageJA 1.45o
Comment 1 Wayne Rasband 2011-09-16 04:48:58 CDT
The ImageStack.getProcessor() method does not set the ROI. You can use ip.setRoi(imp.getRoi()) as a work around. This behavior can not be changed without breaking existing plugins.