Login  Register

area calculations - discrepancy in the manual and batch results

Posted by ram prasad on Jan 22, 2016; 12:44pm
URL: http://imagej.273.s1.nabble.com/area-calculations-discrepancy-in-the-manual-and-batch-results-tp5015432.html

Hi all,

I'm trying to get the number of black coloured pixels on either side of a
line, which will be drawn by me using the line selection tool.

My idea was to generate a macro that would,

1) Select the line tool
2) Wait for my input
3) Rotate my line by 90degrees.
3) Calculate slope and extrapolate the line to the edges of my image.
4) Make a polygon from the line coordinates and add it to ROI
5) Inverse my selection and add it to ROI
6) Duplicate the original image
7) Select ROI 0
8) Set foreground colour to blue
9) Fill the other slice with foreground colour.
10) Use thresholder to identify black pixels and make a selection
11) Restore selction on the original image and calculate the area of the
selection.
12) Repeat  6-11 for ROI 1.

When I implement this approach manually I get the expected area(approx 140k
pixels). However, the macro doesn't seem to work as the area calculations
seems to be in the range of (2M pixels) and I'm not sure why. Any pointers
are definitely appreciated.

Herewith, I'm attaching my script and a sample image for your reference.
The line in the image is where I would like to partition my image into two
halves(output of step 3).

Let me know if you need more information.

Thanks,
Ram

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

split_calc.txt (4K) Download Attachment
ed_10-2-2.jpg (483K) Download Attachment