Skip to content

Commit

Permalink
update docs and minor fixes (#6593)
Browse files Browse the repository at this point in the history
part of #6151 
fixes #6556
fixes #6594


### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
wyli and pre-commit-ci[bot] authored Jun 8, 2023
1 parent cc90d74 commit c33f1ba
Show file tree
Hide file tree
Showing 27 changed files with 141 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/weekly-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
export YEAR_WEEK=$(date +'%y%U')
echo "Year week for tag is ${YEAR_WEEK}"
if ! [[ $YEAR_WEEK =~ ^[0-9]{4}$ ]] ; then echo "Wrong 'year week' format. Should be 4 digits."; exit 1 ; fi
git tag "1.2.dev${YEAR_WEEK}"
git tag "1.3.dev${YEAR_WEEK}"
git log -1
git tag --list
python setup.py sdist bdist_wheel
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/build/
docs/source/_gen
_build/

# PyBuilder
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [1.2.0] - 2023-06-06
## [1.2.0] - 2023-06-08
### Added
* Various Auto3DSeg enhancements and integration tests including multi-node multi-GPU optimization, major usability improvements
* TensorRT and ONNX support for `monai.bundle` API and the relevant models
Expand Down Expand Up @@ -110,6 +110,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
* `resample=True`; `resample=False` will be the new default in `SaveImage`
* `random_size=True`; `random_size=False` will be the new default for the random cropping transforms
* `image_only=False`; `image_only=True` will be the new default in `LoadImage`
* `AddChannel` and `AsChannelFirst` in favor of `EnsureChannelFirst`
### Removed
* Deprecated APIs since v0.9, including WSIReader from `monai.apps`, `NiftiSaver` and `PNGSaver` from `monai.data`
* Support for PyTorch 1.8
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ title: "MONAI: Medical Open Network for AI"
abstract: "AI Toolkit for Healthcare Imaging"
authors:
- name: "MONAI Consortium"
date-released: 2022-12-19
version: "1.1.0"
date-released: 2023-06-08
version: "1.2.0"
identifiers:
- description: "This DOI represents all versions of MONAI, and will always resolve to the latest one."
type: doi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Its ambitions are:
- compositional & portable APIs for ease of integration in existing workflows;
- domain-specific implementations for networks, losses, evaluation metrics and more;
- customizable design for varying user expertise;
- multi-GPU data parallelism support.
- multi-GPU multi-node data parallelism support.


## Installation
Expand Down
1 change: 1 addition & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ help:

clean:
rm -rf build/
rm -rf source/_gen
2 changes: 1 addition & 1 deletion docs/source/apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ FastMRIReader
~~~~~~~~~~~~~
.. autofunction:: monai.apps.reconstruction.complex_utils.complex_conj

`auto3dseg`
`Auto3DSeg`
-----------
.. automodule:: monai.apps.auto3dseg
:members:
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def generate_apidocs(*args):
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"sphinx_autodoc_typehints",
]

Expand Down Expand Up @@ -114,7 +115,7 @@ def generate_apidocs(*args):
{"name": "Twitter", "url": "https://twitter.com/projectmonai", "icon": "fab fa-twitter-square"},
],
"collapse_navigation": True,
"navigation_depth": 3,
"navigation_depth": 1,
"show_toc_level": 1,
"footer_start": ["copyright"],
"navbar_align": "content",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Features
- compositional & portable APIs for ease of integration in existing workflows;
- domain-specific implementations for networks, losses, evaluation metrics and more;
- customizable design for varying user expertise;
- multi-GPU data parallelism support.
- multi-GPU multi-node data parallelism support.


Getting started
Expand Down
7 changes: 7 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2233,3 +2233,10 @@ Utilities

.. automodule:: monai.transforms.utils_pytorch_numpy_unification
:members:

By Categories
-------------
.. toctree::
:maxdepth: 1

transforms_idx
104 changes: 104 additions & 0 deletions docs/source/transforms_idx.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.. _transforms_idx:

.. currentmodule:: monai.transforms

Crop and pad
^^^^^^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

croppad.array
croppad.dictionary
croppad.batch

Spatial
^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

spatial.array
spatial.dictionary


Intensity
^^^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

intensity.array
intensity.dictionary

IO
^^

.. autosummary::
:toctree: _gen
:nosignatures:

io.array
io.dictionary

Lazy
^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

lazy.array
lazy.dictionary
lazy.utils

MetaTensor utilities
^^^^^^^^^^^^^^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

meta_utility.dictionary

Post-processing
^^^^^^^^^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

post.array
post.dictionary

Signal
^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

signal.array

Smooth field
^^^^^^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

smooth_field.array
smooth_field.dictionary

Utility
^^^^^^^

.. autosummary::
:toctree: _gen
:nosignatures:

