# Interpolating Between Stack of Images in 3D Slicer

**URL:** https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703
**Category:** Beginner Questions
**Created:** [June 14, 2024, 6:52pm UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703 "2024-06-14T18:52:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![valerie](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/ccd318/32.png) [@valerie](https://discourse.itk.org/u/valerie)
#### Post date: [June 14, 2024, 6:52pm UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703/1 "2024-06-14T18:52:52Z")

</div>

Hi,

I am trying to interpolate between a stack of 2D ultrasound images using multiple methods for comparison (i.e. Gaussian Kernel, Nearest Neighbor, Linear, etc.) in 3D Slicer. I posted a [question](https://discourse.slicer.org/t/how-to-interpolate-between-slices-using-gaussian-kernel-sliceritkultrasound-module/36734) in the 3D Slicer community, since I am working in 3D Slicer, but have yet to receive a response, so I am posting here. I am having difficulties in achieving the desired resampled volume. I used this [resource](https://www.kitware.com/3d-slicer-resamples-ultrasound-images/) to help guide me but there isn’t much information on the SlicerITKUltrasound module. How do the parameters affect the resampled volume and are there any missing steps in the interpolation process? The following question is similar to my project and one of the response mentioned the module but the author used another method.

> [@interpolate stack of images](https://discourse.itk.org/t/interpolate-stack-of-images/2725/9):
>
> The class designed for this is [itk::SliceSeriesSpecialCoordinatesImage](https://github.com/KitwareMedical/ITKUltrasound/blob/master/include/itkSliceSeriesSpecialCoordinatesImage.hxx) provided by the [ITKUltrasound](https://github.com/KitwareMedical/ITKUltrasound/tree/master/include) module. An example of how it is used to resample into an itk::Image uniform grid can be found in [SlicerITKUltrasound](https://github.com/KitwareMedical/SlicerITKUltrasound).

 ![Image stack of ultrasound images and resampled volume using SlicerITKUltrasound](https://discourse.itk.org/uploads/default/original/2X/2/2478f25f0993fb8912412f189e55e7bf772fc945.jpeg)

Please provide any advice on how to achieve a proper volume based on the image stacks using ITKUltrasound module in 3D Slicer.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [June 16, 2024, 7:10pm UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703/2 "2024-06-16T19:10:47Z")

</div>

I replied to your question about how to reconstruct volumes on freehand tracked ultrasound (acquired by moving a position-tracked 2D probe).

@matt.mccormick can probably give you advice here if ITK filters can be used for if you have data aquired by a 3D/4D ultrasound probe. You need to give more details though, for example:

- Are your voxels storing B-mode or RF data?
- Do the images contain scanlines or scan-converted data?
- What kind of probe have you used (motorized 2D probe - rotating/spinning/sliding, 3D phased array, …)?
- Do you know the probe geometry (start/and angles, radius, angle/distance increments, etc.)?

---

<div class="post-metadata">

### Author: ![valerie](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/ccd318/32.png) [@valerie](https://discourse.itk.org/u/valerie)
#### Post date: [June 18, 2024, 4:11pm UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703/3 "2024-06-18T16:11:04Z")

</div>

Hi Andras,  
Thank you for replying to both my questions. My voxels are based on 2D B-mode stacked images. I used the 3D Slicer module ‘ImageStacks’ and inputted sequentially acquired 2D B-mode images to create the volume. The images contain scan-converted data and the type of probe used was a manual sliding 2D probe (Philips C5-2 40R Curved Array Probe). The following image is of the probe specifications and geometry.

 ![Philips C5-2 40R Curved Array Probe Specifications](https://discourse.itk.org/uploads/default/original/2X/3/3f25f40d05313c5b5bf67d08a9860f877939b244.png)  
The aim of my project is to compare the various interpolation methods that the ITK module offers. Therefore, this module is of interest to me for this specific task. Please let me know if more details are required. Thanks!

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)
#### Post date: [June 19, 2024, 5:22am UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703/4 "2024-06-19T05:22:17Z")

</div>

If you slide the probe manually and you do not use any kind of pose tracking (external tracking or image-based tracking) then the 3D reconstruction is inaccurate, and so you don’t need to worry about what interpolation method you choose, the reconstructed volume will be wavy (as you don’t slide exactly along a straight line) and distorted (as the speed is not exactly uniform and the probe motion is not exactly orthogonal to the image plane).

If you use a linear positioning stage that ensures constant speed along a linear trajectory and orthogonality of the image plane to the motion direction then you can simply set the image spacing based on the probe speed - you don’t need any sophisticated interpolation method.

If you use pose tracking (optical tracker, electromagnetic tracker, or image based tracking using speckle decorrelation or SIFT) then you can use freehand volume reconstruction algorithm provided in 3D Slicer ([SlicerIGT extension](https://slicerigt.org/)) or in [PLUS toolkit](https://plustoolkit.org/).

---

<div class="post-metadata">

### Author: ![valerie](https://discourse.itk.org/letter_avatar_proxy/v4/letter/v/ccd318/32.png) [@valerie](https://discourse.itk.org/u/valerie)
#### Post date: [June 19, 2024, 2:59pm UTC](https://discourse.itk.org/t/interpolating-between-stack-of-images-in-3d-slicer/6703/5 "2024-06-19T14:59:42Z")

</div>

> [@lassoan](#):
>
> If you use pose tracking (optical tracker, electromagnetic tracker, or image based tracking using speckle decorrelation or SIFT) then you can use freehand volume reconstruction algorithm provided in 3D Slicer ([SlicerIGT extension](https://slicerigt.org/)) or in [PLUS toolkit](https://plustoolkit.org/).

We acquired the data in 2 manners. One is freehand without any pose tracking and the second is freehand with NDI Aurora EM Tracker. The current image in this post used the former method and the 3D volume was formed using the Image\_Stacks module. I posted a forum in the 3D Slicer community about live reconstruction using Telemed and NDI Aurora. I am facing some difficulties with the reconstructed volume. It displays a black image slice instead of a 3D volume. My objective is to form a 3D volume and perform different interpolation techniques to compare them. Please provide any solutions to this problem.

> **[Live volume reconstruction using Telemed and NDI Aurora](https://discourse.slicer.org/t/live-volume-reconstruction-using-telemed-and-ndi-aurora/36578/12?u=valerie)**
>
> I am still having issues with reconstructing the volume in 3D Slicer. The image slice is now moving based on the position of the transducer. However, after I complete the Scout scan, there is a black square. I ended up following the steps in the...

 ![Black square represents reconstructed volume from Scout scan and Live reconstruction. Floating image slice outside volume is tracked transducer.](https://discourse.itk.org/uploads/default/original/2X/9/917c8278295d77cb33f99ce6d58bf44e935eef2c.png)
