Login  Register

Sampling a profile plot

Posted by Richard Mort on Nov 10, 2008; 4:51pm
URL: http://imagej.273.s1.nabble.com/Sampling-a-profile-plot-tp3694565.html

Hi,

I'd like to be able to retrieve the pixel values of a subset of pixels
in a selection using the profile plot command and link this to the
resolution of the image to avoid sampling bias between images of
different sizes. I.e for example only returning a value for every 4th
pixel in the selection. The 'Oval Profile' plugin has a similar function
where you can specify how many measurements to make. In the example here
I have used this feature to draw a circle in a specific position and
then sample the circle at a specified density (every 4 pixels).


width = getWidth();
height = getHeight();

w = (width/10)*8
h = (height/10)*8
x = width/10
y = height/10
makeOval(x, y, w, h);

//oval is 80% of image width and height and centered

z = 4
p = 3.142
s = (width/10)*8

i = (s*p)/z

run("Oval Profile" , "number="+i+" analysis='Along Oval' show");
run("Close");

//calculates circumference and samples every 4 pixels

I'd like to be able to do this for different shaped selections. Any
suggestions?

Kind regards

Richard


--
Dr Richard Mort
MRC Human Genetics Unit
Western General Hospital
Crewe Road
Edinburgh
EH4 2XU, UK.

Phone: +44 (0)131 332 2471 x 3210
Fax: +44 (0)131 467 8456