Posted by
Michael Schmid on
URL: http://imagej.273.s1.nabble.com/How-to-cut-an-image-into-image-parts-tp3682979p3682985.html
Hi rajava,
You need two things:
(1) the image with the background not appearing as an object.
(2) a Wand that can omit interior holes. You can use the Versatile
Wand from
http://imagejdocu.tudor.lu/doku.php?
id=plugin:segmentation:versatile_wand:start
Assuming pixel (0,0) is background:
run("RGB Color");
run("8-bit");
setAutoThreshold("Default dark");
run("Apply LUT");
run("Versatile Wand", "value=0 color=0 gradient=0 connectedness=8-
connected x=0 y=0 do");
run("Clear", "slice"); //surrounding should be background
run("Select None");
run("Find Maxima...", "noise=0 output=List light");
Then have a loop and run the wand with the x and y coordinates of
each line in the Results Table, Duplicate and 'Clear Outside' in the
new image; then select the original again for selecting the next part.
Note that "Find Maxima..." always reports the position of a
foreground pixel of the object, it will never give you the position
of an inner hole or even a pixel.
An alternative would be "Analyze Particles" with "Record Starts" on,
then use the XStart and YStart for the wand.
Michael
________________________________________________________________
On 26 Sep 2011, at 13:34, rajava wrote: