Update README with comprehensive documentation for all new features
Browse files
README.md
CHANGED
|
@@ -12,20 +12,32 @@ license: apache-2.0
|
|
| 12 |
|
| 13 |
# NeuroSAM 3: Medical Image Segmentation
|
| 14 |
|
| 15 |
-
A medical image segmentation application using SAM 3 (Segment Anything Model 3) for DICOM file analysis.
|
| 16 |
|
| 17 |
-
## Features
|
| 18 |
|
|
|
|
| 19 |
- π§ **SAM 3 Integration**: Uses the latest Segment Anything Model 3 for medical image segmentation
|
| 20 |
- π **DICOM Support**: Process CT and MRI DICOM files
|
| 21 |
- πΌοΈ **Image Formats**: Supports DICOM (.dcm), PNG, and JPG files
|
| 22 |
- π― **Text Prompts**: Describe what you want to segment (e.g., "brain", "tumor", "skull")
|
| 23 |
- βοΈ **Windowing Strategies**: Optimized windowing presets for CT images
|
| 24 |
-
|
| 25 |
-
|
|
|
|
| 26 |
- π **Subject Detection**: Automatically groups images by patient/subject ID
|
|
|
|
| 27 |
- π **Ground Truth Comparison**: Compare SAM 3 results with expert annotations (Dice score, IoU)
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
## Usage
|
| 30 |
|
| 31 |
### Single Image Processing
|
|
@@ -40,7 +52,32 @@ A medical image segmentation application using SAM 3 (Segment Anything Model 3)
|
|
| 40 |
2. Click "π Detect Subjects" to auto-group by patient ID
|
| 41 |
3. Select a subject from the dropdown
|
| 42 |
4. Click "Process All Slices"
|
| 43 |
-
5. Use the slider
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
### Compare with Ground Truth
|
| 46 |
1. Upload a medical image and its ground truth mask
|
|
@@ -54,6 +91,8 @@ A medical image segmentation application using SAM 3 (Segment Anything Model 3)
|
|
| 54 |
- Gradio
|
| 55 |
- PyDICOM
|
| 56 |
- Transformers (with SAM 3 support)
|
|
|
|
|
|
|
| 57 |
|
| 58 |
## Model
|
| 59 |
|
|
@@ -67,6 +106,21 @@ This app uses the SAM 3 model from Facebook/Meta. You need:
|
|
| 67 |
- UniqueData/dicom-brain-dataset (Hugging Face) - MRI Brain scans
|
| 68 |
- The Cancer Imaging Archive (TCIA) - Various medical imaging
|
| 69 |
- Imaging Data Commons (IDC) - Large collection of DICOM files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
## License
|
| 72 |
|
|
|
|
| 12 |
|
| 13 |
# NeuroSAM 3: Medical Image Segmentation
|
| 14 |
|
| 15 |
+
A comprehensive medical image segmentation application using SAM 3 (Segment Anything Model 3) for DICOM file analysis with advanced features.
|
| 16 |
|
| 17 |
+
## β¨ Features
|
| 18 |
|
| 19 |
+
### Core Features
|
| 20 |
- π§ **SAM 3 Integration**: Uses the latest Segment Anything Model 3 for medical image segmentation
|
| 21 |
- π **DICOM Support**: Process CT and MRI DICOM files
|
| 22 |
- πΌοΈ **Image Formats**: Supports DICOM (.dcm), PNG, and JPG files
|
| 23 |
- π― **Text Prompts**: Describe what you want to segment (e.g., "brain", "tumor", "skull")
|
| 24 |
- βοΈ **Windowing Strategies**: Optimized windowing presets for CT images
|
| 25 |
+
|
| 26 |
+
### Interactive Features
|
| 27 |
+
- π **Interactive Slice Viewer**: Scroll through multiple slices with auto-play
|
| 28 |
- π **Subject Detection**: Automatically groups images by patient/subject ID
|
| 29 |
+
- βΆοΈ **Auto-play**: Automatically animate through slices
|
| 30 |
- π **Ground Truth Comparison**: Compare SAM 3 results with expert annotations (Dice score, IoU)
|
| 31 |
|
| 32 |
+
### Enhanced Features (NEW!)
|
| 33 |
+
- β¨ **Enhanced Single Image**: Brightness/contrast controls, colormap options, transparency adjustment
|
| 34 |
+
- β¨ **Enhanced Batch Processing**: Process multiple images with ZIP download
|
| 35 |
+
- π― **Point/Box Prompts**: Interactive point-click and bounding box-based segmentation
|
| 36 |
+
- π **ROI Statistics**: Detailed statistics (area, intensity, centroid, bounding box)
|
| 37 |
+
- π₯ **NIFTI Export**: Export segmentation masks to NIFTI format for medical imaging software
|
| 38 |
+
- πΎ **Annotation Save/Load**: Save and reload annotations for later use
|
| 39 |
+
- π **Multi-Mask Output**: Generate multiple mask candidates with confidence scores
|
| 40 |
+
|
| 41 |
## Usage
|
| 42 |
|
| 43 |
### Single Image Processing
|
|
|
|
| 52 |
2. Click "π Detect Subjects" to auto-group by patient ID
|
| 53 |
3. Select a subject from the dropdown
|
| 54 |
4. Click "Process All Slices"
|
| 55 |
+
5. Use the slider, navigation buttons, or βΆοΈ Auto-play to scroll through slices
|
| 56 |
+
|
| 57 |
+
### Enhanced Single Image (with Image Adjustments)
|
| 58 |
+
1. Upload an image
|
| 59 |
+
2. Adjust brightness and contrast sliders
|
| 60 |
+
3. Choose colormap and transparency for mask overlay
|
| 61 |
+
4. Click "Segment with Progress"
|
| 62 |
+
5. Download result using the download button
|
| 63 |
+
|
| 64 |
+
### Point/Box Prompts
|
| 65 |
+
1. Upload an image
|
| 66 |
+
2. **Point Prompt**: Enter X, Y coordinates and click "Segment at Point"
|
| 67 |
+
3. **Box Prompt**: Enter bounding box coordinates (X1, Y1, X2, Y2) and click "Segment in Box"
|
| 68 |
+
|
| 69 |
+
### ROI Statistics & Export
|
| 70 |
+
1. Process an image using "Process & Calculate Statistics"
|
| 71 |
+
2. View detailed ROI statistics (area, intensity, centroid)
|
| 72 |
+
3. Export to NIFTI format for use in medical imaging software
|
| 73 |
+
4. Save annotation for later use
|
| 74 |
+
5. Load previously saved annotations
|
| 75 |
+
|
| 76 |
+
### Multi-Mask Output
|
| 77 |
+
1. Upload an image and enter prompt
|
| 78 |
+
2. Choose number of masks to generate (1-5)
|
| 79 |
+
3. Click "Generate Multiple Masks"
|
| 80 |
+
4. Compare mask candidates with confidence scores
|
| 81 |
|
| 82 |
### Compare with Ground Truth
|
| 83 |
1. Upload a medical image and its ground truth mask
|
|
|
|
| 91 |
- Gradio
|
| 92 |
- PyDICOM
|
| 93 |
- Transformers (with SAM 3 support)
|
| 94 |
+
- nibabel (for NIFTI export)
|
| 95 |
+
- scipy (for ROI statistics)
|
| 96 |
|
| 97 |
## Model
|
| 98 |
|
|
|
|
| 106 |
- UniqueData/dicom-brain-dataset (Hugging Face) - MRI Brain scans
|
| 107 |
- The Cancer Imaging Archive (TCIA) - Various medical imaging
|
| 108 |
- Imaging Data Commons (IDC) - Large collection of DICOM files
|
| 109 |
+
- Kaggle Brain MRI datasets - PNG/JPG format images
|
| 110 |
+
|
| 111 |
+
## Tabs Overview
|
| 112 |
+
|
| 113 |
+
| Tab | Description |
|
| 114 |
+
|-----|-------------|
|
| 115 |
+
| Single Image | Basic single image segmentation |
|
| 116 |
+
| Interactive Slice Viewer | Browse through multiple slices with auto-play |
|
| 117 |
+
| Gallery View | View all segmentations in a grid |
|
| 118 |
+
| Compare with Ground Truth | Evaluate with Dice/IoU metrics |
|
| 119 |
+
| β¨ Enhanced Single Image | Advanced controls with download |
|
| 120 |
+
| β¨ Enhanced Batch Processing | Batch processing with ZIP export |
|
| 121 |
+
| π― Point/Box Prompts | Interactive region selection |
|
| 122 |
+
| π ROI Statistics & Export | Statistics + NIFTI/annotation export |
|
| 123 |
+
| π Multi-Mask Output | Multiple mask candidates |
|
| 124 |
|
| 125 |
## License
|
| 126 |
|