Hi Fred,
your code snippet does not say which type of images you have, i.e.,
8-bit, 16-bit, Float or RGB.
ImageProcessor.insert has to do a conversion if you insert an image of a
different type, e.g., if you insert a 16-bit or float image into a byte
image. The conversion scales the input to make the display range of the
input image fit the range of possible pixel values in the target image.
To avoid scaling on type conversion, you can
- either set the limits of the input image to fit the range of the
target image, e.g. setMinAndMax(0,255) if you want to insert it into a
byte image,
- or you convert it beforehand to the target type. the TypeConverter has
a doScaling option where you can suppress scaling.
Michael
________________________________________________________________
On 18.04.24 06:03, Fred Damen wrote:
Greetings,
In the below java code the ImageProcessor.insert is some how changing the
dynamic range, i.e., the values, of the ImageProcessor that is being
passed to insert; seems as W&L-auto is performed and LUT values are what
is inserted. What to add to Java code to stop or cause this effect.
Thanks in advance,
Fred
ImageStack mis = new ImageStack(width,imps.length*height);
for(int iz=0; iz<ss; iz++) {
ImageProcessor mip =
imps[0].getProcessor().createProcessor(width,imps.length*height);
mip.setColor(Toolbar.getBackgroundColor());
mip.fill();
for(int i=0; i<imps.length; i++)
if (imps[i] != null) {
int[] x0y0 =
offset(width,height,imps[i].getWidth(),imps[i].getHeight(),where);
mip.insert(imps[i].getStack().getProcessor(iz+1),x0y0[0],i*height+x0y0[1]);
}
mis.addSlice(mip);
}
ImagePlus mimp = new ImagePlus(null, mis);
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html