Difference between scaling units

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

Difference between scaling units

vischer
Hi All,
I always assumed that the scaling unit does not have effect on the results.
However, the macro below does twice the same job, first with inches and then with microns, and I get different results (different interpretation of min-max). Is this a bug?

Norbert Vischer




        run("Close All");
       
        run("Blobs (25K)");
        run("Set Scale...", "distance=15 known=1 pixel=1 unit=inch");
        setAutoThreshold("Otsu");
        run("Analyze Particles...", "size=1-100  clear include add");
       
        run("Blobs (25K)");
        run("Set Scale...", "distance=15 known=1 pixel=1 unit=um");
        setAutoThreshold("Otsu");
        run("Analyze Particles...", "size=1-100  clear include add");

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Difference between scaling units

Gabriel Landini
On Tuesday 10 Jul 2012 21:39:52 you wrote:
> I always assumed that the scaling unit does not have effect on the results.
> However, the macro below does twice the same job, first with inches and then
> with microns, and I get different results (different interpretation of
> min-max). Is this a bug?

Very odd. If you use "inches" or "mm" instead of "inch" it seems to work OK.
No idea why, though.
Regards

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Difference between scaling units

Michael Schmid
In reply to this post by vischer
Hi Norbert,

yes, I can reproduce it.

The answer lies in line 275 of ParticleAnalyzer.java:
If the Unit is in inches, it uses pixels instead of calibrated lengths and areas.

I guess that the original idea was to avoid calibration of images that come from digital cameras etc; sometimes these have a calibration in inches, to set a default size for printing, etc.
Also if I save a .tif in Photoshop, I think that I can't avoid having an image scale (which is in inches).

Maybe it was assumed that no one would use inches for scientific measurements?
I can hardly think why one would use such a strange unit (though maybe not as strange as femtoparsecs ;-)  - but I am not living in the US...

I think that a cleaner way would be to have an option (in Input/Output Options) to ignore the spatial calibration upon opening an image, when in inches...

Michael
________________________________________________________________
On Jul 10, 2012, at 22:39, Norbert Vischer wrote:

> Hi All,
> I always assumed that the scaling unit does not have effect on the results.
> However, the macro below does twice the same job, first with inches and then with microns, and I get different results (different interpretation of min-max). Is this a bug?
>
> Norbert Vischer
>
>
>
>
> run("Close All");
>
> run("Blobs (25K)");
> run("Set Scale...", "distance=15 known=1 pixel=1 unit=inch");
> setAutoThreshold("Otsu");
> run("Analyze Particles...", "size=1-100  clear include add");
>
> run("Blobs (25K)");
> run("Set Scale...", "distance=15 known=1 pixel=1 unit=um");
> setAutoThreshold("Otsu");
> run("Analyze Particles...", "size=1-100  clear include add");
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Difference between scaling units

vischer
Hello Michael,

thanks for figuring out the source location. But I hope Wayne won't add yet another option, which give so many problems when you distribute your software to clients. I think everyone will understand us when we say that an inch is an inch (and not a special case).


Norbert Vischer

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