Login  Register

Re: pixel size is slightly different when .dcm is saved as .tif

Posted by Herbie on Oct 27, 2016; 12:26pm
URL: http://imagej.273.s1.nabble.com/pixel-size-is-slightly-different-when-dcm-is-saved-as-tif-tp5017492p5017493.html

Good day Schebique,

I fear you are reaching the limit of the number representation...

Of course this limit isn't absolute but without changing the Java code,
you have to accept it.

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::
Am 27.10.16 um 13:09 schrieb Ondřej Šebesta:

> Dear ImageJ developers.
>
> I found slightly different results when measuring dicom images and their
> respective .tif form. Let say .dcom is calibrated as 0.139999000 mm/pixel.
> I save it as .tif and it is still this value. But after reopen this .tif
> file pixel size is interpreted as 0.139999003, which leads to a slightly
> different results in e.g. Area measurements.
>
> In fact, it is not very important for my results, but I would like to know
> where this inconsistency is coming from? If it is the bug or it is some
> kind of number conversion error?
>
> Here is the table you get by running macro on sample images
> <https://drive.google.com/open?id=0BxY9MV1ofnZCdDljMGJheFE3ZWc>:
>
> Label pixelSize Area
> Mik437_Fe_dx0735.dcm 0.139999000 2620.913757974
> Mik437_Fe_dx0735.tif 0.139999000 2620.913757974
> Mik437_Fe_dx0735-reopen.tif 0.139999003 2620.913878054
> Mik441_Fe_dx0751.dcm 0.100002000 1483.049660400
> Mik441_Fe_dx0751.tif 0.100002000 1483.049660400
> Mik441_Fe_dx0751-reopen.tif 0.100002000 1483.049660993
> Macro:
> image="Mik437_Fe_dx0735.dcm"; //"bad" image
> //image="Mik441_Fe_dx0751.dcm"; //"good" image
> run("Set Measurements...", "display redirect=None decimal=9");
> path=getDirectory("choose folder with example images");
> open(path+image);
> title=replace(getTitle(), ".dcm", "");
> measure();
> saveAs("Tiff", path+title+".tif");
> measure();
> run("Revert"); //reopen last saved tif
> newTitle=title+"-reopen.tif";
> rename(newTitle);
> measure();
> close();
>
> function measure() {
> title=getTitle();
> getVoxelSize(gVwidth, height, depth, unit);
> getStatistics(Area);
> n=nResults;
> setResult("Label", n, title);
> setResult("pixelSize", n, gVwidth);
> setResult("Area", n, Area);
>
> ----------------------------------------
> I would appreciate any hints.
>
> Have a nice day.
> Schebique
>

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