# 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:** 20\
**Page:** 2

<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:** [June 4, 2019, 11:50pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/21 "2019-06-04T23:50:32Z")

</div>

The live volume reconstruction is saved in the same directory as the scout scan. The default name in PlusRemote is: LiveReconstructedVolume.mha.

---

<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:** [June 5, 2019, 10:40am UTC](https://discourse.slicer.org/t/creating-mha-files/6557/22 "2019-06-05T10:40:42Z")

</div>

Yes I tried this. It is only a 4kB file and the when I open it in a text editor , the image part of the file is full of NULL. I tried it to load it in Slicer and to see it in volume rendering but it does not work.

---

<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:** [June 5, 2019, 1:22pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/23 "2019-06-05T13:22:19Z")

</div>

Did you enable volume rendering in Slicer for the loaded volume?

- Open “Volume Rendering” module
- Select loaded volume
- Click on eye icon

---

<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:** [June 5, 2019, 1:42pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/24 "2019-06-05T13:42:37Z")

</div>

Yes, I did exactly this and I can not see the volume. Maybe is a problem with the .mha file?It is very small.

---

<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:** [June 5, 2019, 1:44pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/25 "2019-06-05T13:44:03Z")

</div>

Could you send me your Plus log?

---

<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:** [June 5, 2019, 1:54pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/26 "2019-06-05T13:54:52Z")

</div>

I am trying to upload it but it says: Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif).My file is .txt. Can I send it to you somewhere else?

---

<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:** [June 5, 2019, 4:19pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/27 "2019-06-05T16:19:49Z")

</div>

I took a look at the files you sent me. Besides one minor comment on the config file (Compound=On, should be CompoundMode=“MEAN”/“LINEAR”/etc), there does appear to be a problem with the volume reconstruction.

I noticed that Plus sends/saves the correctly reconstructed volume, and then immediately overwrites it with an empty one.

I’ll investigate more and report back.

---

<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:** [June 5, 2019, 4:31pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/28 "2019-06-05T16:31:46Z")

</div>

Thank you a lot for your help.

Cheers.

---

<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:** [June 7, 2019, 1:21pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/29 "2019-06-07T13:21:26Z")

</div>

OK, I committed a fix to SlicerOpenIGTLink.Could you update and try again?

The fix is available both the Stable and Nightly versions.

---

<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:** [June 7, 2019, 3:05pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/30 "2019-06-07T15:05:58Z")

</div>

Do you mean to download : [https://github.com/openigtlink/SlicerOpenIGTLink](https://github.com/openigtlink/SlicerOpenIGTLink) the module and somehow to use it from Slicer 3D?

---

<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:** [June 7, 2019, 3:16pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/31 "2019-06-07T15:16:04Z")

</div>

I did not build Slicer from source. Do I have to do it in order to put the updated Slicer3dIGT module?

---

<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:** [June 7, 2019, 3:30pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/32 "2019-06-07T15:30:41Z")

</div>

No, you do not need to download it.  
I made the commit last night, so the fix should be available if you update your SlicerOpenIGTLink extension. ([https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/ExtensionsManager#Updating\_installed\_extensions](https://www.slicer.org/wiki/Documentation/Nightly/SlicerApplication/ExtensionsManager#Updating_installed_extensions))

---

<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:** [June 7, 2019, 4:11pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/33 "2019-06-07T16:11:46Z")

</div>

It works.Really thank you for your help!!!

Could I ask you some more questions?  
I tried IGSIO library and and the VolumeRecontructorTest project and it reconstructs the volume.

1)How can I render this volume in the same project? I tried the renderer of VTK and it works but I was wondering if you use another way to render the volume instead of reading the .mha file . Or if you use a way , as in Slicer 3D, to render the volume at the same time with the reconstruction process.

---

<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:** [June 7, 2019, 5:22pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/34 "2019-06-07T17:22:12Z")

</div>

I’m not sure I understand your question. Could you elaborate?

---

<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:** [June 7, 2019, 8:43pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/35 "2019-06-07T20:43:17Z")

</div>

Sorry!

I used IGSIO library to reconstruct a volume because I want to make an application in cpp. Now I would like to render this volume ( .mha file). I found a way to do it using a class of vtk library which reads the .mha file and it renders it. But I would like to to avoid the "Reading " step. Is there a way to render the “reconstructor object”?( class vtkIGSIOVolumeReconstructor)

I want to avoid saving the reconstructed volume and reading the volume. After the reconstruction, I want directly to render it.

---

<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:** [June 10, 2019, 1:17pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/36 "2019-06-10T13:17:34Z")

</div>

You could use: [vtkIGSIOVolumeReconstructor::GetReconstructedVolume(vtkImageData\* volume)](https://github.com/IGSIO/IGSIO/blob/2658e5518dd54930a3e704a08c3962f1ee3ba530/Source/VolumeReconstruction/vtkIGSIOVolumeReconstructor.h#L82).

This should return the vtkImageData without writing it to file, so you can perform the volume rendering on that.

[The SlicerIGSIO extension does this to reconstruct volume sequences](https://github.com/IGSIO/SlicerIGSIO/blob/master/VolumeReconstruction/Logic/vtkSlicerVolumeReconstructionLogic.cxx).

---

<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:** [June 11, 2019, 9:53am UTC](https://discourse.slicer.org/t/creating-mha-files/6557/37 "2019-06-11T09:53:48Z")

</div>

Thank you a lot for your help and your time!

Cheers!

---

<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:** [June 13, 2019, 9:50pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/38 "2019-06-13T21:50:48Z")

</div>

Hi,

I used Aruco markers in order to track the probe. I print some from : [http://chev.me/arucogen/](http://chev.me/arucogen/)  
with dictionary 4x4. I did the data collection and I tried to detect them using the Aruco library that I found in PLUS github , but it can not detect them. I realize that it only detects classic Aruco markers and some other types. Do you know what I can do to detect aruco markers from 4x4 dictionary?

Thank you

---

<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 14, 2019, 4:30am UTC](https://discourse.slicer.org/t/creating-mha-files/6557/39 "2019-06-14T04:30:24Z")

</div>

ArUco version in Plus supports 12 different dictionaries (see details and how to choose dicitionary [here](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/DeviceOpticalMarkerTracker.html)). I’m not sure what kind of markers that online generator creates, but you can easily create a variety of markers using the `aruco_print_marker` tool bundled with Plus or just use the marker sheet that you can download from the link above.

---

<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:** [June 19, 2019, 1:23pm UTC](https://discourse.slicer.org/t/creating-mha-files/6557/40 "2019-06-19T13:23:05Z")

</div>

Do you know if ARUCO library handles stereo camera ? We have a stereo camera from the da Vinci and we would like to test if we can improve the tracking using the stereo instead of use a single camera.

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

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