Showing both the background and foreground layer volumes in their entirety

I often find myself with two 3D ultrasound volumes that I want to overlay in a slice view, but having the background volume determine the extent of the foreground volume that is shown (using regular alpha blending) results in me losing some reference image data from the foreground that doesn’t overlap.

I found this one mention related to this topic in another thread linked below. cc: @lassoan

What would the development effort be like and what areas of Slicer would need to be changed to support the ability to show both background and foreground volumes in their entirety in the slice views instead of one masking the other?

I haven’t looked at the slice view code in a very long time, but I believe we set the reslice outputs for all layers to have 0 alpha outside of the slice extents. This makes sense for the foreground, but maybe not for the background. For compositing the 0 alpha means that the foreground alpha is multiplied by zero and thus never shows up.

If that is the issue then it’s maybe a simple change in this code.

We rely on this feature, for example when we want to apply a fan-shaped mask on ultrasound image display, so this masking should not be completely removed, but made optional.

I’ve mapped out the slice view pipelines a few years ago for some performance optimization investigation. These provide a general overview of how things work. Red indicates the old implementation (you can ignore it) and green the new (current) one.


Scalar volumes:


Vector volumes:


I think the cropping to background region is due to AlphaLogic filter, which applies a stencil on the alpha component. Probably the cropping to background volume could be removed by removing the stencil input connection to this filter in the layer logic (or set empty input).

This could be controlled with a checkbox in the blending options submenu:

When “Crop to background” (I’m not sure if this is the best name) option is disabled then you also need to pay attention to take into account all volume layers volume when “fit” button is clicked.

Yes, I would also agree with making it a new option by maintaining current behavior. Thanks for the detailed information on the topic.