# New Feature: Independent Multi-Component Volume Rendering

**URL:** <https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356>\
**Category:** Support\
**Tags:** feature, volume-rendering\
**Created:** [December 3, 2025, 5:32pm UTC](https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356 "2025-12-03T17:32:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [December 3, 2025, 5:32pm UTC](https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356/1 "2025-12-03T17:32:15Z")

</div>

3D Slicer can now independently render each component of multi-component volumes (such as 3D color Doppler ultrasound or multispectral microscopy images) in 3D views. A new json-based file format is introduced to store the volume rendering settings.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/d/cd4321fee0e293aadd9292cace9912d14530186e.jpeg)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/b/1b7bd77e6c06a00be910aa5b6fa9855970c3a86a.jpeg)

Development was funded in part by a Children’s Hospital of Philadelphia (CHOP) Cardiac Center Innovation Grant, a CHOP Cardiac Center Research Grant, a CHOP Frontier Grant, NIH R01 HL153166 and T32GM008562.

## For users:

The Volume Rendering module now supports editing of multi-component volume rendering transfer functions.

To access this interface:

- Open the “Advanced” tab in the volume rendering module
- Select “Independent” components
- Changing the “Component Index” allows the transfer function for each component to be modified with the transfer function plot.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/6/7654178c2f63b8ae6a117ba5d11dcdaa9e5083e6.png) ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/c/6c4ec0d7ddb3be0f46aefaf2e881419f65977b98.png)

## For developers:

- **Multi-Component Transfer Functions:** The ` vtkMRMLVolumePropertyNode` now fully supports editing and managing transfer functions for volumes with multiple scalar components
- **New JSON Storage Format:** The new `vtkMRMLVolumePropertyJSONStorageNode` class enables reading and writing full volume property configurations to JSON files, including:
  - Transfer functions for each component
  - Lighting parameters
  - Clipped voxel intensity settings

Independent component rendering can be enabled from python using vtkMRMLVolumeRenderingDisplayNode and vtkMRMLVolumePropertyNode:

```python
volumeNode = slicer.util.getNode('VolumeNode')
displayNode = slicer.modules.volumerendering.logic().CreateDefaultVolumeRenderingNodes(volumeNode)
volumePropertyNode = displayNode.GetVolumePropertyNode()
numberOfComponents = volumeNode.GetImageData().GetNumberOfScalarComponents()
volumePropertyNode.SetNumberOfIndependentComponents(numberOfComponents)
volumeProperty = volumePropertyNode.GetVolumeProperty()

# Enable independent components mode (vs RGB color mode)
# For volumes with 3-4 components, you can choose between:
# - IndependentComponents = False (RGB/RGBA color mode)
# - IndependentComponents = True (independent transfer functions per component)
volumeProperty.SetIndependentComponents(True)

# Configure transfer functions for each component
for component in range(numberOfComponents):
    # Get the color transfer function for this component
    colorTransfer = volumeProperty.GetRGBTransferFunction(component)
    colorTransfer.RemoveAllPoints()
    colorTransfer.AddRGBPoint(0, 0.0, 0.0, 0.0)
    colorTransfer.AddRGBPoint(255, 1.0, 1.0, 1.0)

# Get the opacity transfer function for this component
opacityTransfer = volumeProperty.GetScalarOpacity(component)
opacityTransfer.RemoveAllPoints()
opacityTransfer.AddPoint(0, 0.0)
opacityTransfer.AddPoint(128, 0.5)
opacityTransfer.AddPoint(255, 1.0)

# Configure component-specific shading
volumeProperty.SetShade(component, 1)
volumeProperty.SetAmbient(component, 0.2)
volumeProperty.SetDiffuse(component, 0.7)
volumeProperty.SetSpecular(component, 0.3)
volumeProperty.SetSpecularPower(component, 10.0)
displayNode.SetVisibility(True)

```

## Format of .vp.json (volume property JSON)

