Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ In addition, you can find a table of the basic supported fields, modalities, vie
<li>Segmentation</li>
<li>DeepGrow</li>
<li>DeepEdit</li>
<li>VISTA3D (Universal)</li>
<li>SAM2 (2D/3D)</li>
</ul>
</td>
Expand Down Expand Up @@ -345,6 +346,11 @@ monailabel start_server --app apps/radiology --studies datasets/Task09_Spleen/im
- [MONAILabel: Multi-organ Segmentation with 3D Slicer](https://github.com/Project-MONAI/tutorials/blob/main/monailabel/monailabel_monaibundle_3dslicer_multiorgan_seg.ipynb): Multi-organ segmentation with CT scans in 3D Slicer.
- [MONAILabel: Whole Body CT Segmentation with 3D Slicer](https://github.com/Project-MONAI/tutorials/blob/main/monailabel/monailabel_wholebody_totalSegmentator_3dslicer.ipynb): Whole body (104 structures) segmentation with CT scans.
- [MONAILabel: Lung nodule CT Detection with 3D Slicer](https://github.com/Project-MONAI/tutorials/blob/main/monailabel/monailabel_monaibundle_3dslicer_lung_nodule_detection.ipynb): Lung nodule detection task with CT scans.
- **VISTA3D App**:
- Viewer: [OHIF](https://ohif.org/) | [3D Slicer](https://www.slicer.org/) | Datastore: Local/DICOM Web | Task: Multi-organ Segmentation
- [MONAILabel: VISTA3D Quick Start](docs/source/tutorials/vista3d_quickstart.md): Fast setup guide for VISTA3D universal segmentation model.
- [MONAILabel: VISTA3D Complete Tutorial](docs/source/tutorials/vista3d_tutorial.md): Comprehensive tutorial for VISTA3D model setup, interactive prompting, and multi-organ segmentation workflows with 117+ anatomical structures.
- [MONAILabel: VISTA3D Configuration Examples](docs/source/tutorials/vista3d_configurations.md): Sample configurations for different VISTA3D deployment scenarios.
- **Pathology App**:
- Viewer: [QuPath](https://qupath.github.io/) | Datastore: Local | Task: Segmentation
- [MONAILabel: Nuclei Segmentation with QuPath](https://github.com/Project-MONAI/tutorials/blob/main/monailabel/monailabel_pathology_nuclei_segmentation_QuPath.ipynb) Nuclei segmentation with QuPath setup and Nuclick models.
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Table of Contents
whatsnew
installation
quickstart
tutorials
modules
appdeployment
apis
Expand Down
95 changes: 95 additions & 0 deletions docs/source/tutorials.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. comment
Copyright (c) MONAI Consortium
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=========
Tutorials
=========

This section provides comprehensive tutorials for using MONAI Label with advanced models and viewers.

VISTA3D Universal Segmentation
===============================

VISTA3D is a universal foundation model for 3D CT segmentation that can segment 117+ anatomical structures
including organs, bones, vessels, and soft tissues. It supports both automatic and interactive segmentation workflows.

**Quick Start**

For immediate setup and basic usage, see the `VISTA3D Quick Start Guide`_.

**Complete Tutorial**

For comprehensive instructions including advanced configuration, troubleshooting, and clinical workflows,
see the `VISTA3D Complete Tutorial`_.

**Configuration Examples**

For sample configurations covering different deployment scenarios (memory optimization, PACS integration,
multi-model setup, etc.), see the `VISTA3D Configuration Examples`_.

Key Features
------------

- **Universal Segmentation**: Supports 117+ anatomical classes
- **Interactive Prompting**: Point-based and class-based interactive segmentation
- **Multi-Viewer Support**: Works with OHIF and 3D Slicer
- **High Performance**: Optimized for clinical workflows
- **Flexible Deployment**: Local, cloud, and PACS integration options

Supported Viewers
-----------------

VISTA3D integration is available through:

- **OHIF Viewer**: Web-based DICOM viewer with full VISTA3D support
- **3D Slicer**: Desktop application with VISTA3D capabilities

Prerequisites
-------------

- Python 3.8+ with MONAI Label installed
- NVIDIA GPU with 8GB+ VRAM (16GB+ recommended)
- CT data in DICOM or NIfTI format
- Compatible viewer (OHIF or 3D Slicer)

Basic Usage
-----------

1. **Setup**::

# Download bundle app
monailabel apps --download --name monaibundle --output apps

# Start VISTA3D server
monailabel start_server \\
--app apps/monaibundle \\
--studies datasets/ct_volumes \\
--conf models vista3d \\
--conf preload true

2. **Automatic Segmentation**: Load CT volume and run auto-segmentation for 117+ structures

3. **Interactive Prompting**: Use point prompts to refine segmentation of specific anatomy

4. **Class Selection**: Choose anatomical categories (organs, bones, vessels) for targeted segmentation

For detailed instructions, examples, and troubleshooting, refer to the tutorial links above.

Additional Resources
====================

For more MONAI Label tutorials covering other models and use cases, visit the
`MONAI Tutorials Repository <https://github.com/Project-MONAI/tutorials/tree/main/monailabel>`_.

.. _VISTA3D Quick Start Guide: tutorials/vista3d_quickstart.md
.. _VISTA3D Complete Tutorial: tutorials/vista3d_tutorial.md
.. _VISTA3D Configuration Examples: tutorials/vista3d_configurations.md
23 changes: 23 additions & 0 deletions docs/source/tutorials/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# MONAI Label Tutorials

This directory contains comprehensive tutorials for using MONAI Label with various models and viewers.

## Available Tutorials

### VISTA3D Universal Segmentation
- **[VISTA3D Quick Start](vista3d_quickstart.md)** - Get started with VISTA3D in minutes
- **[VISTA3D Complete Tutorial](vista3d_tutorial.md)** - Comprehensive guide for VISTA3D setup and usage
- **[VISTA3D Configuration Examples](vista3d_configurations.md)** - Sample configurations for different deployment scenarios

### Getting Started
1. Start with the [Quick Start Guide](vista3d_quickstart.md) for immediate setup
2. Read the [Complete Tutorial](vista3d_tutorial.md) for detailed instructions
3. Use [Configuration Examples](vista3d_configurations.md) for specific deployment needs

### Prerequisites
- MONAI Label installed
- Compatible viewer (OHIF, 3D Slicer)
- CT data for segmentation
- GPU recommended for optimal performance

For general MONAI Label tutorials, visit the [MONAI Tutorials Repository](https://github.com/Project-MONAI/tutorials/tree/main/monailabel).
187 changes: 187 additions & 0 deletions docs/source/tutorials/vista3d_configurations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# VISTA3D Configuration Examples

This document provides sample configurations for integrating VISTA3D with MONAI Label.

## Basic VISTA3D Server Configuration

### 1. Standard Setup
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf preload true \
--conf skip_trainers true
```

### 2. Memory-Optimized Setup
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf vista3d_patch_size "[64,64,64]" \
--conf vista3d_overlap 0.125 \
--conf vista3d_cpu_fallback true
```

### 3. High-Performance Setup
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf vista3d_patch_size "[128,128,128]" \
--conf vista3d_overlap 0.5 \
--conf preload true \
--conf workers 4
```

## VISTA3D with DICOM Web

### 4. PACS Integration
```bash
monailabel start_server \
--app apps/monaibundle \
--studies "http://pacs.hospital.com/dicom-web" \
--studies_user "username" \
--studies_password "password" \
--conf models vista3d \
--conf preload true
```

## Custom VISTA3D Bundle Configuration

### 5. Custom Bundle Path
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models "vista3d:/path/to/custom/vista3d/bundle" \
--conf vista3d_prompting true
```

## Multi-Model Setup

### 6. VISTA3D with Other Models
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models "vista3d,spleen_ct_segmentation,swin_unetr_btcv_segmentation" \
--conf preload true
```

## VISTA3D with Interactive Features

### 7. Full Interactive Setup
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf vista3d_prompting true \
--conf vista3d_point_prompts true \
--conf vista3d_class_prompts true \
--conf preload true
```

## Development and Testing

### 8. Debug Configuration
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf debug true \
--conf vista3d_cache_transforms false \
--log_level DEBUG
```

### 9. Performance Profiling
```bash
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d \
--conf profile true \
--conf vista3d_profile_inference true
```

## Docker Deployment

### 10. Docker with VISTA3D
```bash
docker run --gpus all --rm -ti \
-p 8000:8000 \
-v /data/ct_volumes:/data/studies \
-v /data/models:/data/models \
projectmonai/monailabel:latest \
monailabel start_server \
--app /opt/monailabel/sample-apps/monaibundle \
--studies /data/studies \
--conf models vista3d \
--conf preload true \
--host 0.0.0.0
```

## Configuration Parameters

| Parameter | Description | Default | Example |
|-----------|-------------|---------|---------|
| `vista3d_patch_size` | Input patch size for inference | `[96,96,96]` | `"[64,64,64]"` |
| `vista3d_overlap` | Sliding window overlap ratio | `0.25` | `0.5` |
| `vista3d_prompting` | Enable interactive prompting | `false` | `true` |
| `vista3d_point_prompts` | Enable point-based prompting | `true` | `false` |
| `vista3d_class_prompts` | Enable class-based prompting | `true` | `false` |
| `vista3d_cpu_fallback` | Use CPU when GPU memory insufficient | `false` | `true` |
| `vista3d_cache_transforms` | Cache preprocessing transforms | `true` | `false` |
| `vista3d_profile_inference` | Profile inference performance | `false` | `true` |

## Environment Variables

```bash
# Set GPU memory fraction
export CUDA_VISIBLE_DEVICES=0
export PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512

# Set cache directories
export MONAI_CACHE_DIR=/data/cache
export VISTA3D_CACHE_DIR=/data/vista3d_cache

# Start server with environment
monailabel start_server \
--app apps/monaibundle \
--studies datasets/ct_volumes \
--conf models vista3d
```

## Troubleshooting Common Configurations

### GPU Memory Issues
```bash
# Reduce memory usage
--conf vista3d_patch_size "[48,48,48]"
--conf vista3d_overlap 0.125
--conf vista3d_cpu_fallback true
```

### Network/Download Issues
```bash
# Use local model cache
--conf zoo_source local
--conf model_path /local/path/to/vista3d

# Use alternative zoo repo
--conf zoo_repo "custom-repo/model-zoo"
```

### Performance Optimization
```bash
# Optimize for speed
--conf vista3d_patch_size "[128,128,128]"
--conf vista3d_overlap 0.5
--conf workers 8
--conf preload true
```
Loading