IMedicalSegmentation<T>
Interfaces ยท AiDotNet.Interfaces
Interface for medical image segmentation models that handle 2D slices and 3D volumetric data.
Implements: ISegmentationModel<T>
Known implementations: MedicalSegmentationBase<T>
For Beginners
Medical segmentation helps doctors by automatically outlining organs, tumors, and other structures in medical images.
Key differences from regular segmentation:
- Works with 3D volumes (CT/MRI scans are stacks of 2D slices)
- Handles multiple imaging modalities (CT, MRI T1, MRI T2, etc.)
- Requires very high accuracy โ mistakes can affect patient care
- Often needs to handle varying image resolutions and orientations
Models implementing this interface:
- nnU-Net v2 (Nature Methods, self-configuring gold standard)
- TransUNet (transformer + U-Net hybrid)
- Swin-UNETR (hierarchical transformer for brain MRI)
- MedSAM / MedSAM 2 (SAM adapted for medical data)
- MedNeXt (ConvNeXt-based, MICCAI 2023)
- UniverSeg (few-shot, no fine-tuning needed)
- BiomedParse (foundation model, 9 imaging modalities)
How It Works
Medical image segmentation requires special handling for multi-modal imaging data (CT, MRI, X-ray, ultrasound, pathology), 3D volumetric processing, and clinical safety requirements. Models must handle varying image resolutions, anisotropic voxel spacing, and multi-class organ/lesion segmentation with high accuracy.
Properties
| Property | Summary |
|---|---|
IReadOnlyList<string> SupportedModalities { get; } |
Gets the imaging modalities this model supports (e.g., CT, MRI_T1, MRI_T2, Xray). |
bool Supports2D { get; } |
Gets whether this model supports 2D slice-by-slice segmentation. |
bool Supports3D { get; } |
Gets whether this model supports 3D volumetric segmentation. |
bool SupportsFewShot { get; } |
Gets whether this model supports few-shot segmentation (generalizing from few examples). |
Methods
| Method | Summary |
|---|---|
MedicalSegmentationResult<T> SegmentFewShot(Tensor<T> queryImage, Tensor<T> supportImages, Tensor<T> supportMasks) |
Segments using few-shot examples (for models that support it). |
MedicalSegmentationResult<T> SegmentSlice(Tensor<T> slice) |
Segments a 2D medical image slice. |
MedicalSegmentationResult<T> SegmentVolume(Tensor<T> volume) |
Segments a 3D medical volume. |