Posted by
Josh Doe on
Mar 23, 2006; 6:31pm
URL: http://imagej.273.s1.nabble.com/Find-bounding-box-coordinates-for-target-in-binary-mask-image-tp3703318p3703320.html
Thanks Wayne, that works perfectly. I'm greedy though, and want to
extrapolate this to batch process a couple hundred images. I've thought of a
few ways to do this:
1) Is there any sort of a "select by color" tool? If so, I could simply
select any white portions, and then Analyze->Measure. In this case, is there
some way to pull off the values using a macro or something, so that I can
batch this?
2) I found that "Analyze Particles" takes care of the first part of the
problem from (1). I'd still need some way to pull off the measured values.
Since I have some non-contiguous regions, I get multiple "particles". I
could just then do some math to find the min and max dimensions from all
measured particles, to come up with one bounding box that encloses all of them.
3) Write a program. I did a quick m-file for Matlab that does the job, but
takes a VERY long time, even for just one image. Besides, I don't like to
rely on non-free software. :)
Thanks for any suggestions.
-jmd
On Thu, 23 Mar 2006 09:44:07 -0500, Wayne Rasband <
[hidden email]> wrote:
>> Hi, I have some binary mask images, and I need to get the
>> coordinates and size of a box surrounding the part of
>> interest. Basically the images are all black, except for a
>> clump of white pixels somewhere in the image, which I call
>> the "target".
>>
>> So what I could do is open each image in ImageJ, move the
>> cursor to the left most pixel of the "target", then the
>> right side, top side, and bottom side, writing down the
>> pixel location for each of these. Then I can find the center
>> of the target, and the tolerances for the bounding box, side
>> to side and top to bottom.
>>
>> However, this is very tedious, and I have many such images.
>> Is there some automated way of getting these coordinates,
>> either using ImageJ or something else? Thanks for any
>> suggestions.
>
> 1. Check "Bounding Rectangle" in Analyze>Set Measurements
> 2. Click inside the "target" with the wand tool
> 3. Press 'm' (Analyze>Measure)
>
>-wayne