GeezerVison is showing github.com — fixes typos and update PR template (#903) · Project-MONAI/tutorials@9c40a7b
File treeExpand file treeCollapse file tree Open diff view settings transfer_learning_with_bundle
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/pull_request_template.md -3Lines changed: 0 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,9 +3,6 @@ Fixes # . | 3 | 3 | ### Description | 4 | 4 | A few sentences describing the changes proposed in this pull request. | 5 | 5 |
| 6 | | -### Status | 7 | | -**Ready/Work in progress/Hold** | 8 | | - | 9 | 6 | ### Checks | 10 | 7 | <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> | 11 | 8 | - [ ] Notebook runs automatically `./runner [-p <regex_pattern>]` |
Collapse file Copy file name to clipboardExpand all lines: 3d_registration/paired_lung_ct.ipynb +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 369 | 369 | }, | 370 | 370 | "source": [ | 371 | 371 | "## Check transforms in DataLoader\n", | 372 | | - "Visulize a single batch to check the transforms." | | 372 | + "Visualize a single batch to check the transforms." | 373 | 373 | ] | 374 | 374 | }, | 375 | 375 | { | |
Collapse file Copy file name to clipboardExpand all lines: 3d_segmentation/brats_segmentation_3d.ipynb +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 308 | 308 | "## Quickly load data with DecathlonDataset\n", | 309 | 309 | "\n", | 310 | 310 | "Here we use `DecathlonDataset` to automatically download and extract the dataset.\n", | 311 | | - "It inherits MONAI `CacheDataset`, if you want to use less memory, you can set `cache_num=N` to cache N items for training and use the defaut args to cache all the items for validation, it depends on your memory size." | | 311 | + "It inherits MONAI `CacheDataset`, if you want to use less memory, you can set `cache_num=N` to cache N items for training and use the default args to cache all the items for validation, it depends on your memory size." | 312 | 312 | ] | 313 | 313 | }, | 314 | 314 | { | |
Collapse file Copy file name to clipboardExpand all lines: 3d_segmentation/swin_unetr_brats21_segmentation_3d.ipynb +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | "# 3D Brain Tumor Segmentation with Swin UNETR (BraTS 21 Challenge)\n", | 8 | 8 | "\n", | 9 | 9 | "\n", | 10 | | - "This tutorial uses the [Swin UNETR](https://arxiv.org/pdf/2201.01266.pdf/) [1,2] model for the task of brain tumor segmentation using the [BraTS 21](http://braintumorsegmentation.org/) challenge dataset [3,4,5,6]. Swin UNETR ranked among top-perfoming models in BraTS 21 validation phase. The architecture of Swin UNETR is demonstrated as below\n", | | 10 | + "This tutorial uses the [Swin UNETR](https://arxiv.org/pdf/2201.01266.pdf/) [1,2] model for the task of brain tumor segmentation using the [BraTS 21](http://braintumorsegmentation.org/) challenge dataset [3,4,5,6]. Swin UNETR ranked among top-performing models in BraTS 21 validation phase. The architecture of Swin UNETR is demonstrated as below\n", | 11 | 11 | "\n", | 12 | 12 | "\n", | 13 | 13 | "The following features are included in this tutorial:\n", | | 47 | 47 | "\n", | 48 | 48 | "\n", | 49 | 49 | "\n", | 50 | | - "## Refrences\n", | | 50 | + "## References\n", | 51 | 51 | "\n", | 52 | 52 | "\n", | 53 | 53 | "If you find this tutorial helpful, please consider citing [1] and [2]:\n", | | 57 | 57 | "[2]: Tang, Y., Yang, D., Li, W., Roth, H.R., Landman, B., Xu, D., Nath, V. and Hatamizadeh, A., 2022. Self-supervised pre-training of swin transformers for 3d medical image analysis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 20730-20740).\n", | 58 | 58 | "\n", | 59 | 59 | "\n", | 60 | | - "### BraTS Dataset Refrences\n", | | 60 | + "### BraTS Dataset References\n", | 61 | 61 | "\n", | 62 | 62 | "[3] U.Baid, et al., The RSNA-ASNR-MICCAI BraTS 2021 Benchmark on Brain Tumor Segmentation and Radiogenomic Classification, arXiv:2107.02314, 2021.\n", | 63 | 63 | "\n", | |
Collapse file Copy file name to clipboardExpand all lines: deep_atlas/deep_atlas_tutorial.ipynb +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 91 | 91 | "1. Construct segmentation and registration models.\n", | 92 | 92 | "2. Use the small number of segmentations (perhaps just one!) to pre-train the segmentation model. It's okay if it's not great.\n", | 93 | 93 | "3. Use the segmentation model as a source of weak supervision to help train the registration model.\n", | 94 | | - "4. Use the registration model as a soruce of weak supervision to help train the segmentation model.\n", | | 94 | + "4. Use the registration model as a source of weak supervision to help train the segmentation model.\n", | 95 | 95 | "5. Repeat steps 3 and 4 in alternation, or carry out steps 3 and 4 simultaneously in one joint training loop.\n", | 96 | 96 | "\n", | 97 | 97 | "The DeepAtlas method is fairly generic and does not need to prescribe specific model architectures\n", | | 203 | 203 | "\n", | 204 | 204 | "---\n", | 205 | 205 | "\n", | 206 | | - "Note that we already have a segmentaton for each image. In the case of OASIS-1 data, these segmentations were originally done by [an algorithm](https://pubmed.ncbi.nlm.nih.gov/11293691/).\n", | | 206 | + "Note that we already have a segmentation for each image. In the case of OASIS-1 data, these segmentations were originally done by [an algorithm](https://pubmed.ncbi.nlm.nih.gov/11293691/).\n", | 207 | 207 | "In the case of synthetic data, true segmentations are generated for free by the process that creates the images.\n", | 208 | 208 | "\n", | 209 | 209 | "The situation in which DeepAtlas is interesting is one where we have many unlabled images and just a handful of labels. We will simulate this situation by pretending that only a few of the segmentation labels exist." | | 515 | 515 | ")\n", | 516 | 516 | "\n", | 517 | 517 | "\n", | 518 | | - "# Supress the many warnings related to depracation of the Analyze file format\n", | | 518 | + "# Supress the many warnings related to deprecation of the Analyze file format\n", | 519 | 519 | "# (without this, we would see warnings when the LoadImage transform calls itk to load Analyze files)\n", | 520 | 520 | "itk.ProcessObject.SetGlobalWarningDisplay(False)\n", | 521 | 521 | "\n", | | 1087 | 1087 | "<a id=\"warp_warning\"></a>\n", | 1088 | 1088 | "We will need to be careful about when to use `warp` and when to use `warp_nearest`, especially with segmentation labels. Potential pitfalls:\n", | 1089 | 1089 | "- Using _trilinear interpolation_ to warp a segmentation with one channel containing class labels is a disaster: interpolating among labels would lead to intermediate values that aren't labels!\n", | 1090 | | - "- Using _nearest neighbor inteprolation_ to warp a segmentation results in a reasonable output, but it is not a differentiable operation with respect to the deformation vector field (or, rather, derivatives vanish almost everywhere). This can be problematic for training, depending on what one is trying to do.\n", | | 1090 | + "- Using _nearest neighbor interpolation_ to warp a segmentation results in a reasonable output, but it is not a differentiable operation with respect to the deformation vector field (or, rather, derivatives vanish almost everywhere). This can be problematic for training, depending on what one is trying to do.\n", | 1091 | 1091 | "- Warping a segmentation with `padding_mode=\"zeros\"` can pull in zero vectors, which might not make sense depending on how the segmentation is encoded. This is why we chose `padding_mode=\"border\"`." | 1092 | 1092 | ] | 1093 | 1093 | }, | |
Collapse file Copy file name to clipboardExpand all lines: model_zoo/app_integrate_bundle/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -68,7 +68,7 @@ python ./ensemble.py -h | 68 | 68 | ] | 69 | 69 | } | 70 | 70 | ``` | 71 | | - The data in training will random split into `n_splits` which you can specifiy with `--n_splits xx` | | 71 | + The data in training will random split into `n_splits` which you can specify with `--n_splits xx` | 72 | 72 |
| 73 | 73 | 3. Run the script. Make sure `bundle_root_path` and `data_root_path` is correct. | 74 | 74 |
| |
Collapse file Copy file name to clipboardExpand all lines: model_zoo/app_integrate_bundle/ensemble.py +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -118,19 +118,19 @@ def ensemble_inference(self, device, test_datalist, ensemble='Mean'): | 118 | 118 | bundle_inference_config.update({Const.KEY_INFERENCE_DATASET_DATA: test_datalist}) | 119 | 119 |
| 120 | 120 | # update postprocessing with mean ensemble or vote ensemble | 121 | | - post_tranform = bundle_inference_config.config['postprocessing'] | 122 | | - ensemble_tranform = { | | 121 | + post_transform = bundle_inference_config.config['postprocessing'] | | 122 | + ensemble_transform = { | 123 | 123 | "_target_": f"{ensemble}Ensembled", | 124 | 124 | "keys": ["pred", "pred", "pred", "pred", "pred"], | 125 | 125 | "output_key": "pred" | 126 | 126 | } | 127 | 127 | if ensemble == 'Mean': | 128 | | - post_tranform["transforms"].insert(0, ensemble_tranform) | | 128 | + post_transform["transforms"].insert(0, ensemble_transform) | 129 | 129 | elif ensemble == 'Vote': | 130 | | - post_tranform["transforms"].insert(-1, ensemble_tranform) | | 130 | + post_transform["transforms"].insert(-1, ensemble_transform) | 131 | 131 | else: | 132 | 132 | raise NotImplementedError | 133 | | - bundle_inference_config.update({Const.KEY_INFERENCE_POSTPROCESSING: post_tranform}) | | 133 | + bundle_inference_config.update({Const.KEY_INFERENCE_POSTPROCESSING: post_transform}) | 134 | 134 |
| 135 | 135 | # update network weights | 136 | 136 | _networks = [bundle_inference_config.get_parsed_content("network")] * 5 | |
Collapse file Copy file name to clipboardExpand all lines: model_zoo/transfer_learning_with_bundle/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | # Description | 2 | | -Load the pre-trained weights from a MONAI model-zoo model and execute the transfer-learning in a typical PyTroch training program based on it. | | 2 | +Load the pre-trained weights from a MONAI model-zoo model and execute the transfer-learning in a typical PyTorch training program based on it. | 3 | 3 |
| 4 | 4 | # Overview | 5 | 5 | This tutorial shows how to load a pretrained U-net from MONAI model-zoo and train it on BTCV dataset using pytorch. The pretrained U-net was trained on volumetric (3D) segmentation of CT spleen from MSD dataset. | |
Collapse file Copy file name to clipboardExpand all lines: modules/2d_inference_3d_volume.ipynb +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 149 | 149 | "id": "f2596d86", | 150 | 150 | "metadata": {}, | 151 | 151 | "source": [ | 152 | | - "Note that with `axial_inferer` and `coronal_inferer`, the number of inference iterations is 64 and 256 repectively." | | 152 | + "Note that with `axial_inferer` and `coronal_inferer`, the number of inference iterations is 64 and 256 respectively." | 153 | 153 | ] | 154 | 154 | } | 155 | 155 | ], | |
Collapse file Copy file name to clipboardExpand all lines: modules/2d_slices_from_3d_sampling.ipynb +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 303 | 303 | " [\n", | 304 | 304 | " SqueezeDimd(keys=[\"img\", \"seg\"], dim=-1), # squeeze the last dim\n", | 305 | 305 | " Resized(keys=[\"img\", \"seg\"], spatial_size=[48, 48]),\n", | 306 | | - " # to use crop/pad instead of reszie:\n", | | 306 | + " # to use crop/pad instead of resize:\n", | 307 | 307 | " # ResizeWithPadOrCropd(keys=[\"img\", \"seg\"], spatial_size=[48, 48], mode=\"replicate\"),\n", | 308 | 308 | " ]\n", | 309 | 309 | ")\n", | |
|