# Unexpected voxel values at boundary when using CPR (curved planer reformat) to straighten label volume

**URL:** <https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174>\
**Category:** Support\
**Created:** [December 22, 2021, 2:52am UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174 "2021-12-22T02:52:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kane\_Daizah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kane_daizah/32/13600_2.png) [@Kane\_Daizah](https://discourse.slicer.org/u/Kane_Daizah)\
**Post date:** [December 22, 2021, 2:52am UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/1 "2021-12-22T02:52:31Z")

</div>

Hi, when I used the centerline extraction and CPR to straighten the true and false lumen labels of the aorta, I found that some of the true lumen labels of the aorta will be mixed with the false lumen labels after straightening. I don’t think there should be such a problem according to the principle of straightening.  
I have no idea why it . Do you have any suggestions?

Before straightening  
 ![WeChat Image_20211222102449](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/4/44ef6831cafd72175ba1f275630f81b0a80de8a4.png)  
 ![WeChat Image_20211222102444](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/c/7c6576b1b328e20f5f0b38a797a167b29901c457.png)

After straightening  
 ![WeChat Image_20211222102455](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/3/e3cbce71f753a07ccf83081ef81cfb53fbc62b09.png)  
 ![WeChat Image_20211222102728](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/1/8120dd8c3668b3632b4bcae3147a4868796fbce9.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:** [December 22, 2021, 3:15am UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/2 "2021-12-22T03:15:23Z")

</div>

You need to turn off interpolation (use “nearest neighbor” method) when you harden transforms on labelmap volumes.

Interpolation would create smooth transition from label value to the background value. For example if your segment’s label value is 5 and the background value is 0 then you would have all kinds of voxel values values between 0-5 at the boundary of this segment.

I’ve just noticed that you’ve sent ITK-Snap screenshots. Is there any specific feature in ITK-Snap that you have not found in Slicer?

---

<div class="post-metadata">

**Author:** ![Kane\_Daizah](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kane_daizah/32/13600_2.png) [@Kane\_Daizah](https://discourse.slicer.org/u/Kane_Daizah)\
**Post date:** [December 22, 2021, 6:58am UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/3 "2021-12-22T06:58:39Z")

</div>

Thank you so much!

I used ITK-snap screenshots because I am a cs student who has new to medical image segmentation and is very lack of medical image knowledge. And I often encounter the orientations are different from images and labels for various reasons.

Images and labels with different orientations in 3D slicer will not automatically overlap. ITK-snap seems to automatically merge and visualize images and labels in different orientations. So I would like to use ITK-snap to visualize the data. But I think 3D slicer can make beginners notice the problem of orientation. In fact, I’m ashamed to say that after I used 3D slicer, I realized that the poor performance of my deep learning network is due to the inability of images and labels to overlap due to different orientations.

Pictures and labels in different orientation  
 ![b8650b1786e9cba61b31731bf4ff93d](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/1/210a1a9554e5daa64b813f6e8e78aad0a576d22a.png)

In 3D slicer  
 ![ac66b23bf2dd6ce9da80f97718d5544](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/c/7cb2bf395cd9b19d3b68c8891b1f562d7f4af378.png)

In ITK-snap  
 ![c9dcc145cbc5be6289f5a8a82ae6061](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/7/c790f70d8381d62f605d55323dd44438dbc30ca5.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:** [December 22, 2021, 2:03pm UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/4 "2021-12-22T14:03:08Z")

</div>

> [@Kane\_Daizah](#):
>
> Images and labels with different orientations in 3D slicer will not automatically overlap. ITK-snap seems to automatically merge and visualize images and labels in different orientations.

ITK-Snap cannot operate on images and labels with different geometry (origin, spacing, and axis directions must be the same). ITK-Snap warns you about the geometry mismatch when you load the data but if you proceed then it simply ignores the geometry information, so you will not be able to see the actual misalignment between your data sets.

---

<div class="post-metadata">

**Author:** ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)\
**Post date:** [May 2, 2022, 3:49pm UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/5 "2022-05-02T15:49:10Z")

</div>

Hello Andras, how can I set to neareast neighbor when hardening a transform?

---

<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 8, 2022, 3:30am UTC](https://discourse.slicer.org/t/unexpected-voxel-values-at-boundary-when-using-cpr-curved-planer-reformat-to-straighten-label-volume/21174/6 "2022-05-08T03:30:56Z")

</div>

Hardening a transform on a volume always used linear interpolation [until a few days ago](https://github.com/Slicer/Slicer/commit/704c46f00ab98a2b59883ecec5444c99176e58ba). Now in the latest Slicer Preview Release uses nearest neighbor interpolation for labelmap volumes. If you use a different Slicer version then you can convert your labelmap volume to segmentation and harden the transform on that.
