I am using ImageJ in a project and am having some trouble cropping and using the cropped image.
I would like to crop an ImagePlus object and then have just the cropped region to work with rather than the original image still. Here is the where I am struggling:
println(imp.getWidth(), im.getHeight(); ImageProcessor temp = imp.getProcessor(); temp.setRoi(X1, Y1, X2-X1, Y2-Y1); temp.crop(); imp.setProcessor(temp); println(imp.getWidth(), im.getHeight();
Here’s the output:
3744 2560 3744 2560
I understand that this isn’t actually changing the ImagePlus object and is just changing the ImageProcessor, but I’m not sure how to access a modified version of the ImagePlus object who’s ImageProcessor I am changing.
Thank you in advance for your input!