Skip to content

Commit

Permalink
Merge branch 'dev' into mednext
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoLiu authored Nov 11, 2024
2 parents efe93b2 + 0bb20a8 commit 90f39e4
Show file tree
Hide file tree
Showing 82 changed files with 515 additions and 173 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/blossom-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
(
github.actor == 'Nic-Ma' ||
github.actor == 'wyli' ||
github.actor == 'pxLi' ||
github.actor == 'YanxuanLiu' ||
github.actor == 'wendell-hom' ||
github.actor == 'KumoLiu'
)
steps:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- "PT110+CUDA113"
- "PT113+CUDA118"
- "PT210+CUDA121"
- "PTLATEST+CUDA124"
- "PT240+CUDA126"
- "PTLATEST+CUDA126"
include:
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
- environment: PT110+CUDA113
Expand All @@ -28,9 +29,12 @@ jobs:
- environment: PT210+CUDA121
pytorch: "pytorch==2.1.0 torchvision==0.16.0 --extra-index-url https://download.pytorch.org/whl/cu121"
base: "nvcr.io/nvidia/pytorch:23.08-py3" # CUDA 12.1
- environment: PTLATEST+CUDA124
- environment: PT240+CUDA126
pytorch: "pytorch==2.4.0 torchvision==0.19.0 --extra-index-url https://download.pytorch.org/whl/cu121"
base: "nvcr.io/nvidia/pytorch:24.08-py3" # CUDA 12.6
- environment: PTLATEST+CUDA126
pytorch: "-U torch torchvision --extra-index-url https://download.pytorch.org/whl/cu121"
base: "nvcr.io/nvidia/pytorch:24.08-py3" # CUDA 12.4
base: "nvcr.io/nvidia/pytorch:24.10-py3" # CUDA 12.6
container:
image: ${{ matrix.base }}
options: "--gpus all"
Expand Down Expand Up @@ -80,7 +84,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:23.08", "pytorch:24.08"]
container: ["pytorch:23.08", "pytorch:24.08", "pytorch:24.10"]
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -129,7 +133,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
strategy:
matrix:
container: ["pytorch:24.08"]
container: ["pytorch:24.10"]
container:
image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image
options: "--gpus all"
Expand Down Expand Up @@ -233,7 +237,7 @@ jobs:
if: github.repository == 'Project-MONAI/MONAI'
needs: cron-gpu # so that monai itself is verified first
container:
image: nvcr.io/nvidia/pytorch:24.08-py3 # testing with the latest pytorch base image
image: nvcr.io/nvidia/pytorch:24.10-py3 # testing with the latest pytorch base image
options: "--gpus all --ipc=host"
runs-on: [self-hosted, linux, x64, integration]
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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.4.dev${YEAR_WEEK}"
git tag "1.5.dev${YEAR_WEEK}"
git log -1
git tag --list
python setup.py sdist bdist_wheel
Expand Down
23 changes: 10 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -26,33 +26,30 @@ repos:
args: ['--autofix', '--no-sort-keys', '--indent=4']
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.3.5
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]
name: Upgrade code excluding monai networks
args: [--py39-plus, --keep-runtime-typing]
name: Upgrade code with exceptions
exclude: |
(?x)(
^versioneer.py|
^monai/_version.py|
^monai/networks/| # no PEP 604 for torchscript tensorrt
^monai/losses/ # no PEP 604 for torchscript tensorrt
^monai/networks/| # avoid typing rewrites
^monai/apps/detection/utils/anchor_utils.py| # avoid typing rewrites
^tests/test_compute_panoptic_quality.py # avoid typing rewrites
)
- id: pyupgrade
args: [--py37-plus, --keep-runtime-typing]
name: Upgrade monai networks
files: (?x)(^monai/networks/)
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
rev: v1.5.0
hooks:
- id: yesqa
name: Unused noqa
Expand Down
95 changes: 94 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,98 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [1.4.0] - 2024-10-17
## What's Changed
### Added
* Implemented Conjugate Gradient Solver to generate confidence maps. (#7876)
* Added norm parameter to `ResNet` (#7752, #7805)
* Introduced alpha parameter to `DiceFocalLoss` for improved flexibility (#7841)
* Integrated Tailored ControlNet Implementations (#7875)
* Integrated Tailored Auto-Encoder Model (#7861)
* Integrated Tailored Diffusion U-Net Model (7867)
* Added Maisi morphological functions (#7893)
* Added support for downloading bundles from NGC private registry (#7907, #7929, #8076)
* Integrated generative refactor into the core (#7886, #7962)
* Made `ViT` and `UNETR` models compatible with TorchScript (#7937)
* Implemented post-download checks for MONAI bundles and compatibility warnings (#7938)
* Added NGC prefix argument when downloading bundles (#7974)
* Added flash attention support in the attention block for improved performance (#7977)
* Enhanced `MLPBlock` for compatibility with VISTA-3D (#7995)
* Added support for Neighbor-Aware Calibration Loss (NACL) for calibrated models in segmentation tasks (#7819)
* Added label_smoothing parameter to `DiceCELoss` for enhanced model calibration (#8000)
* Add `include_fc` and `use_combined_linear` argument in the `SABlock` (#7996)
* Added utilities, networks, and an inferer specific to VISTA-3D (#7999, #7987, #8047, #8059, #8021)
* Integrated a new network, `CellSamWrapper`, for cell-based applications (#7981)
* Introduced `WriteFileMapping` transform to map between input image paths and their corresponding output paths (#7769)
* Added `TrtHandler` to accelerate models using TensorRT (#7990, #8064)
* Added box and points conversion transforms for more flexible spatial manipulation (#8053)
* Enhanced `RandSimulateLowResolutiond` transform with deterministic support (#8057)
* Added a contiguous argument to the `Fourier` class to facilitate contiguous tensor outputs (#7969)
* Allowed `ApplyTransformToPointsd` to receive a sequence of reference keys for more versatile point manipulation (#8063)
* Made `MetaTensor` an optional print in `DataStats` and `DataStatsd` for more concise logging (#7814)
#### misc.
* Refactored Dataset to utilize Compose for handling transforms. (#7784)
* Combined `map_classes_to_indices` and `generate_label_classes_crop_centers` into a unified function (#7712)
* Introduced metadata schema directly into the codebase for improved structure and validation (#7409)
* Renamed `optional_packages_version` to `required_packages_version` for clearer package dependency management. (#7253)
* Replaced `pkg_resources` with the more modern packaging module for package handling (#7953)
* Refactored MAISI-related networks to align with the new generative components (#7989, #7993, #8005)
* Added a badge displaying monthly download statistics to enhance project visibility (#7891)
### Fixed
#### transforms
* Ensured deterministic behavior in `MixUp`, `CutMix`, and `CutOut` transforms (#7813)
* Applied a minor correction to `AsDiscrete` transform (#7984)
* Fixed handling of integer weightmaps in `RandomWeightedCrop` (#8097)
* Resolved data type bug in `ScaleIntensityRangePercentile` (#8109)
#### data
* Fixed negative strides issue in the `NrrdReader` (#7809)
* Addressed wsireader issue with retrieving MPP (7921)
* Ensured location is returned as a tuple in wsireader (#8007)
* Corrected interpretation of space directions in nrrd reader (#8091)
#### metrics and losses
* Improved memory management for `NACLLoss` (#8020)
* Fixed reduction logic in `GeneralizedDiceScore` (#7970)
#### networks
* Resolved issue with loading pre-trained weights in `ResNet` (#7924)
* Fixed error where `torch.device` object had no attribute gpu_id during TensorRT export (#8019)
* Corrected function for loading older weights in `DiffusionModelUNet` (#8031)
* Switched to `torch_tensorrt.Device` instead of `torch.device` during TensorRT compilation (#8051)
#### engines and handlers
* Attempted to resolve the "experiment already exists" issue in `MLFlowHandler` (#7916)
* Refactored the model export process for conversion and saving (#7934)
#### misc.
* Adjusted requirements to exclude Numpy version 2.0 (#7859)
* Updated deprecated `scipy.ndimage` namespaces in optional imports (#7847, #7897)
* Resolved `load_module()` deprecation in Python 3.12 (#7881)
* Fixed Ruff type check issues (#7885)
* Cleaned disk space in the conda test pipeline (#7902)
* Replaced deprecated `pkgutil.find_loader` usage (#7906)
* Enhanced docstrings in various modules (#7913, #8055)
* Test cases fixing (#7905, #7794, #7808)
* Fix mypy issue introduced in 1.11.0 (#7941)
* Cleaned up warnings during test collection (#7914)
* Fix incompatible types in assignment issue (#7950)
* Fix outdated link in the docs (#7971)
* Addressed CI issues (#7983, #8013)
* Fix module can not import correctly issue (#8015)
* Fix AttributeError when using torch.min and max (#8041)
* Ensure synchronization by adding `cuda.synchronize` (#8058)
* Ignore warning from nptyping as workaround (#8062)
* Suppress deprecated warning when importing monai (#8067)
* Fix link in test bundle under MONAI-extra-test-data (#8092)
### Changed
* Base Docker image upgraded to `nvcr.io/nvidia/pytorch:24.08-py3` from `nvcr.io/nvidia/pytorch:23.08-py3`
* Change blossom-ci to ACL security format (#7843)
* Move PyType test to weekly test (#8025)
* Adjusted to meet Numpy 2.0 requirements (#7857)
### Deprecated
* Dropped support for Python 3.8 (#7909)
* Remove deprecated arguments and class for v1.4 (#8079)
### Removed
* Remove use of deprecated python 3.12 strtobool (#7900)
* Removed the pipeline for publishing to testpypi (#8086)
* Cleaning up some very old and now obsolete infrastructure (#8113, #8118, #8121)

## [1.3.2] - 2024-06-25
### Fixed
#### misc.
Expand Down Expand Up @@ -1040,7 +1132,8 @@ the postprocessing steps should be used before calling the metrics methods

[highlights]: https://github.com/Project-MONAI/MONAI/blob/master/docs/source/highlights.md

[Unreleased]: https://github.com/Project-MONAI/MONAI/compare/1.3.2...HEAD
[Unreleased]: https://github.com/Project-MONAI/MONAI/compare/1.4.0...HEAD
[1.4.0]: https://github.com/Project-MONAI/MONAI/compare/1.3.2...1.4.0
[1.3.2]: https://github.com/Project-MONAI/MONAI/compare/1.3.1...1.3.2
[1.3.1]: https://github.com/Project-MONAI/MONAI/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/Project-MONAI/MONAI/compare/1.2.0...1.3.0
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: 2024-06-26
version: "1.3.2"
date-released: 2024-10-17
version: "1.4.0"
identifiers:
- description: "This DOI represents all versions of MONAI, and will always resolve to the latest one."
type: doi
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,3 +383,8 @@ then make PRs to the `releasing/[version number]` to fix the bugs via the regula
If any error occurs after the release process, first check out a new hotfix branch from the `main` branch,
make a patch version release following the semantic versioning, for example, `releasing/0.1.1`.
Make sure the `releasing/0.1.1` is merged back into both `dev` and `main` and all the test pipelines succeed.


<p align="right">
<a href="#introduction">⬆️ Back to Top</a>
</p>
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# To build with a different base image
# please run `docker build` using the `--build-arg PYTORCH_IMAGE=...` flag.
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:24.08-py3
ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:24.10-py3
FROM ${PYTORCH_IMAGE}

LABEL maintainer="[email protected]"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
[![codecov](https://codecov.io/gh/Project-MONAI/MONAI/branch/dev/graph/badge.svg?token=6FTC7U1JJ4)](https://codecov.io/gh/Project-MONAI/MONAI)
[![monai Downloads Last Month](https://assets.piptrends.com/get-last-month-downloads-badge/monai.svg 'monai Downloads Last Month by pip Trends')](https://piptrends.com/package/monai)

MONAI is a [PyTorch](https://pytorch.org/)-based, [open-source](https://github.com/Project-MONAI/MONAI/blob/dev/LICENSE) framework for deep learning in healthcare imaging, part of [PyTorch Ecosystem](https://pytorch.org/ecosystem/).
Its ambitions are:
- developing a community of academic, industrial and clinical researchers collaborating on a common foundation;
- creating state-of-the-art, end-to-end training workflows for healthcare imaging;
- providing researchers with the optimized and standardized way to create and evaluate deep learning models.
MONAI is a [PyTorch](https://pytorch.org/)-based, [open-source](https://github.com/Project-MONAI/MONAI/blob/dev/LICENSE) framework for deep learning in healthcare imaging, part of the [PyTorch Ecosystem](https://pytorch.org/ecosystem/).
Its ambitions are as follows:
- Developing a community of academic, industrial and clinical researchers collaborating on a common foundation;
- Creating state-of-the-art, end-to-end training workflows for healthcare imaging;
- Providing researchers with the optimized and standardized way to create and evaluate deep learning models.


## Features
Expand Down
Binary file added docs/images/maisi_train.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vista2d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/vista3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ Since MONAI v0.2.0, the extras syntax such as `pip install 'monai[nibabel]'` is
- The options are

```
[nibabel, skimage, scipy, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, cucim, openslide, pandas, einops, transformers, mlflow, clearml, matplotlib, tensorboardX, tifffile, imagecodecs, pyyaml, fire, jsonschema, ninja, pynrrd, pydicom, h5py, nni, optuna, onnx, onnxruntime, zarr, lpips, pynvml, huggingface_hub, segment-anything]
[nibabel, skimage, scipy, pillow, tensorboard, gdown, ignite, torchvision, itk, tqdm, lmdb, psutil, cucim, openslide, pandas, einops, transformers, mlflow, clearml, matplotlib, tensorboardX, tifffile, imagecodecs, pyyaml, fire, jsonschema, ninja, pynrrd, pydicom, h5py, nni, optuna, onnx, onnxruntime, zarr, lpips, pynvml, huggingface_hub]
```

which correspond to `nibabel`, `scikit-image`,`scipy`, `pillow`, `tensorboard`,
`gdown`, `pytorch-ignite`, `torchvision`, `itk`, `tqdm`, `lmdb`, `psutil`, `cucim`, `openslide-python`, `pandas`, `einops`, `transformers`, `mlflow`, `clearml`, `matplotlib`, `tensorboardX`, `tifffile`, `imagecodecs`, `pyyaml`, `fire`, `jsonschema`, `ninja`, `pynrrd`, `pydicom`, `h5py`, `nni`, `optuna`, `onnx`, `onnxruntime`, `zarr`, `lpips`, `nvidia-ml-py`, `huggingface_hub`, `pyamg` and `segment-anything` respectively.
`gdown`, `pytorch-ignite`, `torchvision`, `itk`, `tqdm`, `lmdb`, `psutil`, `cucim`, `openslide-python`, `pandas`, `einops`, `transformers`, `mlflow`, `clearml`, `matplotlib`, `tensorboardX`, `tifffile`, `imagecodecs`, `pyyaml`, `fire`, `jsonschema`, `ninja`, `pynrrd`, `pydicom`, `h5py`, `nni`, `optuna`, `onnx`, `onnxruntime`, `zarr`, `lpips`, `nvidia-ml-py`, `huggingface_hub` and `pyamg` respectively.

- `pip install 'monai[all]'` installs all the optional dependencies.
1 change: 1 addition & 0 deletions docs/source/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ What's New
.. toctree::
:maxdepth: 1

whatsnew_1_4.md
whatsnew_1_3.md
whatsnew_1_2.md
whatsnew_1_1.md
Expand Down
2 changes: 1 addition & 1 deletion docs/source/whatsnew_1_3.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# What's new in 1.3 🎉🎉
# What's new in 1.3

- Bundle usability enhancements
- Integrating MONAI Generative into MONAI core
Expand Down
Loading

0 comments on commit 90f39e4

Please sign in to comment.