# Volume rendering - crop not working in latest nightlies when loading older file

**URL:** <https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749>\
**Category:** Support\
**Created:** [May 2, 2018, 1:04pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749 "2018-05-02T13:04:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [May 2, 2018, 1:04pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/1 "2018-05-02T13:04:38Z")

</div>

This is on MacOS 10.12.6, MacBook Pro 15 retina (mid 2015), Radeon R9 M370X graphics.

I have a project (MRML, NRRD, segmentation, etc) that I’ve been working with in the April 15 nightly build. I’ve set up volume rendering with cropping and an ROI in a particular spot. I can reload this into the April 15 nightly and everything works great. When I load the same setup into the 5-2 nightly, nothing shows up in the volume render window unless I turn off cropping.

If I make a new annotation ROI and delete the old one, cropping works fine. Any ideas on why it doesn’t like the original ROI?

Thanks!

-Hollister

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 2, 2018, 2:22pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/2 "2018-05-02T14:22:22Z")

</div>

Hi Hollister,  
Thanks for the report! Cropping works fine on Windows, so I’ll try to reproduce it on Mac. Today’s very busy for me, but I’ll try get back to you soon hopefully. In the meantime can you please give me step-by step instructions on how to reproduce it the simplest possible way? Thanks!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 2, 2018, 2:27pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/3 "2018-05-02T14:27:52Z")

</div>

I tried on MacOSX 10.13.3 with the latest nightly and cropping works fine without any tricks. Can other Mac users please try to reproduce Hollister’s issue? Thanks

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [May 2, 2018, 3:08pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/4 "2018-05-02T15:08:02Z")

</div>

Hi Csaba,

No rush - I’ll get you a repro procedure soon.

Thanks!!

-Hollister

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [May 2, 2018, 4:00pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/5 "2018-05-02T16:00:57Z")

</div>

With today’s nightly on a mac pro with AMD FirePro D700 graphics volume rendering and cropping is working fine with me in both CPU and GPU modes. (I download SampleData, enable volume rendering and cropping).

@cpinter, I’m thinking that @hherhold might be reloading a scene file and there’s an issue with the multiple volume update.

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [May 2, 2018, 4:59pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/6 "2018-05-02T16:59:51Z")

</div>

Yeah, loading a file and volume rendering/cropping/everything in the same version works fine.

The issue is loading a file into a new version that was saved in an older version. New = 5-2 nightly, Old = 4-15 nightly.

If you have an old nightly (4-15) around, do this:

1. Run old nightly  
2 Load CTACardio
2. Turn on volume rendering
3. Turn on cropping
4. Crop a little
5. Save
6. Run new nightly
7. Load file from old nightly
8. Observe - no volume rendered.

If you turn off cropping, delete the annotation ROI and start over, it works fine. The issue is just loading old files with a new nightly.

Hope this makes sense!

-Hollister

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2018, 1:57pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/7 "2018-05-03T13:57:31Z")

</div>

Yes, it makes complete sense, thanks! I’ll try to look into this soon. I’ll be away for two weeks starting Saturday, so if I can’t get to this tomorrow then it will have to wait a bit, or somebody else will need to try to fix it if it’s urgent.

---

<div class="post-metadata">

**Author:** ![hherhold](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hherhold/32/12199_2.png) [@hherhold](https://discourse.slicer.org/u/hherhold)\
**Post date:** [May 3, 2018, 2:20pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/8 "2018-05-03T14:20:01Z")

</div>

Not urgent at all.

The workaround is just to delete the old ROI and make a new one - you lose the position of the cropping ROI, but that’s not a big deal.

Thanks!!!

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2018, 2:29pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/9 "2018-05-03T14:29:25Z")

</div>

I created a Mantis issue:  
[https://issues.slicer.org/view.php?id=4547](https://issues.slicer.org/view.php?id=4547)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2018, 6:19pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/10 "2018-05-03T18:19:24Z")

</div>

After some diagnosis:

1. The error is reproducible as described
2. If after loading the scene, we load the ROI separately from the acsv file, and select it as ROI for the volume in the Volume rendering module’s input section, then it’s displayed properly
3. If we clone the node that we loaded with the scene using subject hierarchy’s clone action, and select it as ROI, then the rendering does not show up
4. The properties of the good and bad nodes are identical

Quite strange. Need to do some debugging to figure this out.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2018, 6:21pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/11 "2018-05-03T18:21:11Z")

</div>

Not sure if it’s related to this: [https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/VolumeRendering/MRMLDM/vtkMRMLVolumeRenderingDisplayableManager.cxx#L549-L556](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/VolumeRendering/MRMLDM/vtkMRMLVolumeRenderingDisplayableManager.cxx#L549-L556)

For some reason cropping did not work when I was working on the mult-volume rendering, and after days of debugging I found out that if I invert the normals of the ROI, then it works. It was very strange, as the code that creates the ROI and the normals remained the same. @pieper maybe you have some insight…

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [May 3, 2018, 7:34pm UTC](https://discourse.slicer.org/t/volume-rendering-crop-not-working-in-latest-nightlies-when-loading-older-file/2749/12 "2018-05-03T19:34:50Z")

</div>

It was indeed related to the issue I referenced just above. I found the source of the problem which solved the bug Hollister reported, and removed the need for that workaround I referenced. So I can declare complete victory 🙂

Fixed in [https://github.com/Slicer/Slicer/commit/1443b336855a4885fc67e9e4497d3fea25e58e2e](https://github.com/Slicer/Slicer/commit/1443b336855a4885fc67e9e4497d3fea25e58e2e)

I hope it will work for you too. Now off to vacation!
