# Importing of position-tracked ultrasound sequence

**URL:** <https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094>\
**Category:** Support\
**Tags:** surgical-navigation\
**Created:** [September 11, 2018, 1:16pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094 "2018-09-11T13:16:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 11, 2018, 9:48am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/1 "2018-09-11T09:48:33Z")

</div>

I have encountered another problem with importing “.seq.nrrd” sequence files. I have recorded a sequence file with the PLUS remote module via Slicer containing US and tracker data. When I try to import this directly into Slicer, it reads the volume voxel data but not the spacing / offset / tracking information stored with it.

Is there any way I can access the PLUS-stored data from the “.seq.nrrd” file directly from Slicer?

Many thanks for your help!

---

<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:** [September 11, 2018, 1:16pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/2 "2018-09-11T13:16:45Z")

</div>

Plus saves the raw data (original transforms and uncalibrated image data) to sequence files, so you need to apply calibration as explained in SlicerIGT tutorials.

---

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 11, 2018, 2:03pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/3 "2018-09-11T14:03:15Z")

</div>

That is exactly what I was trying to do (import the PLUS raw data into Slicer to run the calibration). But for this it is necessary to read the volumes AND the original transforms from the .seq.nrrd file. I am not sure what I am doing wrong since only the volumes appear in the data module but not the corresponding transforms.

---

<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:** [September 13, 2018, 2:26am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/4 "2018-09-13T02:26:40Z")

</div>

Do you have transforms in the .seq.nrrd file?  
Have you installed Sequences extension?  
Can you replay the sequence using sequence browser toolbar (play/pause/prev/next buttons)?

---

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 13, 2018, 10:39am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/5 "2018-09-13T10:39:58Z")

</div>

Yes to all of your questions. The .seq.nrrd file saved by PLUS contains a header like the example included below. In this case I have used the “FakeTracker” for simulation and as you can see the transforms are included in the PLUS file. When replaying this file via PLUS remote, the volumes and the transforms can be transferred to Slicer without problems. However, when I try to import the file directly into Slicer, only the volumes are imported with default spacing, zero offset and without the corresponding transforms. I can use the sequence browser to move through the volume sequence.

Any ideas what might be going wrong? Thanks for your help!

(Note that we have added a custom field for “ElementSpacing” according to what is sent from the US station but this should not have any effect on Slicer / PLUS).

NRRD0004

# Complete NRRD file format specification at:

# [http://teem.sourceforge.net/nrrd/format.html](http://teem.sourceforge.net/nrrd/format.html)

# File generated by PLUS version 2.7.0

dimension: 4  
encoding: raw  
endian: little  
kinds: domain domain domain list  
sizes: 112 48 112 15  
space dimension: 3  
space directions: (1,0,0) (0,1,0) (0,0,1) none  
space origin: (0,0,0)  
type: uint8  
ultrasound image orientation:=MFA  
ultrasound image type:=BRIGHTNESS  
Seq\_Frame0000\_ElementSpacing:=0.7827 0.9403 0.9229 1  
Seq\_Frame0000\_ProbeToTrackerTransform:=0.9925461516413222 0 0.1218693434051475 0 0 1 0 300 -0.1218693434051475 0 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0000\_ProbeToTrackerTransformStatus:=OK  
Seq\_Frame0000\_ReferenceToTrackerTransform:=1 0 0 0 0 1 0 150 0 0 1 200 0 0 0 1  
Seq\_Frame0000\_ReferenceToTrackerTransformStatus:=OK  
Seq\_Frame0000\_Stylus-2ToTrackerTransform:=1 0 0 0 0 0.9925461516413222 -0.1218693434051475 273.3899768113671 0 0.1218693434051475 0.9925461516413222 235.0700333498087 0 0 0 1  
Seq\_Frame0000\_Stylus-2ToTrackerTransformStatus:=OK  
Seq\_Frame0000\_Stylus-3ToTrackerTransform:=1 0 0 100 0 0.9925461516413222 -0.1218693434051475 300 0 0.1218693434051475 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0000\_Stylus-3ToTrackerTransformStatus:=OK  
Seq\_Frame0000\_StylusToTrackerTransform:=0.9925461516413222 0 0.1218693434051475 0 0 1 0 300 -0.1218693434051475 0 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0000\_StylusToTrackerTransformStatus:=OK  
Seq\_Frame0000\_Timestamp:=235.9266571427097  
Seq\_Frame0000\_Status:=OK  
Seq\_Frame0001\_ElementSpacing:=0.7827 0.9403 0.9229 1  
Seq\_Frame0001\_ProbeToTrackerTransform:=0.9925461516413222 0 0.1218693434051475 0 0 1 0 300 -0.1218693434051475 0 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0001\_ProbeToTrackerTransformStatus:=OK  
Seq\_Frame0001\_ReferenceToTrackerTransform:=1 0 0 0 0 1 0 150 0 0 1 200 0 0 0 1  
Seq\_Frame0001\_ReferenceToTrackerTransformStatus:=OK  
Seq\_Frame0001\_Stylus-2ToTrackerTransform:=1 0 0 0 0 0.9925461516413222 -0.1218693434051475 273.3899768113671 0 0.1218693434051475 0.9925461516413222 235.0700333498087 0 0 0 1  
Seq\_Frame0001\_Stylus-2ToTrackerTransformStatus:=OK  
Seq\_Frame0001\_Stylus-3ToTrackerTransform:=1 0 0 100 0 0.9925461516413222 -0.1218693434051475 300 0 0.1218693434051475 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0001\_Stylus-3ToTrackerTransformStatus:=OK  
Seq\_Frame0001\_StylusToTrackerTransform:=0.9925461516413222 0 0.1218693434051475 0 0 1 0 300 -0.1218693434051475 0 0.9925461516413222 0 0 0 0 1  
Seq\_Frame0001\_StylusToTrackerTransformStatus:=OK  
Seq\_Frame0001\_Timestamp:=236.0600285712696  
Seq\_Frame0001\_Status:=OK

