# Regularization transform is not applied to generated models

**URL:** <https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448>\
**Category:** Support\
**Created:** [July 10, 2018, 2:52pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448 "2018-07-10T14:52:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukebo](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lukebo](https://discourse.slicer.org/u/lukebo)\
**Post date:** [July 10, 2018, 2:52pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/1 "2018-07-10T14:52:37Z")

</div>

Hi everybody,  
I have CT data which was obtained with a somehow tilted gantry and also with two different slice thicknesses within one series.

During the examination of the series in the DICOM-Browser, Slicer notes, that there are irregularities in the slice thickness and that transforms will be applied.

When I enter the models module, a warning appears several times: “Geometry of master and merge model volumes do not match. Transform mismatch”.

I used “Apply regularization transform” in the DICOM Settings and tried several Dicom Reader approaches. Using DCMTK and the activated transform, the views in the red, yellow and green box look good, at least visually. However, when I now try to create a model, let’s say bone from some HU to some higher HU, the model looks distorted. Slicer seems to apply the thickness of the first half of the volume also to the other half which then looks compressed in the z direction.  
Am I too stupid or is this a general problem? What am I doing wrong?  
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:** [July 10, 2018, 3:09pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/2 "2018-07-10T15:09:18Z")

</div>

It seems that you try to use the legacy Editor module. Please use Segment Editor module instead and the error should not occur.

Probably you’ve done it already, but just in case, check that you’ve enabled application of regularization transform (menu: Edit / Application settings / DICOM / Acquisition geometry regularization =\> apply regularization transform).

I would also recommend to go to Transforms module and harden the acquisition transform on your volume - it resamples the volume on a regularly spaced grid, avoiding all complications that may be caused by non-uniform spacing (you may need a recent Slicer nightly build for this to work well).

---

<div class="post-metadata">

**Author:** ![lukebo](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lukebo](https://discourse.slicer.org/u/lukebo)\
**Post date:** [July 11, 2018, 6:49am UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/3 "2018-07-11T06:49:37Z")

</div>

Thank you so much Andreas,  
this almost solves the problem.  
Let me ask a probably easy follow up question: I press the “+ Add” button. Then i press “Threshold” and set the threshold to eg 200 - Max HU. The slices in the red, yellow and green box look good and everything is correctly marked. Then i hit “Apply”. Now, only the lower half of my volume (with higher slice density) is selected/colored and when i click “show 3d”, only the lower half of the model is rendered.  
There is only one master volume available.

(I now use DCMTK and the apply transform option in the segment editor. I did not try the transforms-module so far, as i need some deeper stufy of the manual first.)

Thank you very much for you 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:** [July 12, 2018, 2:59am UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/4 "2018-07-12T02:59:41Z")

</div>

> [@lukebo](#):
>
> Then i hit “Apply”. Now, only the lower half of my volume (with higher slice density) is selected/colored and when i click “show 3d”, only the lower half of the model is rendered.

It seems that Segment editor does not fully support editing non-linearly transformed volume (it does not compute the extent properly). For now, the simplest would be to harden the acquisition transform on the volume before you start segmentation.

---

<div class="post-metadata">

**Author:** ![lukebo](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lukebo](https://discourse.slicer.org/u/lukebo)\
**Post date:** [July 12, 2018, 6:23am UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/5 "2018-07-12T06:23:41Z")

</div>

Thanks Andras for your support. I will try the transform.  
Best regards!

---

<div class="post-metadata">

**Author:** ![lukebo](https://avatars.discourse-cdn.com/v4/letter/l/fbc32d/32.png) [@lukebo](https://discourse.slicer.org/u/lukebo)\
**Post date:** [October 17, 2018, 2:10pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/6 "2018-10-17T14:10:48Z")

</div>

Works perfectly! Thanks!!!

---

<div class="post-metadata">

**Author:** ![DonaldHume](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/donaldhume/32/3846_2.png) [@DonaldHume](https://discourse.slicer.org/u/DonaldHume)\
**Post date:** [May 29, 2019, 10:58pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/7 "2019-05-29T22:58:27Z")

</div>

Hi, I’m having similar issues to OP and was hoping someone might help me. I also have a scan with variable slice thickness through maybe 4 different regions of the scan. I was able to successfully regularize geometry upon read in. However when I begin to segment (and upon closer inspection of the RYG views) there are gaps in my volume as seen here ![2019-05-29_1656](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/5/050fc62ffe5ba34086af309638b5419a0922436f.png)

I’m wondering if I also need to harden my series, but I can’t seem to figure out how to do that. When I go to the Transform tab everything is greyed out and not accessible. Any advice would be appreciated!

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:** [May 30, 2019, 3:53am UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/8 "2019-05-30T03:53:30Z")

</div>

> [@DonaldHume](#):
>
> When I go to the Transform tab everything is greyed out and not accessible.

You need to select the transform next to “Active Transform” label, then scroll down to “Apply transform” section. You can harden a transform with less clicks in Data module: double-click on the transform icon in the transforms column and choose “Harden transform”.

The screenshot above indicates that there might be something wrong with the frames. Maybe there are some extra frames in the sequence that don’t belong there (sometimes localizer images got mixed into the 3D series). Check slice positions in the [DICOM browser’s metadata viewer](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/44).

---

<div class="post-metadata">

**Author:** ![DonaldHume](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/donaldhume/32/3846_2.png) [@DonaldHume](https://discourse.slicer.org/u/DonaldHume)\
**Post date:** [May 30, 2019, 5:48pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/9 "2019-05-30T17:48:18Z")

</div>

Hi Andras, I believe you are correct:

> [@lassoan](#):
>
> Maybe there are some extra frames in the sequence that don’t belong there (sometimes localizer images got mixed into the 3D series). Check slice positions in the [DICOM browser’s metadata viewer](https://discourse.slicer.org/t/how-to-adjust-the-distorted-image/817/44).

I’ve found that the sections of the scan with changing slice thickness sometimes have double frames (same location) and sometimes overlap in the transitional region … likely convoluting the linearization. Here’s an example I found:

| Slice # | Location | Thickness |
| --- | --- | --- |
| 60 | -422.5 | 2.5 |
| 61 | -420 | 2.5 |
| 62 | -418.125 | 5 |
| 63 | -417.5 | 2.5 |
| 64 | -413.125 | 5 |
| 65 | -408.125 | 5 |

Is there a way for me to fix this in Slicer3D, so that I might then linearize it properly? I appreciate your feedback, thank you.

---

<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:** [May 30, 2019, 5:54pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/10 "2019-05-30T17:54:31Z")

</div>

Varying spacing is not an issue but if there are duplicate frames or highly non-parallel (e.g., orthogonal) planes then they should be removed. If they are separated based on acquisition time then you can split up the series (menu: Application settings / DICOM / Allow subseries loading by time -\> enable; in DICOM module: enable Advanced option, click Examine, and see if there is a subseries listed that is usable). If this does not work then you may need to manually delete the DICOM file before importing the DICOM folder into Slicer (and next time play with data export parameters in the CT scanner to prevent mixing in the extra slices in the volumetric acquisition).

---

<div class="post-metadata">

**Author:** ![DonaldHume](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/donaldhume/32/3846_2.png) [@DonaldHume](https://discourse.slicer.org/u/DonaldHume)\
**Post date:** [May 30, 2019, 6:49pm UTC](https://discourse.slicer.org/t/regularization-transform-is-not-applied-to-generated-models/3448/11 "2019-05-30T18:49:36Z")

</div>

Thank you for the feedback; I’ll explore some of those suggestions.
