Posted by
Gabriel Landini on
Jul 17, 2016; 2:18pm
URL: http://imagej.273.s1.nabble.com/Bug-in-Background-Subtracter-tp5016896p5016902.html
On Sunday 17 Jul 2016 15:47:01 Koen van dijken wrote:
> That is strange that you get expected results and I do not.
> What is also strange is when I run Background Subtracter I see a red image
> (only the red channel). When I save it and open it again I only see three
> black slices in this tiff.
This macro confirms what I suggested in my previous email, and how to avoid
the 'red image' (which is what happens when you process a single composite
channel).
To work with an RGB image, just uncomment the RGB line and delete the
following line.
If you want to process the composite in 32bit, I think you need to subtract
the background for each channel (so, select the next [green] channel, apply
background subtraction, and do the same for the third channel).
However that is not without further complications, as it gives a different
result than a processing the RGB image in one go because the composite
channels do not have the same predictable histogram ranges for display (see
that after subtracting the background the channels have lots of negative
values).
Not sure how you should re-scale those channels after the subtraction, sorry.
- - -
run("Lena (68K)");
run("Split Channels");
selectWindow("lena-std.tif (red)");
run("32-bit");
setMinAndMax(0, 255);
selectWindow("lena-std.tif (green)");
run("32-bit");
setMinAndMax(0, 255);
selectWindow("lena-std.tif (blue)");
run("32-bit");
setMinAndMax(0, 255);
//run("Merge Channels...", "c1=[lena-std.tif (red)] c2=[lena-std.tif (green)]
c3=[lena-std.tif (blue)] "); // RGB
run("Merge Channels...", "c1=[lena-std.tif (red)] c2=[lena-std.tif (green)]
c3=[lena-std.tif (blue)] create"); //composite
run("Subtract Background...", "rolling=50 light");
- - -
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html