# Read Int16 from binary file in XDMF

**URL:** https://discourse.paraview.org/t/read-int16-from-binary-file-in-xdmf/3122
**Category:** ParaView Support
**Created:** [December 5, 2019, 8:45am UTC](https://discourse.paraview.org/t/read-int16-from-binary-file-in-xdmf/3122 "2019-12-05T08:45:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![reox](https://discourse.paraview.org/user_avatar/discourse.paraview.org/reox/32/16237_2.png) [@reox](https://discourse.paraview.org/u/reox)
#### Post date: [December 5, 2019, 8:45am UTC](https://discourse.paraview.org/t/read-int16-from-binary-file-in-xdmf/3122/1 "2019-12-05T08:45:38Z")

</div>

I would like to load a binary file containing Int16 numbers using XDMF. The DataItem tag seems to support a Precision attribute, which I assume is the number of bits?  
But, if I define a DataItem like this:  
`<DataItem Dimensions="136 512 512" Endian="Little" Format="Binary" ItemType="Uniform" NumberType="Int" Precision="2">int16_image.raw</DataItem>`

The image will load incorrectly: In the information tab, I see a very huge number range, which is impossible using Int16 (like -7.1763e+7 to 1.16197e+8) and only half of the image seems to be loaded.

 ![Bildschirmfoto%20vom%202019-12-05%2009-46-17](https://discourse.paraview.org/uploads/default/original/2X/1/1b75e6aab881280461d83560b1814c28a975c828.png)

I selected the Xdmf3ReaderS and running Paraview 5.6

In order to test the behaviour, I created some artifical files:  
[testimage\_i16.raw](https://discourse.paraview.org/uploads/short-url/eVisTMYKE1eQTVXxAB2WWEh6pYl.raw) (17.6 KB) [testimage\_i16.xmf](https://discourse.paraview.org/uploads/short-url/cxH6DP2nwKnxjzrelv7VehU1W8V.xmf) (701 Bytes) [testimage\_i32.raw](https://discourse.paraview.org/uploads/short-url/4N6ZPsuU7QvIFVcTq5qtECFRgVg.raw) (35.2 KB) [testimage\_i32.xmf](https://discourse.paraview.org/uploads/short-url/k9NLmFzPQWzHbQ3H19J1Y0knHj6.xmf) (701 Bytes)

the \_i16 version are Int16, while \_i32 are Int32.

Is int16 not supported or did I specified it incorrectly?

---

<div class="post-metadata">

### Author: ![reox](https://discourse.paraview.org/user_avatar/discourse.paraview.org/reox/32/16237_2.png) [@reox](https://discourse.paraview.org/u/reox)
#### Post date: [December 5, 2019, 11:59am UTC](https://discourse.paraview.org/t/read-int16-from-binary-file-in-xdmf/3122/2 "2019-12-05T11:59:38Z")

</div>

Using some trial and reading code, I found out that the actual name for the NumberType is `Short` and Precision is not required at all.  
But this is contrary to the XDMF documentation which states that there is only `Int`/`UInt` and Precision…  
Anyways, the here given names work: [https://github.com/Kitware/VTK/blob/d8b0762aefab75155d66f84f1f845893cd0eb184/ThirdParty/xdmf3/vtkxdmf3/core/XdmfArrayType.cpp#L237](https://github.com/Kitware/VTK/blob/d8b0762aefab75155d66f84f1f845893cd0eb184/ThirdParty/xdmf3/vtkxdmf3/core/XdmfArrayType.cpp#L237)
