Skip to content

Conversation

sarunsarun
Copy link

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. Includes get_loader and a modified datafold_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 the brats24_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 the brats24_folds.json file.

What you need to do:

  1. Run the initial cells of the notebook to download the dataset and identify its path and structure.
  2. Update and run generate_brats24_json.py to create the dataset JSON file.
  3. Configure args.data_dir and other relevant parameters in the notebook.
  4. Verify and potentially adapt MONAI transforms in data_utils_brats24.py (especially ConvertToMultiChannelBasedOnBratsClassesd) for BraTS 2024 labels.
  5. Execute the notebook to train the model.

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.
  Includes `get_loader` and a modified `datafold_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 the `brats24_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 the `brats24_folds.json` file.

What you need to do:
1. Run the initial cells of the notebook to download the dataset and identify its path and structure.
2. Update and run `generate_brats24_json.py` to create the dataset JSON file.
3. Configure `args.data_dir` and other relevant parameters in the notebook.
4. Verify and potentially adapt MONAI transforms in `data_utils_brats24.py`
   (especially `ConvertToMultiChannelBasedOnBratsClassesd`) for BraTS 2024 labels.
5. Execute the notebook to train the model.
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant