Skip to content

Commit

Permalink
refactor(IVolumeInput): remove useIndependentComponents property and …
Browse files Browse the repository at this point in the history
…update related configurations

- Removed the useIndependentComponents property from IVolumeInput type definition and related configurations in various files.
- Updated the handling of blendMode and useIndependentComponents in addLabelmapToElement and addVolumesAsIndependentComponents functions to streamline volume input management.
- Cleaned up unnecessary comments and code related to independent components in SegmentationStateTypes.
  • Loading branch information
sedghi committed Dec 10, 2024
1 parent 783c60a commit b8edaf1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 21 deletions.
1 change: 0 additions & 1 deletion common/reviews/api/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2486,7 +2486,6 @@ type IVolumeInput = {
callback?: VolumeInputCallback;
blendMode?: BlendModes;
slabThickness?: number;
useIndependentComponents?: boolean;
[key: string]: unknown;
};

Expand Down
10 changes: 0 additions & 10 deletions packages/core/src/types/IVolumeInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ type IVolumeInput = {
blendMode?: BlendModes;
/** Slab thickness of the volume - by default it is 0.05*/
slabThickness?: number;
/**
* If a volume input has an independent component flag set, it means it requests
* to not create another separate volume actor/mapper, but to use the same
* default volume actor/mapper and insert the volume data as a separate
* component into the old mapper data. This is often used for segmentations on
* MIPs where the segmentation cannot be rendered as a separate volume actor
* since during the blend mode calculation, the ray steps require the knowledge
* of the original volume data + segmentation data.
*/
useIndependentComponents?: boolean;
/** other metadata that is needed for the volume */
[key: string]: unknown;
};
Expand Down
1 change: 0 additions & 1 deletion packages/tools/examples/labelmapMIP/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ async function run() {
segmentationId,
config: {
blendMode: BlendModes.LABELMAP_EDGE_PROJECTION_BLEND,
useIndependentComponents: true,
},
},
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ async function addLabelmapToElement(
await _handleMissingVolume(labelMapData);
}

const blendMode =
config?.blendMode ?? Enums.BlendModes.MAXIMUM_INTENSITY_BLEND;

const useIndependentComponents =
blendMode === Enums.BlendModes.LABELMAP_EDGE_PROJECTION_BLEND;

const volumeInputs: Types.IVolumeInput[] = [
{
volumeId,
visibility,
representationUID: `${segmentationId}-${SegmentationRepresentations.Labelmap}`,
useIndependentComponents: config?.useIndependentComponents ?? false,
blendMode:
config?.blendMode ?? Enums.BlendModes.MAXIMUM_INTENSITY_BLEND,
useIndependentComponents,
blendMode,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export async function addVolumesAsIndependentComponents({
}

const { volumeId } = volumeInputArray[0];
const segVolumeId = volumeId;

const segImageVolume = await volumeLoader.loadVolume(volumeId);

Expand Down
5 changes: 0 additions & 5 deletions packages/tools/src/types/SegmentationStateTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ export type LabelmapRenderingConfig = {
cfun: vtkColorTransferFunction;
ofun: vtkPiecewiseFunction;
colorLUTIndex: number;
// whether the segmentation is used as independent component
// or not, if you don't want segmentation on MIP, you don't
// need to touch this
useIndependentComponents?: boolean;
// segmentation blend mode if desired
blendMode?: coreEnums.BlendModes;
};
Expand Down Expand Up @@ -145,7 +141,6 @@ export type RepresentationPublicInput = {
type?: Enums.SegmentationRepresentations;
config?: {
colorLUTOrIndex?: Types.ColorLUT | number;
useIndependentComponents?: boolean;
blendMode?: coreEnums.BlendModes;
};
};

0 comments on commit b8edaf1

Please sign in to comment.