Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: [self-hosted, linux, x64, common]
strategy:
matrix:
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, latest]
pytorch-version: [1.7.1, 1.8.1, 1.9.1, 1.10.2, latest]
steps:
- uses: actions/checkout@v2
- name: Install the dependencies
Expand All @@ -24,15 +24,15 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch torchvision
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0 torchvision==0.7.0
python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1 torchvision==0.8.2
python -m pip install torch==1.7.1 torchvision==0.8.2 --extra-index-url https://download.pytorch.org/whl/cu113
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
python -m pip install torch==1.8.1 torchvision==0.9.1
python -m pip install torch==1.8.1 torchvision==0.9.1 --extra-index-url https://download.pytorch.org/whl/cu113
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
python -m pip install torch==1.9.1 torchvision==0.10.1
python -m pip install torch==1.9.1 torchvision==0.10.1 --extra-index-url https://download.pytorch.org/whl/cu113
elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then
python -m pip install torch==1.10.2 torchvision==0.11.3 --extra-index-url https://download.pytorch.org/whl/cu113
fi
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
pytorch: "-h"
base: "nvcr.io/nvidia/pytorch:22.03-py3"
- environment: PT110+CUDA102
pytorch: "torch==1.10.1 torchvision==0.11.2"
pytorch: "torch==1.10.2 torchvision==0.11.3"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT111+CUDA102
pytorch: "torch==1.11.0 torchvision==0.12.0"
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/pythonapp-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, 1.10.1, latest]
pytorch-version: [1.7.1, 1.8.1, 1.9.1, 1.10.2, latest]
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -148,16 +148,14 @@ jobs:
# min. requirements
if [ ${{ matrix.pytorch-version }} == "latest" ]; then
python -m pip install torch
elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then
python -m pip install torch==1.6.0
elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then
python -m pip install torch==1.7.1
elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then
python -m pip install torch==1.8.1
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
python -m pip install torch==1.9.1
elif [ ${{ matrix.pytorch-version }} == "1.10.1" ]; then
python -m pip install torch==1.10.1
elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then
python -m pip install torch==1.10.2
fi
python -m pip install -r requirements-min.txt
python -m pip list
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
# install the latest pytorch for testing
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
# fresh torch installation according to pyproject.toml
python -m pip install torch>=1.6 torchvision
python -m pip install torch>=1.7 torchvision
- name: Check packages
run: |
pip uninstall monai
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down
12 changes: 8 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ title: "MONAI: Medical Open Network for AI"
abstract: "AI Toolkit for Healthcare Imaging"
authors:
- name: "MONAI Consortium"
date-released: 2020-03-28
version: "0.6.0"
doi: "10.5281/zenodo.4323058"
date-released: 2022-02-16
version: "0.8.1"
identifiers:
- description: "This DOI represents all versions of MONAI, and will always resolve to the latest one."
type: doi
value: "10.5281/zenodo.4323058"
license: "Apache-2.0"
repository-code: "https://github.com/Project-MONAI/MONAI"
cff-version: "1.1.0"
url: "https://monai.io"
cff-version: "1.2.0"
message: "If you use this software, please cite it using these metadata."
...
28 changes: 23 additions & 5 deletions docs/source/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,23 @@ Patch-based dataset
.. autoclass:: GridPatchDataset
:members:

`PatchIter`
~~~~~~~~~~~
.. autoclass:: PatchIter
:members:

`PatchDataset`
~~~~~~~~~~~~~~
.. autoclass:: PatchDataset
:members:

`PatchIter`
"""""""""""
.. autoclass:: PatchIter
:members:
:special-members: __call__

`PatchIterd`
""""""""""""
.. autoclass:: PatchIterd
:members:
:special-members: __call__

Image reader
------------

Expand Down Expand Up @@ -264,3 +271,14 @@ ThreadDataLoader
TestTimeAugmentation
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: monai.data.TestTimeAugmentation


Meta Object
-----------
.. automodule:: monai.data.meta_obj
:members:

MetaTensor
----------
.. autoclass:: monai.data.MetaTensor
:members:
26 changes: 22 additions & 4 deletions docs/source/mb_specification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ This file contains the metadata information relating to the model, including wha

Tensor format specifiers are used to define input and output tensors and their meanings, and must be a dictionary containing at least these keys:

* **type**: what sort of data the tensor represents: "image", "label", etc.
* **format**: what format of information is stored: "magnitude", "hounsfield", "kspace", "segmentation", "multiclass", etc.
* **type**: what sort of data the tensor represents: "image" for any spatial regular data whether an actual image or just data with that sort of shape, "series" for (time-) sequences of values such as signals, "tuples" for a series of items defined by a known number of values such as N-sized points in ND space, "probabilities" for a set of probabilities such as classifier output, this useful for interpreting what the dimensions and shape of the data represent and allow users to guess how to plot the data
* **format**: what format of information is stored, see below for list of known formats
* **modality**: describes the modality, protocol type, sort of capturing technology, or other property of the data not described by either it's type or format, known modalities are "MR", "CT", "US", "EKG", but can include any custom types or protocol types (eg. "T1"), default value is "n/a"
* **num_channels**: number of channels the tensor has, assumed channel dimension first
* **spatial_shape**: shape of the spatial dimensions of the form "[H]", "[H, W]", or "[H, W, D]", see below for possible values of H, W, and D
* **dtype**: data type of tensor, eg. "float32", "int32"
Expand All @@ -78,6 +79,22 @@ Optional keys:
* **data_type**: type of source data used for training/validation.
* **references**: list of published referenced relating to the model.

The format for tensors used as inputs and outputs can be used to specify semantic meaning of these values, and later is used by software handling bundles to determine how to process and interpret this data. There are various types of image data that MONAI is uses, and other data types such as point clouds, dictionary sequences, time signals, and others. The following list is provided as a set of supported definitions of what a tensor "format" is but is not exhaustive and users can provide their own which would be left up to the model users to interpret:

* **magnitude**: ND field of continuous magnitude values with one or more channels, eg. MR T1 image having 1 channel or natural RGB image with 3 channels
* **hounsfield**: ND field of semi-categorical values given in Hounsfield, eg. CT image
* **kspace**: 2D/3D fourier transform image associated with MR imaging
* **raw**: ND field of values considered unprocessed from an image acquisition device, eg. directly from a MR scanner without reconstruction or other processing
* **labels**: ND categorical image with N one-hot channels for N-class segmentation/labels, the "channel_def" states in plain language what the interpretation of each channel is, for each pixel/voxel the predicted label is the index of the largest channel value
* **classes**: ND categorical image with N channels for N-class classes, the "channel_def" states in plain language what the interpretation of each channel is, this permits multi-class labeling as the channels need not be one-hot encoded
* **segmentation**: ND categorical image with one channel assigning each pixel/voxel to a label described in "channel_def"
* **points**: list of points/nodes/coordinates/vertices/vectors in ND space, so having a shape of [I, N] for I points with N dimensions
* **normals**: list of vectors (possible of unit length) in ND space, so having a shape of [I, N] for I vectors with N dimensions
* **indices**: list of indices into a vertices array and/or other array representing a set of shapes, so having a shape of [I, N] for I shapes defined by N values
* **sequence**: time-related sequence of values having one or more channels, such as a signal or dictionary lookup sentence, so having a shape of [C, N] for C channels of data at N time points.
* **latent**: ND tensor of data from the latent space from some layer of a network
* **gradient**: ND tensor of gradients from some layer of a network

Spatial shape definition can be complex for models accepting inputs of varying shapes, especially if there are specific conditions on what those shapes can be. Shapes are specified as lists of either positive integers for fixed sizes or strings containing expressions defining the condition a size depends on. This can be "*" to mean any size, or use an expression with Python mathematical operators and one character variables to represent dependence on an unknown quantity. For example, "2**n" represents a size which must be a power of 2, "2**n*m" must be a multiple of a power of 2. Variables are shared between dimension expressions, so a spatial shape of `["2**n", "2**n"]` states that the dimensions must be the same powers of 2 given by `n`.

A JSON schema for this file can be found at https://github.com/Project-MONAI/MONAI/blob/3049e280f2424962bb2a69261389fcc0b98e0036/monai/apps/mmars/schema/metadata.json
Expand Down Expand Up @@ -118,6 +135,7 @@ An example JSON metadata file:
"image": {
"type": "image",
"format": "magnitude",
"modality": "MR",
"num_channels": 1,
"spatial_shape": [160, 160, 160],
"dtype": "float32",
Expand All @@ -129,11 +147,11 @@ An example JSON metadata file:
"outputs":{
"pred": {
"type": "image",
"format": "segmentation",
"format": "labels",
"num_channels": 2,
"spatial_shape": [160, 160, 160],
"dtype": "float32",
"value_range": [0, 1],
"value_range": [],
"is_patch_data": false,
"channel_def": {0: "background", 1: "spleen"}
}
Expand Down
7 changes: 7 additions & 0 deletions docs/source/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ Metrics
.. autoclass:: SurfaceDistanceMetric
:members:

`Surface dice`
--------------
.. autofunction:: compute_surface_dice

.. autoclass:: SurfaceDiceMetric
:members:

`Mean squared error`
--------------------
.. autoclass:: MSEMetric
Expand Down
27 changes: 27 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,12 @@ Utility
:members:
:special-members: __call__

`SplitDim`
""""""""""
.. autoclass:: SplitDim
:members:
:special-members: __call__

`SplitChannel`
""""""""""""""
.. autoclass:: SplitChannel
Expand Down Expand Up @@ -1638,6 +1644,12 @@ Utility (Dict)
:members:
:special-members: __call__

`SplitDimd`
"""""""""""
.. autoclass:: SplitDimd
:members:
:special-members: __call__

`SplitChanneld`
"""""""""""""""
.. autoclass:: SplitChanneld
Expand Down Expand Up @@ -1830,6 +1842,21 @@ Utility (Dict)
:members:
:special-members: __call__

MetaTensor
^^^^^^^^^^

`ToMetaTensord`
"""""""""""""""
.. autoclass:: ToMetaTensord
:members:
:special-members: __call__

`FromMetaTensord`
"""""""""""""""""
.. autoclass:: FromMetaTensord
:members:
:special-members: __call__

Transform Adaptors
------------------
.. automodule:: monai.transforms.adaptors
Expand Down
Loading