---

<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:** [September 13, 2018, 11:17am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/6 "2018-09-13T11:17:06Z")

</div>

Can you upload the sequence file and application log (menu: Help/Report a bug) to Dropbox/OneDrive/Gdrive and post the link here?

---

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 13, 2018, 11:23am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/7 "2018-09-13T11:23:57Z")

</div>

Sure, here are the sequence file, the config file I used for recording in PLUS and the Slicer log:  
[https://www.dropbox.com/s/8ld1r30l0affqxc/4DUS-Sequence.zip?dl=0](https://www.dropbox.com/s/8ld1r30l0affqxc/4DUS-Sequence.zip?dl=0)

Thanks!

---

<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:** [September 13, 2018, 1:21pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/8 "2018-09-13T13:21:51Z")

</div>

Thanks for the data. It seems that Sequences can only import tracked image data from seq.mha or seq.mhd files (and not from seq.nrrd or seq.nhdr). If you save the data in Plus as seq.mha then you can load it as “Sequence Metafile” instead of “Volume Sequence”.

I’m not sure if Plus can save 4D tracked ultrasound in seq.mha file. If that’s the case then submit a feature request at [Plus library’s issue tracker](https://github.com/PlusToolkit/PlusLib/issues/new).

---

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 13, 2018, 2:15pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/9 "2018-09-13T14:15:59Z")

</div>

I have tried to save the data in a .seq.mhd file via PLUS but when I try to import the file into Slicer as a Sequence Metafile it just crashes. Maybe you could have another look at the files?  
[https://www.dropbox.com/s/32he9eb4w0rcm4r/4DUS-Sequence-MHD.zip?dl=0](https://www.dropbox.com/s/32he9eb4w0rcm4r/4DUS-Sequence-MHD.zip?dl=0)

Do you reckon this is a problem with PLUS’ saving or Slicer’s importing?

---

<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:** [September 13, 2018, 2:29pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/10 "2018-09-13T14:29:00Z")

</div>

Slicer should not crash when trying to import the sequence, so it is an issue in Sequences extension. Could you please [submit a bug report for Sequences extension](https://github.com/SlicerRt/Sequences/issues).

---

<div class="post-metadata">

**Author:** ![Sunny](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@Sunny](https://discourse.slicer.org/u/Sunny)\
**Post date:** [September 14, 2018, 6:26am UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/11 "2018-09-14T06:26:39Z")

</div>

I submitted an issue for the Sequences extension ([https://github.com/SlicerRt/Sequences/issues/52](https://github.com/SlicerRt/Sequences/issues/52)).  
Looking forward to your reply!

---

<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 2, 2020, 7:06pm UTC](https://discourse.slicer.org/t/importing-of-position-tracked-ultrasound-sequence/4094/12 "2020-06-02T19:06:34Z")

</div>

2 posts were split to a new topic: [Visualize .igs.mha tracked ultrasound sequence in 3D](https://discourse.slicer.org/t/visualize-igs-mha-tracked-ultrasound-sequence-in-3d/11835)
