Unexpected behaviour of profile length

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unexpected behaviour of profile length

Pierre1981
Hello,

I am using the profile function and I have quite some issues when the spline I use has a 150 > length > 50 pixels and a width > 1 pixel.

Using the menu or a macro command such as:

profile = getProfile();
print(profile.length);

gives 100 pixels in length when the selection is actually quite different.
I tried many times and always got the same answer.

I have the latest version of ImageJ. This seems to be a problem which is perturbing for my application and it could be important for others...

Kind regards,
Pierre
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected behaviour of profile length

Rasband, Wayne (NIH/NIMH) [E]
On Jan 24, 2013, at 3:39 PM, Pierre1981 wrote:

> Hello,
>
> I am using the profile function and I have quite some issues when the spline
> I use has a 150 > length > 50 pixels and a width > 1 pixel.
>
> Using the menu or a macro command such as:
>
> profile = getProfile();
> print(profile.length);
>
> gives 100 pixels in length when the selection is actually quite different.
> I tried many times and always got the same answer.
>
> I have the latest version of ImageJ. This seems to be a problem which is
> perturbing for my application and it could be important for others...

Use the Edit>Selection>Interpolate command and set the interval to 1 to insure that the points that define the line are spaced one pixel apart.

  run("Interpolate", "interval=1 smooth");
  profile = getProfile();
  print(profile.length);

-wayne

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