Hi Fred,
Please provide a small and runnable script or plugin that reproduces this
problem. The following script works as expected. There is no scaling and the
display range
does not change.
-wayne
imp = IJ.createImage("Untitled", "16-bit ramp", 512, 512, 1);
ip1 = imp.getProcessor();
ip1.multiply(0.5);
ip1.resetMinAndMax();
imp = IJ.createImage("Untitled", "16-bit ramp", 256, 256, 1);
ip2 = imp.getProcessor();
ip2.multiply(0.9);
ip2.resetMinAndMax();
IJ.log("");
IJ.log("ip2 range: "+ip2.getMin()+"-"+ip2.getMax());
IJ.log("ip1 range (before): "+ip1.getMin()+"-"+ip1.getMax());
ip1.insert(ip2, 128, 128);
IJ.log("ip1 range (after): "+ip1.getMin()+"-"+ip1.getMax());
new ImagePlus("ip1 after insert",ip1).show();
> On Apr 18, 2024, at 9:06 PM, [email protected] wrote:
>
> Hi Fred,
>
> Please provide a small and runnable script or plugin that reproduces this
> problem. The following script works as expected. There is no scaling and LUT
> is unchanged.
>
> -wayne
>
> imp = IJ.createImage("Untitled", "16-bit ramp", 512, 512, 1);
> ip1 = imp.getProcessor();
> ip1.multiply(0.5);
> ip1.resetMinAndMax();
> imp = IJ.createImage("Untitled", "16-bit ramp", 256, 256, 1);
> ip2 = imp.getProcessor();
> ip2.multiply(0.25);
> ip2.resetMinAndMax();
> IJ.log("");
> IJ.log("ip2 range: "+ip2.getMin()+"-"+ip2.getMax());
> IJ.log("ip1 range (before): "+ip1.getMin()+"-"+ip1.getMax());
> ip1.insert(ip2, 128, 128);
> IJ.log("ip1 range (after): "+ip1.getMin()+"-"+ip1.getMax());
> new ImagePlus("ip1 after insert",ip1).show();
>
>
>
>> On Apr 18, 2024, at 12:04 AM, Fred Damen <[email protected]> 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