|
Hello
While working with ImageJ for restoring a particular selection pattern I
encountered a problem, where I get three results for independent execution
in ImageJ, as macro, as java plugin. The basic steps correspond to the steps
in macro given below.
selectWindow("1104har-1.jpg");
setAutoThreshold("Default");
//run("Threshold...");
setThreshold(60, 255);
run("Create Selection");
run("Make Inverse");
selectWindow("1104har.jpg");
run("Restore Selection");
run("Fill", "slice");
run("Select None");
run("RGB Color");
run("Color Balance...");
setMinAndMax(0, 90);
call("ij.ImagePlus.setDefault16bitRange", 0);
run("Restore Selection");
run("Make Inverse");
run("Copy");
selectWindow("1104uin.bmp");
run("RGB Color");
run("Paste");
saveAs("Jpeg", "C:\\Users\\DM\\Desktop\\fin.jpg");
*the plugin is as follows*
showProcessor(ipHarris,"Harris");
IJ.run("Remove Outliers...", "radius=2 threshold=50 which=Bright");
ImagePlus window1 = ij.WindowManager.getCurrentImage();
IJ.setThreshold(60, 255);
IJ.run("Create Selection");
IJ.run("Make Inverse");
showProcessor(ipHarris,"Harrisagain");
ImagePlus windowthresh = ij.WindowManager.getCurrentImage();
IJ.run("Restore Selection");
IJ.run( "Fill", "slice");
IJ.run("Select None");
// i do a measurement here, am not sure if this will interfere
with the current window, though i dont feel it will
IJ.run( "RGB Color", "");
IJ.run( "Color Balance...", "");
IJ.setMinAndMax(0, 135);
ImagePlus.setDefault16bitRange(0);
IJ.run("Restore Selection", "");
IJ.run( "Copy", "");
showProcessor(ipFinal,"Thresh");
ImagePlus windowredthresh = ij.WindowManager.getCurrentImage();
IJ.setMinAndMax(60, 160);
ImagePlus.setDefault16bitRange(0);
IJ.run("RGB Color");
IJ.run( "Paste");
IJ.saveAs( "Jpeg", tempstr1);
when i choose the color balance tool in ImageJ the default color is red
therefore the final image is with varied intensities just like i expect
denoting the strength of the objects selected. however when i do this with
macro the default color seems to be white where i cant easily denote the
strength of the objects detected. and in the case of the plugin the paste
step simply seems to paste the previous image on to the new window.
can someone tell how i can implement the paste step as it works in imagej by
just copying the selection and not the entire image.
regards
--
Donny George
|