Login  Register

Croping images with border equal to zero

Posted by CARL Philippe (LBP) on Jun 11, 2015; 3:06pm
URL: http://imagej.273.s1.nabble.com/TrakEM2-segmentation-with-polygon-ROI-not-working-Bug-tp5013118p5013124.html

Dear all,
I have some issues with selecting and cropping a part of my images.
The pictures I have look like the following ones:
run("Blobs (25K)");
run("Canvas Size...", "width=276 height=274 position=Center zero");
or
run("Blobs (25K)");
run("Canvas Size...", "width=276 height=274 position=Top-Right zero");
i.e. 8bit pictures with a border equal to zero and this border can be everywhere.
Which means all around the picture, or only on a side or at the top-left, top-right,… side…
And what I woulk like to do is to crop out the border part of the picture (which has always an intensity equal to zero).
So what would be the most efficient way for performing this?
I tried something similar to:
run("Blobs (25K)");
run("Canvas Size...", "width=276 height=274 position=Center zero");
doWand(5, 269);
but the obtained result for the doWand(5, 269); or doWand(5, 137); is quite different which is kind of problematic.
Also sometimes I need to make an inverse in order to perform this like:
run("Blobs (25K)");
run("Canvas Size...", "width=276 height=274 position=Top-Right zero");
doWand(6, 209);
run("Make Inverse");
I thank you very much in advance for your help and ideas.
My best regards,
Philippe

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html