|
All,
I may be missing something (not the first time!) but it seems to me that when I try to use ip.resize (..., ...) in my plugin the type is not inherited correctly by the new ImageProcessor.
An example is a case where I have operated on an array of values and have them in an ImageProcessor fp3, which is 16bit data and checks out OK in my debugging. I want to resize this for display so I follow the workflow:
ImagePlus new_image;
Image Processor fp3;
.
fp3.setPixels(my_array); // 16bit values stored OK in fp3
.
fp3.setInterpolationMethod(2);
ImageProcessor new_fp = fp3.resize(new_width, new_height);
.
new_image.setProcessor("Resized_image", new_fp);
.
new_image.show();
The image shows up in a frame labeled with the intended size for X and Y, and that shows it to be "16 bit" as expected, but the values in the image and its histogram are definitely 8-bit. I have checked and it seems like the values became 8-bit when they were moved into ImageProcessor new_fp, even though the ImagePlus of new_image has TYPE=1 (Grey 16) when I query it.
Have I overlooked a simple problem, or is this something inherent in the ip.resize method? And if the latter, is there a work-around??
Thanks for your suggestions
Chris H
|