Saving volume properties

I’m having what I’m sure is a newbie problem. I’m working with a 3D view of a dcm file. In Volume Rendering I optimize the Display and Advanced parameters to achieve my desired result. I then save the project as a mrb file. After closing the scene and reopening the file the Volume Rendering settings that I had adjusted are not preserved. What do I need to do to retain these settings?

Thanks,

Stuart

Volume rendering settings should be saved in the .mrb file and restored when you load the scene. Please report what version of slicer you are using and exactly what steps you take. See if you can reproduce the issue using data from the SampleData module. Maybe there are some advanced parameters that aren’t be saved correctly and it would help if you identified which ones.

Thank you both for causing me to look into this issue a little more deeply.

I’m using Slicer 5.6.2. My project involves working with a CT file that has been segmented. When I open this project with the segmentation display turned off and I go to Volume Rendering the 3D CT display has a red highlight. Both the Scalar Opacity and Scalar Color Mapping includes a red band. This is my core problem. I wish to delete this red band permanently. When I select “Synchronized with Volumes” module my 3D rendering is reverts to gray scale only. However, after saving this revised version as a mrb file and then reload this revised project, both the Scalar Opacity and Scalar Color Mapping still include a red band. Otherwise, all numerical values for Threshold, Opacity and in Advanced are identical in both versions.

I don’t know where this red zone I’m my project comes from given that I’m working with CT images but I would like to remove it permanently. Thanks for your help.

I think we have to see the mrb file to understand what’s going on. Can you share that? Or maybe provide a screenshot of the red band.

Here’s a screenshot showing the red band:

The history is this:

  1. Open the segmented mrb file
  2. Open Data and turn off segmentation
  3. Open Volume Rendering and see the attached image
  4. Check and uncheck Synchronize with Volumes module to convert to gray scale image
  5. Adjust Threshold, Opacity and Advanced to suit taste
  6. Save modified project as mrb file
  7. Open the newly saved file and see the attached with red band

Where does the red band come from? How to remove it permanently?

I tried to attach mrb file but was unsuccessful - wrong authorized file extension. How do I upload a mrb file?

Thanks

You can post it somewhere on the cloud (e.g., dropbox) and then share the public link. Discourse only supports attaching images and video.

Try this:
Go to inputs, and choose to create a new volume property. Then click on (and then off) Synchronize with Volumes module. This should give a basic grayscale ramp, which i think is what you are looking for.

If you share the scene file then we can tell where the red control point in the scalar color mapping function comes from and suggest how to fix it permanently.

I’ve learned that if I delete the volume property and add a new one the red cast disappears. However, when I save the project as a mrb file and then reopen it the recast has returned. I hope this observation is useful in understanding what is amiss. Thanks.

Here’s the Dropbox link: Dropbox

You have a very unusual dataset. The intensities are between 0 and 0.148 and saved as double precision.
I don’t think the volume rendering widgets are designed to handle such low range. The typical intensity values for CT data have 12 bit range (e.g., 0-4096).

I did those changes (Simple Filter->Rescale Intensity Filter to scale the image 0-4905. Then run the Cast Image Module and choose the option to set unsigned short). everything works fine, with a regular grayscale ramp that persists.

I’ve found the root cause of the unexpected red color appearing. The line length in the .vp file reader had an arbitrary maximum line length (1024 characters), therefore when many control points were in the color transfer function then the list of points got truncated. Since truncation occurred in the middle of an entry, the red component was successfully read out, but the green and blue were missing and set to 0.

I’ll push a fix today or tomorrow.

1 Like

I followed the steps you outlined and got exactly the same result as in your image including the two control points and nice ramp and same appearance of the 3D image. I then saved the file with a new name, closed the scene, and loaded the new file. This is the result I obtained:

Why isn’t the scalar mapping information retained and why is the 3D image different?

I can readjust the mapping and reconstruct the result but why isn’t this information retained in volume properties?

Thanks

perhaps it is related to the issue @lassoan posted above. When the push is fixed, please try with the latest preview version and see if the issue persists.

The fix for the truncated color transfer function is submitted and currently under review:

Now I’m working with Slicer 5.7.0-2024-05-30, revision 32881.

I’ve opened my project and the red band issue is complete absent. Hurray.

I then created a new volume property, clicked the Synchronize with Volume module on and off, and then adjusted the Threshold and Opacity. This revised project was saved with a new number and then reopened. Unfortunately the adjusted volume properties were not retained. They could easily be reset but were still not retained when repeating this process.

I don’t think today’s preview build has those fixed. Changes are merged less than an hour ago. So the earliest it will be incorporated will be tomorrow’s preview build (make sure the revision number has increased before downloading, if build doesn’t complete tonight due to any reason, it will still the same version as today.).

1 Like

Well that’s interesting isn’t it?

I’m not sure what you mean. We fully understand what happened any why: only the first 1024 bytes of the color transfer function was read from the .vp file, which caused incomplete loading and potentially color corruption of the last read color point.

The fix was integrated yesterday and is now available in the Slicer Preview Release today (2024-06-01). Yesterday’s release did not contain the fix.

1 Like

Thanks Andras,

This morning I downloaded the new release (5.7.0-2024-06-01 r32886 / eceb683) and all my difficulties disappeared.

You deserve a raise!

1 Like