Add SwinUNETR notebook and utilities for BraTS 2024 #418
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces a new Jupyter Notebook (
SwinUNETR_BraTS2024.ipynb
) and associated utility scripts to adapt the SwinUNETR model for use with the BraTS 2024 dataset.Key components included:
SwinUNETR/BRATS24/SwinUNETR_BraTS2024.ipynb
: The main notebook containing cells for dataset download (via Kaggle Hub), configuration, data loading, model initialization (SwinUNETR), and the training/validation loop.SwinUNETR/BRATS24/utils/data_utils_brats24.py
: Contains data loading and preprocessing functions, adapted from the BraTS 2021 version. Includesget_loader
and a modifieddatafold_read
to handle a flexible JSON structure.SwinUNETR/BRATS24/utils/trainer_brats24.py
: Contains the training and validation epoch logic (run_training
,train_epoch
,val_epoch
), adapted from the BraTS 2021 version.SwinUNETR/BRATS24/generate_brats24_json.py
: A Python script to help you generate thebrats24_folds.json
file needed for defining dataset splits. This script requires you to modify it based on the actual downloaded BraTS 2024 dataset structure.SwinUNETR/BRATS24/jsons/
: Directory to store thebrats24_folds.json
file.What you need to do:
generate_brats24_json.py
to create the dataset JSON file.args.data_dir
and other relevant parameters in the notebook.data_utils_brats24.py
(especiallyConvertToMultiChannelBasedOnBratsClassesd
) for BraTS 2024 labels.