Skip to content

Commit

Permalink
unify visualisation
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Brown <[email protected]>
  • Loading branch information
rijobro committed Dec 17, 2020
1 parent 1608b10 commit 88abbe7
Show file tree
Hide file tree
Showing 22 changed files with 535 additions and 404 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"config",
"handlers",
"losses",
"visualize",
"visualise",
"utils",
"inferers",
"optimizers",
Expand Down
10 changes: 5 additions & 5 deletions docs/source/highlights.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The rest of this page provides more details for each module.
* [Optimizers](#optimizers)
* [Network architectures](#network-architectures)
* [Evaluation](#evaluation)
* [Visualization](#visualization)
* [Visualisation](#visualisation)
* [Result writing](#result-writing)
* [Workflows](#workflows)
* [Research](#research)
Expand Down Expand Up @@ -111,7 +111,7 @@ MONAI also provides post-processing transforms for handling the model outputs. C
- Removing segmentation noise based on Connected Component Analysis, as below figure (c).
- Extracting contour of segmentation result, which can be used to map to original image and evaluate the model, as below figure (d) and (e).

After applying the post-processing transforms, it's easier to compute metrics, save model output into files or visualize data in the TensorBoard. [Post transforms tutorial](https://github.com/Project-MONAI/tutorials/blob/master/modules/post_transforms.ipynb) shows an example with several main post transforms.
After applying the post-processing transforms, it's easier to compute metrics, save model output into files or visualise data in the TensorBoard. [Post transforms tutorial](https://github.com/Project-MONAI/tutorials/blob/master/modules/post_transforms.ipynb) shows an example with several main post transforms.
![image](../images/post_transforms.png)

### 9. Integrate third-party transforms
Expand Down Expand Up @@ -237,10 +237,10 @@ Various useful evaluation metrics have been used to measure the quality of medic

For example, `Mean Dice` score can be used for segmentation tasks, and the area under the ROC curve(`ROCAUC`) for classification tasks. We continue to integrate more options.

## Visualization
Beyond the simple point and curve plotting, MONAI provides intuitive interfaces to visualize multidimensional data as GIF animations in TensorBoard. This could provide a quick qualitative assessment of the model by visualizing, for example, the volumetric inputs, segmentation maps, and intermediate feature maps. A runnable example with visualization is available at [UNet training example](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/torch/unet_training_dict.py).
## Visualisation
Beyond the simple point and curve plotting, MONAI provides intuitive interfaces to visualise multidimensional data as GIF animations in TensorBoard. This could provide a quick qualitative assessment of the model by visualising, for example, the volumetric inputs, segmentation maps, and intermediate feature maps. A runnable example with visualisation is available at [UNet training example](https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/torch/unet_training_dict.py).

And to visualize the class activation mapping for a trained classification model, MONAI provides CAM, GradCAM, GradCAM++ APIs for both 2D and 3D models:
And to visualise the class activation mapping for a trained classification model, MONAI provides CAM, GradCAM, GradCAM++ APIs for both 2D and 3D models:

![image](../images/cam.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Technical documentation is available at `docs.monai.io <https://docs.monai.io>`_
engines
inferers
handlers
visualize
visualise
utils

.. toctree::
Expand Down
4 changes: 0 additions & 4 deletions docs/source/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ Metrics

.. autoclass:: SurfaceDistanceMetric
:members:

`Occlusion sensitivity`
-----------------------
.. autofunction:: compute_occlusion_sensitivity
10 changes: 5 additions & 5 deletions docs/source/visualize.rst → docs/source/visualise.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
:github_url: https://github.com/Project-MONAI/MONAI

.. _visualize:
.. _visualise:

Visualizations
Visualisations
==============

.. currentmodule:: monai.visualize
.. currentmodule:: monai.visualise

Tensorboard visuals
-------------------

.. automodule:: monai.visualize.img2tensorboard
.. automodule:: monai.visualise.img2tensorboard
:members:

Class activation map
--------------------

.. automodule:: monai.visualize.class_activation_maps
.. automodule:: monai.visualise.class_activation_maps
:members:
2 changes: 1 addition & 1 deletion monai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
* **utils**: generic utilities intended to be implemented in pure Python or using Numpy,
and not with Pytorch, such as namespace aliasing, auto module loading.

* **visualize**: utilities for data visualization.
* **visualise**: utilities for data visualisation.
2 changes: 1 addition & 1 deletion monai/handlers/tensorboard_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import torch

from monai.utils import exact_version, is_scalar, optional_import
from monai.visualize import plot_2d_or_3d_image
from monai.visualise import plot_2d_or_3d_image

Events, _ = optional_import("ignite.engine", "0.4.2", exact_version, "Events")
if TYPE_CHECKING:
Expand Down
1 change: 0 additions & 1 deletion monai/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from .confusion_matrix import ConfusionMatrixMetric, compute_confusion_matrix_metric, get_confusion_matrix
from .hausdorff_distance import *
from .meandice import DiceMetric, compute_meandice
from .occlusion_sensitivity import compute_occlusion_sensitivity
from .rocauc import compute_roc_auc
from .surface_distance import SurfaceDistanceMetric, compute_average_surface_distance
from .utils import *
225 changes: 0 additions & 225 deletions monai/metrics/occlusion_sensitivity.py

This file was deleted.

2 changes: 2 additions & 0 deletions monai/visualize/__init__.py → monai/visualise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .visualiser import ModelWithHooks, NetVisualiser, default_normalizer, default_upsampler # isort:skip
from .class_activation_maps import *
from .img2tensorboard import *
from .occlusion_sensitivity import OcclusionSensitivity
Loading

0 comments on commit 88abbe7

Please sign in to comment.