Posted by
Schebique on
Oct 27, 2016; 11:09am
URL: http://imagej.273.s1.nabble.com/pixel-size-is-slightly-different-when-dcm-is-saved-as-tif-tp5017492.html
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
--
Mgr. Ondřej Šebesta
Laboratory of Confocal and Fluorescence Microscopy
Faculty of Science, Charles University in Prague
Vinicna 7
128 44 Prague
Czech Republic
Phone: +420 2 2195 1061
e-mail:
[hidden email]
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html