# Render 3D US Volume with 2D images and tracking data

**URL:** <https://discourse.slicer.org/t/render-3d-us-volume-with-2d-images-and-tracking-data/23002>\
**Category:** Support\
**Tags:** ultrasound\
**Created:** [April 18, 2022, 5:20pm UTC](https://discourse.slicer.org/t/render-3d-us-volume-with-2d-images-and-tracking-data/23002 "2022-04-18T17:20:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@JJenkins](https://discourse.slicer.org/u/JJenkins)\
**Post date:** [April 18, 2022, 5:20pm UTC](https://discourse.slicer.org/t/render-3d-us-volume-with-2d-images-and-tracking-data/23002/1 "2022-04-18T17:20:16Z")

</div>

Hello,  
I am looking to use Slicer to generate a 3D ultrasound volume from 2D images and tracking data. The goal is for the image acquisition to be done by hand, so the image spacing will not be regular or in one dimension.

The US images are processed and stored in RGBA format. The tracking information I have are the distance and orientation of the sensor from the tracking source.

I found this ticket which is very similar to what I am trying to do:

> [@Import position data (tracking) for images](https://discourse.slicer.org/t/import-position-data-tracking-for-images/19615):
>
> Hi everybody, I am Matthieu working on a 3D free-hand project involving ultrasound imaging and electromagnetic device. I am interested to use 3D Slicer for volume visualization instead of Matlab. I am also thinking that the toolbox SlicerIGT can be the solution to generate a volume of my acquisition data without using Matlab however I do not know/did not find the way to do it. I am using a research scanner (Verasonics Vantage system) acquiring at a high frame rate (100 Hz) where we save all t…

The differences are that we are not using Matlab to stitch our 2D images together. Is there a way for Slicer to do this for us? I have looked into the NRRD file format and it does not support variable image spacing in multiple dimensions. There are also no real-time requirements

Operating system: Windows 10 x64  
Slicer version: 4.11

Thank you for your time

---

<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:** [April 18, 2022, 9:42pm UTC](https://discourse.slicer.org/t/render-3d-us-volume-with-2d-images-and-tracking-data/23002/2 "2022-04-18T21:42:08Z")

</div>

> The differences are that we are not using Matlab to stitch our 2D images together. Is there a way for Slicer to do this for us?

Absolutely. 3D volume reconstruction of freehand tracked 2D ultrasound is a core IGT feature, it is well tested and thoroughly optimized, has many compounding options, hole filling, etc. It works real-time on live data, or you can do it from pre-recorded data. Some optimizations are only implemented for single component (grayscale, not RGB/RGBA) images. See for example this demo/tutorial video:

[![](https://img.youtube.com/vi/l0BcW8c9CnI/maxresdefault.jpg "Tracked ultrasound AI segmentation and 3D reconstruction tutorial") ](https://www.youtube.com/watch?v=l0BcW8c9CnI&t=497)

> [@JJenkins](#):
>
> I have looked into the NRRD file format and it does not support variable image spacing in multiple dimensions.

We store image pose for each slice in custom fields in the nrrd header. See full specification [here](http://perk-software.cs.queensu.ca/plus/doc/nightly/user/FileSequenceFile.html). See an example file [here](https://github.com/PlusToolkit/PlusLibData/blob/master/TestImages/NwirePhantomFreehand.igs.nrrd).