Since Slicer version 5.9, volume rendering properties are stored in JSON format by default, with the file extension `.vp.json`. This format is self-describing and easier to interpret than the legacy text file format. Details are specified by this JSON schema: [https://raw.githubusercontent.com/slicer/slicer/main/Modules/Loadable/VolumeRendering/Resources/Schema/volume-property-schema-v1.0.0.json](https://can01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fslicer%2Fslicer%2Fmain%2FModules%2FLoadable%2FVolumeRendering%2FResources%2FSchema%2Fvolume-property-schema-v1.0.0.json&data=05%7C02%7Ckyle.sunderland%40queensu.ca%7C9711180bdc7c4476467308de329119d1%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C639003795956111216%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=qu10rtoL4oc09G0JeHYNSlxDVfnPRZRuV8zrNs5yszQ%3D&reserved=0)

Example `.vp.json` file:

```json
{
    "@schema": https://raw.githubusercontent.com/slicer/slicer/main/Modules/Loadable/VolumeRendering/Resources/Schema/volume-property-schema-v1.0.0.json#,
    "volumeProperties": [
        {
            "effectiveRange": [0.0, 220.0],
            "components": [
                {
                    "shade": true,
                    "lighting": {
                        "diffuse": 1.0,
                        "ambient": 0.2,
                        "specular": 0.0,
                        "specularPower": 1.0
                    },
                    "rgbTransferFunction": {
                        "type": "colorTransferFunction",
                        "points": [
                            { "x": 0.0, "color": [0.0, 0.0, 0.0] },
                            { "x": 20.0, "color": [0.168627, 0.0, 0.0] },
                            { "x": 40.0, "color": [0.403922, 0.145098, 0.0784314] },
                            { "x": 40.0, "color": [0.403922, 0.145098, 0.0784314] },
                            { "x": 120.0, "color": [0.780392, 0.607843, 0.380392] },
                            { "x": 220.0, "color": [0.847059, 0.835294, 0.788235] },
                            { "x": 1024.0, "color": [1.0, 1.0, 1.0] }
                        ]
                    },
                    "scalarOpacityUnitDistance": 1.0,
                    "scalarOpacity": {
                        "type": "piecewiseLinearFunction",
                        "points": [
                            { "x": 0.0, "y": 0.0 },
                            { "x": 120.0, "y": 0.3 },
                            { "x": 220.0, "y": 0.375 },
                            { "x": 1024.0, "y": 0.5 }
                        ]
                    },
                    "gradientOpacity": {
                        "type": "piecewiseLinearFunction",
                        "points": [
                            { "x": 0.0, "y": 1.0 },
                            { "x": 255.0, "y": 1.0 }
                        ]
                    }
                }
            ]
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [December 5, 2025, 2:43pm UTC](https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356/2 "2025-12-05T14:43:04Z")

</div>

@Sunderlandkyl Do you think you could add a short note near each images describing which anatomical part are being rendered ? 🙏

We will then update the release note to include the relevant details.

cc: @Sam_Horvath @rkikinis

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [December 8, 2025, 4:50pm UTC](https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356/3 "2025-12-08T16:50:24Z")

</div>

@jcfr I don’t have the ability to edit the post past a few minutes.

I’m not sure what is in the first image, I took it from this post: [Working with RGBA in Volume Rendering - #9 by lassoan](https://discourse.slicer.org/t/working-with-rgba-in-volume-rendering/44814/9)  
@muratmaga or @lassoan Could you explain what’s in the image?

The second image is a 2-component volume containing:

1. Heart-valve ultrasound
2. Doppler volume showing blood flow

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [December 8, 2025, 5:44pm UTC](https://discourse.slicer.org/t/new-feature-independent-multi-component-volume-rendering/45356/4 "2025-12-08T17:44:25Z")

</div>

I don’t really know much more than it is a multichannel confocal image of a mouse brain.
