|
11 | 11 | "The goal is to demonstrate MONAI's class activation mapping functions for visualising the classification models.\n", |
12 | 12 | "\n", |
13 | 13 | "For the demo data:\n", |
14 | | - "- Please see the `bbox_gen.py` script for generating the patch classification data from MSD task06_lung (available via `monai.apps.DecathlonDataset`).\n", |
| 14 | + "- Please see the `bbox_gen.py` script for generating the patch classification data from MSD task06_lung (available via `monai.apps.DecathlonDataset`);\n", |
15 | 15 | "- Alternatively, the patch dataset (~130MB) is available for direct downloading at: https://drive.google.com/drive/folders/1pQdzdkkC9c2GOblLgpGlG3vxsSK9NtDx\n", |
16 | 16 | "\n", |
17 | 17 | "[](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/modules/interpretability/class_lung_lesion.ipynb)" |
|
592 | 592 | "\n", |
593 | 593 | "# For occlusion sensitivity, inference must be run many times. Hence, we can use a\n", |
594 | 594 | "# bounding box to limit it to a 2D plane of interest (z=the_slice) where each of\n", |
595 | | - "# the arguments are the min and max for each of the dimensions (in this case CHWD).\n", |
| 595 | + "# the arguments are the min and max for each of the spatial dimensions (in this case HWD).\n", |
596 | 596 | "the_slice = train_ds[0][\"image\"].shape[-1] // 2\n", |
597 | | - "occ_sens_b_box = [-1, -1, -1, -1, -1, -1, the_slice, the_slice]" |
| 597 | + "occ_sens_b_box = [-1, -1, -1, -1, the_slice-1, the_slice]" |
598 | 598 | ] |
599 | 599 | }, |
600 | 600 | { |
|
666 | 666 | "\n", |
667 | 667 | " # run occlusion\n", |
668 | 668 | " occ_result, _ = occ_sens(x=image, b_box=occ_sens_b_box)\n", |
669 | | - " occ_result = occ_result[..., pred_label]\n", |
| 669 | + " occ_result = occ_result[0, pred_label][None, None, ..., -1]\n", |
670 | 670 | "\n", |
671 | 671 | " for row, (im, title) in enumerate(\n", |
672 | 672 | " zip(\n", |
|
762 | 762 | "name": "python", |
763 | 763 | "nbconvert_exporter": "python", |
764 | 764 | "pygments_lexer": "ipython3", |
765 | | - "version": "3.9.7" |
| 765 | + "version": "3.8.12" |
766 | 766 | } |
767 | 767 | }, |
768 | 768 | "nbformat": 4, |
|
0 commit comments