fix(SegmentationStyle): Fix inactive contour visibility and styling. (#5563)
* Opacity, fill and outline properties for active and inactive contours are now consistent with those for label map segmentations. The properties for inactive segmentations are applied to BOTH inactive contours and label maps. * Activate the selected segmentation for a type when the alpha, outline width, or fill/outline visibility is changed.
This commit is contained in:
1 parent
62797acd9a
commit
5c17c262ea
23 files changed
+395
-361
No files matched your search
@@ -1760,6 +1760,16 @@ function commandsModule({
|
||||
segmentationService.setStyle({ type }, { renderFill: value });
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets whether to render fill for inactive segmentations of a segmentation type
|
||||
* @param props.type - The type of segmentation
|
||||
* @param props.value - Whether to render fill for inactive segmentations
|
||||
*/
|
||||
setRenderFillInactiveCommand: ({ type, value }) => {
|
||||
const { segmentationService } = servicesManager.services;
|
||||
segmentationService.setStyle({ type }, { renderFillInactive: value });
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets whether to render outline for a segmentation type
|
||||
* @param props.type - The type of segmentation
|
||||
@@ -1771,13 +1781,36 @@ function commandsModule({
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the fill alpha for inactive segmentations
|
||||
* Sets whether to render outline for inactive segmentations of a segmentation type
|
||||
* @param props.type - The type of segmentation
|
||||
* @param props.value - Whether to render outline for inactive segmentations
|
||||
*/
|
||||
setRenderOutlineInactiveCommand: ({ type, value }) => {
|
||||
const { segmentationService } = servicesManager.services;
|
||||
segmentationService.setStyle({ type }, { renderOutlineInactive: value });
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the fill alpha for inactive segmentations.
|
||||
* If no type is provided, the fill alpha for all types will be set.
|
||||
* @param props.type - The type of segmentation
|
||||
* @param props.value - The alpha value to set
|
||||
*/
|
||||
setFillAlphaInactiveCommand: ({ type, value }) => {
|
||||
const { segmentationService } = servicesManager.services;
|
||||
segmentationService.setStyle({ type }, { fillAlphaInactive: value });
|
||||
|
||||
if (type) {
|
||||
segmentationService.setStyle({ type }, { fillAlphaInactive: value });
|
||||
} else {
|
||||
segmentationService.setStyle(
|
||||
{ type: SegmentationRepresentations.Labelmap },
|
||||
{ fillAlphaInactive: value }
|
||||
);
|
||||
segmentationService.setStyle(
|
||||
{ type: SegmentationRepresentations.Contour },
|
||||
{ fillAlphaInactive: value }
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
editSegmentLabel: async ({ segmentationId, segmentIndex }) => {
|
||||
@@ -2708,9 +2741,15 @@ function commandsModule({
|
||||
setRenderFill: {
|
||||
commandFn: actions.setRenderFillCommand,
|
||||
},
|
||||
setRenderFillInactive: {
|
||||
commandFn: actions.setRenderFillInactiveCommand,
|
||||
},
|
||||
setRenderOutline: {
|
||||
commandFn: actions.setRenderOutlineCommand,
|
||||
},
|
||||
setRenderOutlineInactive: {
|
||||
commandFn: actions.setRenderOutlineInactiveCommand,
|
||||
},
|
||||
setFillAlphaInactive: {
|
||||
commandFn: actions.setFillAlphaInactiveCommand,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user