VisualizationController

Dual segmentation visualization controller.

Manages display of gold standard and test segmentations with different view modes and color schemes.

Gold standards: Loaded from .seg.nrrd (primary) or DICOM cache (for CSE) Test segmentations: Loaded from DICOM SEG (optimization output format)

Classes

class VisualizationController

Control dual segmentation visualization.

Displays gold standard (yellow/gold) and test (cyan) segmentations with various view modes: outline, transparent, fill.

Gold standards are loaded from .seg.nrrd files (git-tracked canonical format). Test segmentations are loaded from DICOM SEG (optimization output format).

Methods:

__init__()

Initialize controller.

load_gold_segmentation()

Load gold standard segmentation from .seg.nrrd file.

load_gold_from_dicom_cache()

Load gold standard from DICOM cache.

load_test_segmentation_from_dicom()

Load trial segmentation from DICOM SEG file.

set_view_mode()

Change display mode for both segmentations.

toggle_gold()

Toggle gold standard visibility.

toggle_test()

Toggle test segmentation visibility.

cleanup()

Clean up loaded segmentations.

get_gold_node()

Get gold standard segmentation node.

get_test_node()

Get test segmentation node.

Functions

load_gold_segmentation()

Load gold standard segmentation from .seg.nrrd file.

This is the primary method for loading gold standards. Gold standards are stored as .seg.nrrd in git for version tracking.

Args:

path: Path to .seg.nrrd segmentation file.

Returns:

True if loaded successfully.

load_gold_from_dicom_cache()

Load gold standard from DICOM cache.

Used for CrossSegmentationExplorer compatibility when DICOM format is needed. The DICOM cache is generated on-demand from .seg.nrrd.

Requires QuantitativeReporting extension for DICOMSegmentationPlugin.

Args:

dicom_seg_path: Path to DICOM SEG directory or file in .dicom_cache/.

Returns:

True if loaded successfully.

load_test_segmentation_from_dicom()

Load trial segmentation from DICOM SEG file.

Test segmentations from optimization runs are stored as DICOM SEG.

Requires QuantitativeReporting extension for DICOMSegmentationPlugin.

Args:

dicom_seg_path: Path to DICOM SEG directory or file.

Returns:

True if loaded successfully.

set_view_mode()

Change display mode for both segmentations.

Args:

mode: View mode - “outline”, “transparent”, or “fill”.

toggle_gold()

Toggle gold standard visibility.

Args:

visible: Whether to show gold standard.

toggle_test()

Toggle test segmentation visibility.

Args:

visible: Whether to show test segmentation.

cleanup()

Clean up loaded segmentations.

get_gold_node()

Get gold standard segmentation node.

get_test_node()

Get test segmentation node.