# Automatic segmentation of sequences in time

**URL:** <https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756>\
**Category:** Support\
**Tags:** registration, transforms, sequences, 4d\
**Created:** [November 23, 2021, 6:08pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756 "2021-11-23T18:08:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 23, 2021, 6:08pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/1 "2021-11-23T18:08:29Z")

</div>

Hi everyone!

I imported a 4D TAC scan (10 timeframes) in “volume sequence”, I created a segmentation node, segmenting the first timeframe (aorta) and created a new sequence, setting the correct proxy node.

So, I was wondering if there is a way to make the segmentation in the other time frames “follow the CT intensity map” (a sort of segment registration), so as to obtain all 10 timeframes automatically segmented starting only from the segmentation of the first timeframe (adjusting then manually in case of errors).

Thank you all

---

<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:32pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/2 "2021-11-23T19:32:23Z")

</div>

Yes, you can compute displacement across the time sequence using Sequence registration module. It computes a transform sequence that you can apply to the segmentation.

---

<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 24, 2021, 3:20am UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/3 "2021-11-24T03:20:34Z")

</div>

I’ve added a video tutorial for this:

[![](https://img.youtube.com/vi/qVgXdXEEVFU/maxresdefault.jpg "Create an animated 4D surface model by segmenting a single 3D frame") ](https://www.youtube.com/watch?v=qVgXdXEEVFU)

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 10:30am UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/5 "2021-11-24T10:30:20Z")

</div>

Thank you so much!!

I followed all the steps, but when I click on “Register”, nothing seems to happen. I attach an image of what I see: the mouse icon is not in the form of a wheel but of a pointer, so it seems to have finished the operation when in reality nothing has happened …

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/0/80a48bb8c90b8448226bc168e024294404c05e10.png)

---

<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 24, 2021, 1:35pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/6 "2021-11-24T13:35:39Z")

</div>

Please try with the latest Slicer Preview Release and let us know if you run into any issues.

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 3:11pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/7 "2021-11-24T15:11:46Z")

</div>

I downloaded the latest Preview Release (24/11/2021), however I have the same problem…  
Compared to before, the mouse icon for a few seconds was in the form of a wheel, but then immediately becomed a pointer, with the operation not performed.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/9/b92057991beba2efbc6689b541f42bffb8fae0eb.png)

---

<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 24, 2021, 3:12pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/8 "2021-11-24T15:12:56Z")

</div>

Do you see any error messages in the application log?

Does everything work well with the sample data set as shown in the tutorial video?

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 3:23pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/9 "2021-11-24T15:23:22Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/b/0b53f36bb4bfc145f51638a6a61c993c53a1955a.png)

The same happens with the sample data set, and here is the Python window

---

<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 24, 2021, 3:31pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/10 "2021-11-24T15:31:13Z")

</div>

Thank you, the log is very useful. What exact Windows version do you use?

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 3:38pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/11 "2021-11-24T15:38:28Z")

</div>

| Edition | Windows 10 Home |  
| Version | 20H2 |  
| Installation date: | 13/04/2021 |  
| OS Build | 19042.1348 |  
| Experience | Windows Feature Experience Pack 120.2212.3920.0 |  
System type: 64-bit operating system, x64-based processor

Thank you for everything you are doing, I really appreciate

---

<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 24, 2021, 4:13pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/12 "2021-11-24T16:13:10Z")

</div>

Is your system locale set to English?

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 4:19pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/13 "2021-11-24T16:19:09Z")

</div>

No, it’s in Italian, I translated the info tags I wrote before!

---

<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 24, 2021, 4:20pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/14 "2021-11-24T16:20:08Z")

</div>

As a workaround, you can temporarily switch your system locale to English, but I’m working on a proper solution.

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 4:54pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/15 "2021-11-24T16:54:25Z")

</div>

I update you on what I’ve done.  
I switched my system locale to English, and now the operation is effectively completed for all 10 time frames.  
However I don’t get any results (only an error), and the Python script is this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c04871d007b0af8765c01e60ce3ace696e85455f.png)

---

<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 24, 2021, 4:56pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/16 "2021-11-24T16:56:01Z")

</div>

You need to choose a different output for volume sequence and transform sequence (it is OK to choose only one and leave the other None).

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 5:08pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/17 "2021-11-24T17:08:08Z")

</div>

Sorry, you’re right.  
However correcting this, I still get the error regarding the “returnNode argument”, so then scrolling through the timeframes the segmentation does not change …

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/6/a603f11c493bc173f3467c6b15aa2dbbed590ffa.png)

---

<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 24, 2021, 5:10pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/18 "2021-11-24T17:10:39Z")

</div>

The message is just a warning, you can safely ignore it.

You need to apply the transform to the segmentation as it is explained in the tutorial video. Selection of the transform is done in a popup window and unfortunately the screen recording software did not capture the popup, but it is described in the video at 1:21 in the subtitles where to right-click in Data module and what to select.

---

<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 24, 2021, 6:16pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/19 "2021-11-24T18:16:35Z")

</div>

@Francesca_Pittoni would you mind trying if replacing content of this file `c:\Users\frapi\AppData\Local\NA-MIC\Slicer 4.13.0-2021-11-24\NA-MIC\Extensions-30427\SlicerElastix\lib\Slicer-4.13\qt-scripted-modules\Elastix.py` with this content of [this file](https://raw.githubusercontent.com/lassoan/SlicerElastix/master/Elastix/Elastix.py) makes it possible to run the registration even when your system locale is set to Italian?

---

<div class="post-metadata">

**Author:** ![Francesca\_Pittoni](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/francesca_pittoni/32/13184_2.png) [@Francesca\_Pittoni](https://discourse.slicer.org/u/Francesca_Pittoni)\
**Post date:** [November 24, 2021, 7:33pm UTC](https://discourse.slicer.org/t/automatic-segmentation-of-sequences-in-time/20756/20 "2021-11-24T19:33:14Z")

</div>

Thank you very much, now everything works (in English)!

I only have two final questions:  
Can I change the segmentation of a timeframe without affecting the others?  
And to export the STLs of the timeframes individually, to different files, do I have to go to the “segmentation” module?

Now I’ll try to run it in Italian and I’ll let you know about it
