# check is the origin and spacing data present

**URL:** https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089
**Category:** Uncategorized
**Created:** [June 15, 2022, 7:28am UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089 "2022-06-15T07:28:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jakub\_Mitura](https://discourse.itk.org/user_avatar/discourse.itk.org/jakub_mitura/32/2406_2.png) [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)
#### Post date: [June 15, 2022, 7:28am UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089/1 "2022-06-15T07:28:34Z")

</div>

I have relatively big dataset from various sources all in MHA I want to be check that all have correctly set spacing,origin and direction - is there a way to check it ?  
To clarify I read already all of the origin and spacing data about files from dataset into a table - and I consider how to filter out all that are corrupted - if there are such - to go with further processing

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [June 15, 2022, 8:11pm UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089/2 "2022-06-15T20:11:07Z")

</div>

If you manage to read all that using ITK, there is no corruption in images themselves.

How should I know whether the metadata you read satisfies your expectations? How should computer know that? If you describe your problem in more detail, we might have some advice.

---

<div class="post-metadata">

### Author: ![Jakub\_Mitura](https://discourse.itk.org/user_avatar/discourse.itk.org/jakub_mitura/32/2406_2.png) [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)
#### Post date: [June 16, 2022, 4:56pm UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089/3 "2022-06-16T16:56:21Z")

</div>

Thanks ! I want to have all data required for registration, I seen that some files has for example spacing of size two for 3 dimensional image, I was wondering is there standard set of checks to perform to be able to get exact physical location of each voxel.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [June 27, 2022, 9:21am UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089/4 "2022-06-27T09:21:23Z")

</div>

The key metadata is:

- spacing
- origin
- direction matrix

---

<div class="post-metadata">

### Author: ![Jakub\_Mitura](https://discourse.itk.org/user_avatar/discourse.itk.org/jakub_mitura/32/2406_2.png) [@Jakub\_Mitura](https://discourse.itk.org/u/Jakub_Mitura)
#### Post date: [June 27, 2022, 5:43pm UTC](https://discourse.itk.org/t/check-is-the-origin-and-spacing-data-present/5089/5 "2022-06-27T17:43:42Z")

</div>

ok thanks!
