# Creating .mha files 

**URL:** <https://discourse.slicer.org/t/creating-mha-files/6557>\
**Category:** Support\
**Created:** [April 22, 2019, 6:50pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557 "2019-04-22T18:50:03Z")\
**Posts on this page:** 13\
**Page:** 3

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 19, 2019, 2:56pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/41 "2019-06-19T14:56:24Z")

</div>

Main limitation of ArUco’s tracking is inaccuracy in estimating how far is the marker from the camera, as it completely relies on measuring the marker size and so a single pixel error in marker corner estimation can lead to millimeters or centimeters of errors. With a stereo setup, you can estimate distance from triangulation instead, which should be much more accurate. Therefore, yes, I would expect that with a stereo camera you can significantly improve on ArUco’s single-camera tracking.

---

<div class="post-metadata">

**Author:** ![ahmed\_elshreif](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ahmed_elshreif/32/4311_2.png) [@ahmed\_elshreif](https://discourse.slicer.org/u/ahmed_elshreif)\
**Post date:** [August 13, 2019, 2:47pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/42 "2019-08-13T14:47:07Z")

</div>

Which team in Vanderbilt?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 13, 2019, 3:33pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/43 "2019-08-13T15:33:20Z")

</div>

[Bob Webster](https://engineering.vanderbilt.edu/me/faculty-staff/robert-webster.php)’s group works on [developing ultrasound guidance for daVinci robot using Slicer/SlicerIGT](http://research.vuse.vanderbilt.edu/MEDLab/research/surgical-gps) .

---

<div class="post-metadata">

**Author:** ![xaris\_komninos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xaris_komninos/32/3508_2.png) [@xaris\_komninos](https://discourse.slicer.org/u/xaris_komninos)\
**Post date:** [September 6, 2019, 6:56pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/44 "2019-09-06T18:56:01Z")

</div>

Hi,

I have 2 questions after working on IGSIO and Slicer 3D.

1. Does the Slicer3D do an automatic scaling? From the tracker we obtain the position of the probe in meters and despite the fact that I multiply by 1000 to convert them in mm (to render the volume in Slicer), the volume appears to another part of the scene without being scaled .

2. I tried to set as ImageToProbe matrix the identity matrix but I am getting an error . I realize that the error is because it can not compute the ouput extent . Does Slicer have any limit on this ?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [September 6, 2019, 7:20pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/45 "2019-09-06T19:20:19Z")

</div>

1. Where are you setting the dimensions and spacing of the image?
2. What error are you seeing?

---

<div class="post-metadata">

**Author:** ![xaris\_komninos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xaris_komninos/32/3508_2.png) [@xaris\_komninos](https://discourse.slicer.org/u/xaris_komninos)\
**Post date:** [September 6, 2019, 7:57pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/46 "2019-09-06T19:57:07Z")

</div>

1. In the VolumeReconstructorTest.cxx , I set for each frame the “ProbeToReference” matrix and the “ImageToProbe” is set reading the configuration file. I calculate the ProbeToReference by the tracker and it is computed in meters. So I multiply only the translation part of this matrix with 1000.  
The dimensions and the spacing of the image are read in the configuration file.

2.I am not getting an error. It crashes after the oupout: " Set Volume Output extent" .  
As I can not use the identity matrix for the ImageToProbe , I use one matrix of your examples and it works. But it is not the transformation that I want.

---

<div class="post-metadata">

**Author:** ![xaris\_komninos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xaris_komninos/32/3508_2.png) [@xaris\_komninos](https://discourse.slicer.org/u/xaris_komninos)\
**Post date:** [September 7, 2019, 5:51pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/47 "2019-09-07T17:51:12Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/6/f6c4fa525fef1338a09a679c8dd30bd722d582cf.png)

Thi is the error.

---

<div class="post-metadata">

**Author:** ![xaris\_komninos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xaris_komninos/32/3508_2.png) [@xaris\_komninos](https://discourse.slicer.org/u/xaris_komninos)\
**Post date:** [September 7, 2019, 7:26pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/48 "2019-09-07T19:26:56Z")

</div>

I think I solved the 2nd problem. I changed the “Ouptut Space” from “0.5 0.5 0.5” to “1 1 1” and it is working.

Could you help me to the question 1?

---

<div class="post-metadata">

**Author:** ![xaris\_komninos](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/xaris_komninos/32/3508_2.png) [@xaris\_komninos](https://discourse.slicer.org/u/xaris_komninos)\
**Post date:** [September 10, 2019, 9:12am UTC](https://discourse.slicer.org/t/creating-mha-files/6557/49 "2019-09-10T09:12:34Z")

</div>

Do you know the relation between mm and pixels in slicer3D?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 10, 2019, 11:22am UTC](https://discourse.slicer.org/t/creating-mha-files/6557/50 "2019-09-10T11:22:33Z")

</div>

[https://www.slicer.org/wiki/Coordinate\_systems](https://www.slicer.org/wiki/Coordinate_systems)

---

<div class="post-metadata">

**Author:** ![kristjanq](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kristjanq/32/6534_2.png) [@kristjanq](https://discourse.slicer.org/u/kristjanq)\
**Post date:** [April 25, 2020, 12:20pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/51 "2020-04-25T12:20:57Z")

</div>

Related to [EditSequenceFile](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/ApplicationEditSequenceFile.html): as we had a discourse about merging image data with transform data, this might be the option!

One problem: when the EditSequenceFile.exe, the window disappears within sec?!  
The Plus version is the latest stable version.

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [April 25, 2020, 1:08pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/52 "2020-04-25T13:08:11Z")

</div>

@kristjanq I’m assuming you just double clicked on the EditSequenceFile exe? It does not have a GUI and is just a command line tool. So you should open up any terminal window and then call to run EditSequenceFile.exe followed with the appropriate command line flags.

---

<div class="post-metadata">

**Author:** ![kristjanq](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kristjanq/32/6534_2.png) [@kristjanq](https://discourse.slicer.org/u/kristjanq)\
**Post date:** [April 25, 2020, 1:37pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/53 "2020-04-25T13:37:54Z")

</div>

@jamesobutler Acctually I double-clicked the corresponding .exe. But as you explained I had to run it through Comand Promt, it worked!

[Previous page](https://discourse.slicer.org/t/creating-mha-files/6557.md?page=2)