utility.array
utility.dictionary
2 changes: 1 addition & 1 deletion monai/apps/auto3dseg/bundle_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def generate(
parameters for each bundleAlgo based on gpus. Custom parameters are obtained through dummy
training to simulate the actual model training process and hyperparameter optimization (HPO)
experiments.
gpu_customization_specs (optinal): the dictionary to enable users overwrite the HPO settings. user can
gpu_customization_specs: the dictionary to enable users overwrite the HPO settings. user can
overwrite part of variables as follows or all of them. The structure is as follows.
allow_skip: a switch to determine if some Algo in the default templates can be skipped based on the
analysis on the dataset from Auto3DSeg DataAnalyzer.
Expand Down
4 changes: 2 additions & 2 deletions monai/apps/auto3dseg/ensemble_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __call__(self, pred_param: dict | None = None) -> list:
only make prediction on the infer_files[file_slices].
- ``"mode"``: ensemble mode. Currently "mean" and "vote" (majority voting) schemes are supported.
- ``"image_save_func"``: a dictionary used to instantiate the ``SaveImage`` transform. When specified,
the ensemble prediction will save the prediciton files, instead of keeping the files in the memory.
the ensemble prediction will save the prediction files, instead of keeping the files in the memory.
Example: `{"_target_": "SaveImage", "output_dir": "./"}`
- ``"sigmoid"``: use the sigmoid function (e.g. x > 0.5) to convert the prediction probability map
to the label class prediction, otherwise argmax(x) is used.
Expand Down Expand Up @@ -552,7 +552,7 @@ def set_num_fold(self, num_fold: int = 5) -> None:
self.num_fold = num_fold

def ensemble(self):
if self.mgpu: # torch.cuda.device_count() is not used because env is not set by autorruner
if self.mgpu: # torch.cuda.device_count() is not used because env is not set by autorunner
# init multiprocessing and update infer_files
dist.init_process_group(backend="nccl", init_method="env://")
self.world_size = dist.get_world_size()
Expand Down
2 changes: 1 addition & 1 deletion monai/apps/pathology/handlers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def from_engine_hovernet(keys: KeysCollection, nested_key: str) -> Callable[[Any
Since the output of HoVerNet is a dictionary, this function is to extend `monai.handlers.from_engine`
to work with HoVerNet.
If data is a list of nestes dictionaries after decollating, extract nested value with expected keys and
If data is a list of nested dictionaries after decollating, extract nested value with expected keys and
construct lists respectively, for example,
if data is `[{"A": {"C": 1, "D": 2}, "B": {"C": 2, "D": 2}}, {"A": {"C": 3, "D": 2}, "B": {"C": 4, "D": 2}}]`,
from_engine_hovernet(["A", "B"], "C"): `([1, 3], [2, 4])`.
Expand Down
2 changes: 1 addition & 1 deletion monai/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def __init__(
hash_transform: a callable to compute hash from the transform information when caching.
This may reduce errors due to transforms changing during experiments. Default to None (no hash).
Other options are `pickle_hashing` and `json_hashing` functions from `monai.data.utils`.
reset_ops_id: whether to set `TraceKeys.ID` to ``Tracekys.NONE``, defaults to ``True``.
reset_ops_id: whether to set `TraceKeys.ID` to ``Tracekeys.NONE``, defaults to ``True``.
When this is enabled, the traced transform instance IDs will be removed from the cached MetaTensors.
This is useful for skipping the transform instance checks when inverting applied operations
using the cached content and with re-created transform instances.
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/croppad/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for crop and pad operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for crop and pad operations.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/croppad/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for crop and pad operations acting on batches of data
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for crop and pad operations acting on batches of data.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/croppad/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "functional" transforms for spatial operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "functional" transforms for spatial operations.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/intensity/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for intensity adjustment
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for intensity adjustment.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/io/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for IO functions
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for IO functions.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/post/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for the model output tensors
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for the model output tensors.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/signal/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of transforms for signal operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of transforms for signal operations.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/spatial/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for spatial operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for spatial operations.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/spatial/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "functional" transforms for spatial operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "functional" transforms for spatial operations.
"""

from __future__ import annotations
Expand Down
3 changes: 1 addition & 2 deletions monai/transforms/utility/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
A collection of "vanilla" transforms for utility functions
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
A collection of "vanilla" transforms for utility functions.
"""

from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion monai/transforms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ def print_table_column(name, torch, numpy, color=Colors.none):
print_color(f"Number transforms allowing both torch and numpy: {n_t_or_np}", Colors.green)
print_color(f"Number of TorchTransform: {n_t}", Colors.green)
print_color(f"Number of NumpyTransform: {n_np}", Colors.yellow)
print_color(f"Number of uncategorised: {n_uncategorized}", Colors.red)
print_color(f"Number of uncategorized: {n_uncategorized}", Colors.red)


def convert_pad_mode(dst: NdarrayOrTensor, mode: str | None):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration_workflows_gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_training_test(root_dir, device="cuda:0"):
train_transforms = Compose(
[
LoadImaged(keys=["reals"]),
EnsureChannelFirstd(keys=["reals"]),
EnsureChannelFirstd(keys=["reals"], channel_dim=-1),
ScaleIntensityd(keys=["reals"]),
RandFlipd(keys=["reals"], prob=0.5),
]
Expand Down

0 comments on commit c33f1ba

Please sign in to comment.