# 3D reconstruction of radial OCT slices

**URL:** <https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734>\
**Category:** Support\
**Tags:** segmentation, 3d-model, oct\
**Created:** [November 22, 2021, 7:02pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734 "2021-11-22T19:02:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soumaya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Soumaya](https://discourse.slicer.org/u/Soumaya)\
**Post date:** [November 22, 2021, 7:02pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/1 "2021-11-22T19:02:04Z")

</div>

Hi everyone!

I’m working on radial OCT scans of the optic nerve head (eye), and the slices are rotated from each other by 15°.  
Since I don’t have parallel slices, I’m struggling to construct the 3D model of the optic nerve head using those rotational slices. Is there a way that I could do it in 3D Slicer?

 ![radial_oct_scans](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/8/a807de4acbf0796e1343a1bb1a4be9ce9482b501.jpeg)

Thanks in advance

---

<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:** [November 23, 2021, 7:11am UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/2 "2021-11-23T07:11:12Z")

</div>

Yes, that should be no problem at all. You can use the code snippet provided here:

> [@Segmentation of Mitral valve](https://discourse.slicer.org/t/segmentation-of-mitral-valve/14598/4):
>
> I had a look at the data set and tried all 3 methods. Method C does not work because slices intersect each other and therefore cannot be interpolated using a grid transform. Method B somewhat worked (I had to slightly improve the DICOM importer, the update will be available in tomorrow’s Slicer Preview Release). Since the the volume is quite sparse and the leaflet visibility is not always great, segmenting the leaflets like this can be quite challenging (you need to keep browsing the slices to…

You just need to set numberOfTimePoints to 1, as I guess your data set is a simple 3D volume (not a 3D+t volume sequence).

---

<div class="post-metadata">

**Author:** ![Soumaya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Soumaya](https://discourse.slicer.org/u/Soumaya)\
**Post date:** [November 23, 2021, 8:14pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/3 "2021-11-23T20:14:04Z")

</div>

Hello,

Thank you so much for taking the time to answer my question.  
Yes exactly, I only need a 3D model with no time included.  
I tried the code snippet you provided and made sure that I have the extensions installed.  
I set numberOgTimePoints to 1, but I have an error of type : AttributeError: ‘NoneType’ object has no attribute ‘GetDataNodeAtValue’. Maybe there is a None value in the “inputVolumeSequenceNode”.  
Would you mind explaining why does this error arise so I can fix it?

Thank you again.

---

<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:** [November 23, 2021, 10:23pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/4 "2021-11-23T22:23:30Z")

</div>

As a starting point, you need to create a sequence node that contains each image slice and its correct position and orientation. This is done automatically if you read your images from an MRI scanner but if you just have a bunch of TIFF files then you need to put together the sequence manually.

First of all, you need to set the origin, spacing, and axis directions for each image slice. The origin is the physical position of one corner of the image, spacing is the size of one pixel, and axis directions are the directions of the x, y, and z (=cross(x,y)) axes of the image, using either the Transforms module, or using SetOrigin, SetSpacing, and SetIJKToRASDirections methods of each volume node. Once all the image slices have the correct geometry, you can put them into a sequence using either Python scripting, or using Sequences module: in Edit tab, choose Sequence → Create new sequence, select each node in the “Add remove data nodes” section, and click the green arrow button until all images are added to the sequence.

---

<div class="post-metadata">

**Author:** ![Soumaya](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Soumaya](https://discourse.slicer.org/u/Soumaya)\
**Post date:** [November 29, 2021, 9:01pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/5 "2021-11-29T21:01:55Z")

</div>

Thank you for providing the instructions.  
Using Transforms, I defined the rotation angle of each slice, then I created a sequence that contains all the slices. And I got no errors this time in the code you provided, but I don’t get the 3D volume. Am I missing a step?  
Also, I noticed, when I apply the rotation to each slice, only the last slice’s rotation is displayed (the other slices are not rotated even though I defined their rotation angle).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/c/2c3ff29fe4a4d46cdfc0695221c3802e0fa7422f.jpeg)

---

<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:** [November 30, 2021, 12:19am UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/6 "2021-11-30T00:19:17Z")

</div>

> [@Soumaya](#):
>
> I noticed, when I apply the rotation to each slice, only the last slice’s rotation is displayed (the other slices are not rotated even though I defined their rotation angle).

If you want to rotate the slice view along with the image slice then you can use Volume Reslice Driver module in SlicerIGT extension.

> [@Soumaya](#):
>
> Using Transforms, I defined the rotation angle of each slice, then I created a sequence that contains all the slices. And I got no errors this time in the code you provided, but I don’t get the 3D volume. Am I missing a step?

What you have above is a 3D volume. You can see that near the center of rotation the gaps between the slices are filled. However, at the output resolution you have chosen the gap between slices gets way too big as you move away from the rotation center. Therefore, there is no way to meaningfully fill those gaps from the available information.

You can increase the size of the filled region if you lower the output resolution, but then of course the image will contain less details (will appear more blurry). Therefore, if you want to have a larger filled region without quality loss then you need to acquire more slices. For a reasonable sized 3D region I would recommend to acquire at least 5-10x more slices.

---

<div class="post-metadata">

**Author:** ![AlexJ](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@AlexJ](https://discourse.slicer.org/u/AlexJ)\
**Post date:** [September 25, 2022, 4:49pm UTC](https://discourse.slicer.org/t/3d-reconstruction-of-radial-oct-slices/20734/7 "2022-09-25T16:49:02Z")

</div>

Hi,

I’m also trying to do 3D rendering of radial OCT scans.  
Is it also possible to determine a volume from several tif files in 3D Slicer?

I have tried to understand the protocol given here: I have arranged 24 images accordingly via “Transformers” (see figure), but I cannot display all images at the same time or display them as a volume.  
I can only edit one image via the segment editor, not all of them.

I would greatly appreciate any help with these problems.  
Thanks in advance.

 ![Bildschirmfoto 2022-09-25 um 15.03.59](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/b/7b27015c95f627a59dceb9e01377f55127186087.png)
