Rationale for metaObject.cxx: m_DoublePrecision = 6;

When writing double array as meta image, one can generally see the following:

$ head -15 input.mha
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 0.954761 -0.297375 0 0.297375 0.954761
Offset = -120 -120.076 -30.8873

At least in our case, the TransformMatrix is coming directly from the DICOM Image Orientation (Patient) attribute. Since there are way to completely identify a binary float using an ascii representation.

Would it be possible to slightly increase the precision from -say- 6 to 16 ? This would be consistent with the DICOM specification for VR:DS. Of course using 17 for precision would be acceptable for us. The benefit would be to allow easier round-trip operation in between DICOM and metaIO.

Comments ?

1 Like

This seems reasonable.

We also have the Google-Double-Conversion library in ITK, but it may be too much to make it a dependency of the MetaIO library since other clients like VTK would then require it.

Published here: http://review.source.kitware.com/22811

Comments welcome.

2 Likes