Measuring along oblique lines
Posted by Fintan McEvoy-2 on Apr 05, 2007; 3:14pm
URL: http://imagej.273.s1.nabble.com/Measuring-along-oblique-lines-tp3699835.html
Hi,
Can anybody help with what are probably very basic questions?
My questions :
If a line selection runs obliquely across the image how does "getProfile" in
ImageJ count pixels?
Does it count every pixel the line touches?
Can I accurately measure distances along oblique lines in ImageJ?
Is there any merit in measuring aling lines parallel to either the x or y axis?
I know that the line is drawn from the upper left corner of each pixel I
specify in the makeLine command.
If the line is parallel with the side of the pixel, ImageJ will count the
exact number of pixels between two points of interest along the line and
since I know the pixel dimensions, I can then calculate a distance that
interests me.
The detail of what I am doing is below:
I am using a macro that contains written to run on CT images. I want to
measure the thickness of subcutaneous adipose tissue. The while statment
below starts checking the value of the pixel at "i", this will be less than
zero for air outside the patient , more than zero for skin and then again
less than zero for adipose tissue. Thus the the junction between skin and
adipose tissue is detected ad the variable "outer" gets the value of "i",
the process is repated to give the inner edge. Since the lne is parallel
with the y axis of the image , all I need to do to get the thickness of the
tissue in pixels is subtract the value of the variable "outer" from the
value of "i" when it is stoped at the "inner edge"
In order to make measurements around the whole circumference of the patient
I have opted to rotate the image and not the line because I am not clear
what ImageJ, "getProfile" does with oblique lines,
selectImage("temp6.dcm");
w = getWidth/2;
h = getHeight/2;
makeLine (w,0,w,h);
value=getProfile;
i=0;
while (value[i]<0) {i++;}
//outer adipose edge
while (value[i]>0) {i++;}
outer=i;
//inner adipose edge
while (value[i]<-0) {i++;}
//sub cutis fat thickness
t=(outer-i)*(-1);
Thanks in anticipation for any help
Fintan McEvoy