# Rationale for metaObject.cxx: m\_DoublePrecision = 6;

**URL:** https://discourse.itk.org/t/rationale-for-metaobject-cxx-m-doubleprecision-6/305
**Category:** Engineering
**Tags:** metaio, dicom
**Created:** [October 19, 2017, 1:04pm UTC](https://discourse.itk.org/t/rationale-for-metaobject-cxx-m-doubleprecision-6/305 "2017-10-19T13:04:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mathieu.malaterre](https://discourse.itk.org/user_avatar/discourse.itk.org/mathieu.malaterre/32/205_2.png) [@mathieu.malaterre](https://discourse.itk.org/u/mathieu.malaterre)
#### Post date: [October 19, 2017, 1:04pm UTC](https://discourse.itk.org/t/rationale-for-metaobject-cxx-m-doubleprecision-6/305/1 "2017-10-19T13:04:44Z")

</div>

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](https://randomascii.wordpress.com/2012/03/08/float-precisionfrom-zero-to-100-digits-2/) 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](http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_6.2.html#para_15754884-9ca2-4b12-9368-d66f32bc8ce1). 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 ?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [October 19, 2017, 1:19pm UTC](https://discourse.itk.org/t/rationale-for-metaobject-cxx-m-doubleprecision-6/305/2 "2017-10-19T13:19:35Z")

</div>

> [@mathieu.malaterre](#):
>
> Would it be possible to slightly increase the precision from -say- 6 to 16 ?

This seems reasonable.

We also have the [Google-Double-Conversion library](https://github.com/google/double-conversion) in ITK, but it may be too much to make it a dependency of the [MetaIO library](https://github.com/Kitware/MetaIO) since other clients like VTK would then require it.

---

<div class="post-metadata">

### Author: ![mathieu.malaterre](https://discourse.itk.org/user_avatar/discourse.itk.org/mathieu.malaterre/32/205_2.png) [@mathieu.malaterre](https://discourse.itk.org/u/mathieu.malaterre)
#### Post date: [November 21, 2017, 8:24am UTC](https://discourse.itk.org/t/rationale-for-metaobject-cxx-m-doubleprecision-6/305/3 "2017-11-21T08:24:44Z")

</div>

Published here: [http://review.source.kitware.com/22811](http://review.source.kitware.com/22811)

Comments welcome.
