Login  Register

run("Enlarge...", "enlarge=-1"); when touching edge of field

Posted by Michael Cammer on Sep 23, 2007; 8:13pm
URL: http://imagej.273.s1.nabble.com/run-Enlarge-enlarge-1-when-touching-edge-of-field-tp3698339.html

I have found that using the run("Clear Outside"); command in a macro
sometimes leaves a few pixels at the edge of the selection.

Therefore, I want to shrink the region of interest by one pixel before
clearing.  So I tried run("Enlarge...", "enlarge=-1");

The problem is that there is always at least one part of the ROI touching
the edge of the image, so the error "Cannot shrink selections touching
image edge" is returned.

Would it be possible to change ImageJ so that if run("Enlarge...",
"enlarge=-1"); is given a negative number, it will work?  I may be able to
solve the problem in the meantime by using analyze particles, but would
prefer to do it this way:

     run("Enlarge...", "enlarge=-1");
     run("Clear Outside");
     doWand(0, getHeight()/2);

Thank you.

using ImageJ 1.39e  Java 1.5.0_09 on Windows Vista
_________________________________________
Michael Cammer   http://www.aecom.yu.edu/aif/