forked from Project-MONAI/MONAI
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge master #460
Merged
Merged
merge master #460
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- update citation.cff - update weekly-preview version number - closes #5626 Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes #5776 ### 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>
Fixes #5793 . ### Description This PR provides a workaround for the incompatible sphinx 6.0.0 ### 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: Yiheng Wang <vennw@nvidia.com> Signed-off-by: Wenqi Li <wenqil@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Wenqi Li <wenqil@nvidia.com>
VarAutoEncoder.__init__() got an unexpected keyword argument 'dimensions' because now it is called spatial_dims.
Signed-off-by: Yiheng Wang <vennw@nvidia.com> Fixes #5775 . ### Description This PR fixes the issue of `_get_latest_bundle_version` on Windows (`os.path.join` will produce backslash which will create a wrong url) Thanks @SachidanandAlle for finding this issue. ### 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: Yiheng Wang <vennw@nvidia.com>
<!--pre-commit.ci start--> updates: - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0) - [github.com/asottile/pyupgrade: v2.38.2 → v3.3.1](asottile/pyupgrade@v2.38.2...v3.3.1) - [github.com/hadialqattan/pycln: v2.1.1 → v2.1.2](hadialqattan/pycln@v2.1.1...v2.1.2) <!--pre-commit.ci end--> fixes #5805 Signed-off-by: Wenqi Li <wenqil@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: kbressem <kenobressem@gmail.com> Fixes #3178 ### Description As discussed in #3178, this PR adds a more general interface to apply simple convolutions to images. This PR (re-)implements 2D and 3D versions for mean filtering, edge detection, outline detection, mask dilatation and image sharpening. ### Detailed description The main transform is `ImageFilter`. It comes with some preset filters that can be initialized using a string. Available presets are `["mean", "laplace", "elliptical", "sobel", "sharpen", "median", "gauss", "savitzky_golay"]`. For example, a transformation for mean filtering can be created with: ```python mean_filter = ImageFilter("mean", 3) ``` `ImageFilter` automatically detects whether the input is 2D or 3D and creates the appropriate filter on the first call. This filter will then be used in future calls of the transformation, so switching between 2D and 3D images is not supported. The initialization form string is only a convenience function. All preset filters are also available in `monai.networks.layers.simplelayers` as `nn.Module` subclasses. ImageFilter` can also be created directly from an `nn.Module`. For example, to create a transformation for mean filtering, the following is also possible: ```python filter_3d = MeanFilter(spatial_dims=3, size=3) mean_filter = ImageFilter(filter_3d) ``` In this example, however, the filter size is predefined and is not automatically derived from the input. In addition, it is also possible to use custom filters with `ImageFilter` using a `torch.Tensor` or `numpy.ndarray`. For example: ```python filter_3d = torch.ones(3,3,3) mean_filter = ImageFilter(filter_3d) ``` `RandImageFilter` is a randomizable variant of `ImageFilter` that executes with probability `p` on each call. Both `ImageFilter` and `RandImageFilter` also have dictionary versions. ### 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). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: kbressem <kenobressem@gmail.com>
Fixes #5653. ### Description A new utility decorator that enables us to warn users of a changing default argument. Current implementation does the following: - If version < since no warning will be printed. - If the default argument is explicitly set by the caller no warning will be printed. - If since <= version < replaced a warning like this will be printed: "Default of argument `{name}` has been deprecated since version `{since}` from `{old_default}` to `{new_default}`. It will be changed in version `{replaced}`." - If replaced <= version a warning like this will be printed: "Default of argument `{name}` was changed in version `{changed}` from `{old_default}` to `{new_default}`." - It doesn't validate the `old_default`, so you can even use this in scenarios where the default is actually `None` but set later in the function. This also enables us to set `old_default` to any string if the default is e.g. not printable. - The only validation that will throw an error is, if the `new_default` == the actual default and version < replaced. Which means, that somebody replaced the value already, before the version was incremented. Apart from that also any value for `new_default` can be set, giving the same advantages as for the `old_default`. ### 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). - [x] New tests added to cover the changes. - [x] 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: Felix Schnabel <f.schnabel@tum.de>
Signed-off-by: Wenqi Li <wenqil@nvidia.com> Fixes #5782 ### Description - adds 'mode' and 'align_corners' options to the blocks and nets - fixes a few typos ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com> Fixes #5624 Fixes #5816 ### Description - undo the workaround (29a34ad) - smaller test case tests/test_auto3dseg_ensemble.py ### 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`. - [x] 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>
Signed-off-by: KumoLiu <yunl@nvidia.com> Fixes #5609. ### Description Update the docstring for `HoVerNet` and `UpSample`. ### 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`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: KumoLiu <yunl@nvidia.com>
…5813) part of #5804. ### Description This adds a simple attribute access for ConfigParser so ```python from monai.bundle import ConfigParser parser = ConfigParser({"a":"b"}) a = parser.get_parsed_content("a") ``` can be rewritten to ```python from monai.bundle import ConfigParser parser = ConfigParser({"a":"b"}) a = parser.a ``` This only works for variables/methods that are not included in ConfigParser so e.g. `parser.config` would still get the whole config. This PR only supports shallow attribute accesses, since the returned value will be a `dict` where you need to use `["key"]` to get the content. ### 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). - [x] New tests added to cover the changes. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. Signed-off-by: Felix Schnabel <f.schnabel@tum.de>
running the test cases ### 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).
Fixes #5823. ### Description This PR types following decorators: - `deprecated` - `deprecated_arg` - `deprecated_arg_default` Found [here](https://github.com/Project-MONAI/MONAI/blob/dev/monai/utils/deprecate_utils.py). It also fixes any typing issues that occurred because of the additional typing. Secondly, it fixes untyped decorator usage of the `ignite` library (because of `optional_import`) for [Workflow](https://github.com/Project-MONAI/MONAI/blob/34d713f9887a85f140630a75e9261b89f0005c84/monai/engines/workflow.py#L45) and [IgniteMetric](https://github.com/Project-MONAI/MONAI/blob/f9d472af05ceb56513771ea2faccebb79edc1a7a/monai/handlers/ignite_metric.py#L36). ### 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). - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. Signed-off-by: Felix Schnabel <f.schnabel@tum.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Fixes #5833 ### 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. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] 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>
Fixes #5835. ### Description Use `from __future__ import annotations` in all source files using annotations, so we have consistent usage (and not only in ~5 files). The new annotations are also more readable e.g. `Optional[Union[List[str], str]]` vs. `list[str] | str | None`. Secondly, this issue includes changing `from typing import Callable, Sequence, ...` to `from collections.abc import Callable, Sequence, ...` since the ones in the `typing` module are deprecated. They are interchangeable even for `isinstance` checks (see also [this stackoverflow thread](https://stackoverflow.com/questions/62547848/should-isinstance-check-against-typing-or-collections-abc)). ### 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). - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. Signed-off-by: Felix Schnabel <f.schnabel@tum.de>
Signed-off-by: YanxuanLiu <yanxuanl@nvidia.com> fixes #5779 ### 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. review torch 1.12 tests and upgrade to the latest (1.13+) Signed-off-by: YanxuanLiu <yanxuanl@nvidia.com>
### Description This PR exclude `CuCIM`, `CuCIMD`, `RandCuCIM`, and `RandCuCIMD` wrapper transfrom from `get_transform_backends` as they are not supposed to support torch or numpy necessarily. ### 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). Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
Signed-off-by: Mikael Brudfors [mbrudfors@nvidia.com](mailto:mbrudfors@nvidia.com) part of #5740 ### Description Makes the binary and categorical metrics from MetricsReloaded available in MONAI via a wrapper module (`monai/metrics/wrapper.py`). This module allows to use the MetricsReloaded metrics as, e.g.: ```py import torch from monai.metrics import MetricsReloadedBinary metric_name = "Cohens Kappa" metric = MetricsReloadedBinary(metric_name=metric_name) # first iteration # shape [batch=1, channel=1, 2, 2] y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 1.0]]]]) y = torch.tensor([[[[1.0, 0.0], [1.0, 1.0]]]]) print(metric(y_pred, y)) # second iteration # shape [batch=1, channel=1, 2, 2] y_pred = torch.tensor([[[[1.0, 0.0], [0.0, 0.0]]]]) y = torch.tensor([[[[1.0, 0.0], [1.0, 1.0]]]]) print(metric(y_pred, y)) # aggregate # shape ([batch=2, channel=1]) print(metric.aggregate(reduction="none")) # tensor([[0.5], [0.2]]) # reset metric.reset() ``` Tests of all metrics are in `tests/test_metrics_reloaded.py`. Note that MetricsReloaded is an optional dependency of MONAI; so in order to use the wrapper, MONAI needs to be installed with: ```sh pip install '.[metricsreloaded]' ``` ### 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). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Mikael Brudfors <mbrudfors@nvidia.com> Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Mikael Brudfors <mbrudfors@nvidia.com> Co-authored-by: Wenqi Li <831580+wyli@users.noreply.github.com> Co-authored-by: monai-bot <monai.miccai2019@gmail.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com> Fixes #5844 - improves the error message when slicing data with inconsistent metadata - fixes an indexing case: ``` x = MetaTensor(np.zeros((10, 3, 4))) x[slice(1, 0)] # should return zero length data ``` ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes #5855 ### 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. Test pre-merge pipeline only!
### Description We noted it was possible to instantiate classes derived from DenseNet only if spatial_dims, in_channels, and out_channels parameters were passed by keywords. Passing them via positional scheme was not working. This small bug should be fixed now. ### Example: Before my fix: ``` import monai net = monai.networks.nets.DenseNet(3,1,2) # Working net = monai.networks.nets.DenseNet121(3,1,2) # NOT woking net = monai.networks.nets.DenseNet121(spatial_dims=3, in_channels=1, out_channels=2) # Woking ``` After my fix: ``` import monai net = monai.networks.nets.DenseNet121(3,1,2) # Woking ``` Thanks to @robsver for pointing this issue out. ### 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> Fixes #5852 ### Description 1. the following partial instantiate doesn't work ```py config = {"import statements": "$import math", "calc": {"_target_": "math.isclose", "a": 0.001, "b": 0.001}} print(ConfigParser(config).calc()) ``` with an error message: ``` Component to instantiate must represent a valid class or function, but got math.isclose. Traceback (most recent call last): File "test.py", line 4, in <module> print(ConfigParser(config).calc()) TypeError: isclose() missing required argument 'a' (pos 1) ``` because `math.isclose` is a builtin type but not a function: ```py import inspect inspect.isfunction(math.isclose) # False inspect.isbuiltin(math.isclose) # True ``` the `partial` should support `callable` including builtin functions 2. also this PR supports `_target_` of reference object's methods such as partial init: ```py "forward": {"_target_": "$@model().forward", "x": "$torch.rand(1, 3, 256, 256)"} ``` ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Add ITK to the list of optional dependencies. ### Types of changes - [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. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] 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: Dženan Zukić <dzenan.zukic@kitware.com>
Fixes #1840 . ### Description I integrated the trainable bilateral filter layer (TBF) in the MONAI repository as a new PyTorch filter layer. The TBF contains an analytical gradient derivation toward its filter parameters and its noisy input image which enables gradient-based optimization within the PyTorch graph. See [here](https://doi.org/10.1002/mp.15718) for more details on the gradient derivation. Unit tests were added that check the filter output as well as the gradient computation. ### 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). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Fabian Wagner <fabian.wagner@fau.de>
Fixes #5862. ### Description if `untyped_storage()` is present (pytorch 2) use it, else use `storage()`. ### 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: Richard Brown <33289025+rijobro@users.noreply.github.com>
Fixes #5865 ### Description A few sentences describing the changes proposed in this pull request. ### 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: Suraj Pai <bspai@bwh.harvard.edu>
Signed-off-by: KumoLiu <yunl@nvidia.com> Fixes #5875 . ### Description Add warning in `RandHistogramShift` when the image's intensity is a single value. ### 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). - [x] 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: KumoLiu <yunl@nvidia.com>
Fixes #6028 . Fixes #6041 . ### Description This PR upgraded the ignite version of dependency to the latest 0.4.11. ### 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: Nic Ma <nma@nvidia.com>
Fixes #6069 . ### Description This PR adds commonly used default values for `meta_file` and `logging_file` of `monai.bundle.run` function. ### 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: Yiheng Wang <vennw@nvidia.com>
Part of #5991 . ### Description This PR adds the crop transforms from #5860 relate to lazy resampling, and it belongs to the second part mentioned in #5991 ### 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: KumoLiu <yunl@nvidia.com>
Fixes #6066 ### Description prefer the pytorch backend as much as possible ### 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`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: monai-bot <monai.miccai2019@gmail.com> ---------
Fixes #6049 ### Description This PR add support to `GridPatch` for both filtering by count and threshold. When filtering by threshold, the `num_patches` will be treated as maximum number of patches. UPDATE: It also removes the deprecated argument of `skimage.measure.regionprops`, 'coordinates', which was causing some test to fail. ### 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). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. --------- Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
) Part of #5991 ### Description This PR adds the remaining crop transforms from #5860 relate to lazy resampling, and it belongs to the second part mentioned in #5991 ### 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: KumoLiu <yunl@nvidia.com>
Fixes #6048 ### 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>
Fixes #5580 ### Description This PR remove an "unnecessary" array copy in WSITiffFileReader, which was causing an slow down in loading whole slide images. ### 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). Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
### Description Fixes #6086 remove the channel check Fixes #6087 internally using `float('nan')` to also represent `"no_channel"` ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Signed-off-by: monai-bot <monai.miccai2019@gmail.com>
Fixes #6104 ### Description workaround adapted from https://github.com/pytorch/pytorch/blob/44dac51/torch/_tensor.py#L231-L233 ### 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`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes #6020 ### Description ``` pip install cucim python -c "import cucim" ``` may create a `cufile.log` file in the current working directory (please see rapidsai/cucim#514) this PR delays the cucim imports to when the modules are really needed. ### 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`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes # 6094. ### Description Adds the `warn` flag to `RandCropByLabelClasses`. If `True` the behavior of the class remains unchanged. If `False` the function will not print a warning if a class is not present in the label. ### 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`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: kbressem <kenobressem@gmail.com> Signed-off-by: Keno <37253540+kbressem@users.noreply.github.com>
Avoids crashing of the function if `ratios_[i] = 0` cannot be updated Fixes #6121 ### Description Adds additional if statement to check if warn is true, so that the following code can still be executed. ### 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: kbressem <kenobressem@gmail.com>
ClearML is a leading MLOps stack that can supercharge dialogues research with its state-of-the-art experiment tracking capability. ClearML: https://clear.ml/ I have added a `clearml_handler.py` which contains ClearMLHandler, ClearMLStatsHandler, and ClearMLImageHandler class. Basically, clearml can track everything which is tracked by tensorboard including scalars, and debug samples, and can also store models, artifacts, and the console in the ClearML server which can be easily accessed from ClearML WebUI shown as below: ![Screenshot from 2023-02-16 19-54-36](https://user-images.githubusercontent.com/46783803/219384828-77cb9c4c-4502-4529-95dd-8a95915385eb.png) ![Screenshot from 2023-02-16 19-54-29](https://user-images.githubusercontent.com/46783803/219384810-007ef976-b707-4dae-a31c-e9aba8200967.png) ![Screenshot from 2023-02-16 19-54-18](https://user-images.githubusercontent.com/46783803/219384795-2b5e60ac-fbff-49c7-8d6c-3eb2a34453dd.png) ![Screenshot from 2023-02-16 19-53-32](https://user-images.githubusercontent.com/46783803/219384770-b9b03667-8a12-4887-9049-84318e9a045b.png) ![Screenshot from 2023-02-16 19-53-49](https://user-images.githubusercontent.com/46783803/219384784-436f4ddb-d615-4720-ab62-1dd786a0989c.png) ![Screenshot from 2023-02-16 19-55-29](https://user-images.githubusercontent.com/46783803/219384449-fa41317c-21df-45a9-8605-7c7ed26fa637.png) ClearMLStatsHandler and ClearMLImageHandler can be used with Pytorch Trainer just like TensorboardStatsHandler and TensorboardImageHandler. Use `ClearMLStatsHandler()` & `ClearMLImageHandler(log_dir="./runs/", batch_transform=from_engine(["image", "label"]),output_transform=from_engine(["pred"]),)` with any MONAI example to test its functionality. Also, please let us where should we put further documentation and tutorials regarding this MLOps tool in the MONAI. --------- Signed-off-by: Muhammad Sakib Khan Inan <sakib.khaninan@gmail.com> Signed-off-by: skinan <sakib.khaninan@gmail.com> Signed-off-by: Victor Sonck <victor.sonck@gmail.com Signed-off-by: Victor Sonck <victor.sonck@gmail.com>
Fixes #6109 ### Description - use tuples for user inputs to avoid changes - enhance the type checks - fixes issue of `ratios` in `RandCropByLabelClasses ` ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes #6124 . ### Description When running the inference with torchscript wrapped TensorRT models, the evaluator would give an error. This is caused by the `with engine.mode()` code run the `training` method of `engine.network` without checking. In this PR, an attribute check has been added to cover this issue. ### 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: binliu <binliu@nvidia.com>
### Description Improve GPU memory efficiency on sliding-window inferer. A few sentences describing the changes proposed in this pull request. ### 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: dongy <dongy@nvidia.com> Co-authored-by: dongy <dongy@nvidia.com>
Fixes #6056 ### Description This PR enable to instantiate `WSIReader` classes with default values for `mode` and `dtype`. It also accepts `torch.dtype` as dtype and if `torch.dtype` is provided, the output will be a `torch.Tensor` to avoid additional step to convert the output for inference. ### 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). - [x] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. --------- Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
A part of #5991 . ### Description Ready ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Breaking change (fix or new feature that would cause existing functionality to change). - [x] 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`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Yiheng Wang <vennw@nvidia.com> Co-authored-by: KumoLiu <yunl@nvidia.com>
### Description This PR should fix the memory issue with quick test instances for running wsireader tests by using a lower resolution images for testing. ### 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). Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com> Co-authored-by: Wenqi Li <831580+wyli@users.noreply.github.com>
for slightly different affine (atol < 1e-3) the shape output might be different ``` sum([1.49999991e+00 1.44128689e-04] * [237. 144.]) = sum([3.55499980e+02 2.07545313e-02]) = 355.52073414989167 sum([ 1.49999989e+00 -6.16167492e-10] * [237. 144.]) = sum([ 3.55499975e+02 -8.87281188e-08]) = 355.4999748785736 ``` - increase the stability of affine inv - check affine floating point types - ensure same shape when there's only tiny difference in pixdim ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [x] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Fixes #5821 . ### Description The main idea of this PR is to solve 3 pain points of the current bundle training or inference workflow: 1. Training or inference is defined in a "rigid" `training` or `evaluation` list, so 3rd party package can't flexibly initialize and run the workflows separately, see: Project-MONAI/model-zoo#294. This PR splits it into `initialize`, `run` and `finalize`, and still compatible with current existing bundles. 2. 3rd party packages need to access the bundle config directly with specifed keys based on `ConfigParser`, but some developers of bundles don't want to write JSON or YAML configs. This PR implemented the interface to support both config-based and python-based workflows. 3. MONAI Label, MONAI deploy, MONAI-FL require many fixed properties of a training or inference workflow, but we don't have definition for them in the code, just described in the developer guide doc of model-zoo. This PR implemented the `TrainProperties` and `inferenceProperties` interfaces and check tool. ### 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: Nic Ma <nma@nvidia.com> Signed-off-by: root <root@apt-sh-ai.nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: root <root@apt-sh-ai.nvidia.com>
Fixes Project-MONAI/tutorials#1250. Fixes #6149 ### Description Now when `Resize` accept the same spatial_size with the original shape and `set_track_meta(False)`, it will only return meta information. https://github.com/Project-MONAI/MONAI/blob/9fd6d4ced3efb344cf3b24c51d899d8fafc882d5/monai/transforms/spatial/functional.py#L297-L301 In fast_training_tutorial.ipynb, when in "fast" mode, it will `set_track_meta(False)` which causes error when doing `Resize` This pr change `sliding_window_inference` to only `Resize` when the shape is different. https://github.com/Project-MONAI/MONAI/blob/a2ec3752f54bfc3b40e7952234fbeb5452ed63e3/monai/inferers/utils.py#L253 ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Wenqi Li <wenqil@nvidia.com> Signed-off-by: KumoLiu <yunl@nvidia.com> Co-authored-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com> Fixes #5972 . ### Description Fix and New Feature included: - fix cache rate: Project-MONAI/research-contributions#173 - typo fix Project-MONAI/research-contributions#178 - scheduler step fix Project-MONAI/research-contributions#182 - enhancement Project-MONAI/research-contributions#184 - Fixed pretrain weight loading Project-MONAI/research-contributions#202 ### 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). - [x] `python tests/test_integration_autorunner.py` succeeded locally --------- Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
Signed-off-by: monai-bot <monai.miccai2019@gmail.com> --------- Signed-off-by: monai-bot <monai.miccai2019@gmail.com> Signed-off-by: Wenqi Li <wenqil@nvidia.com> Co-authored-by: Wenqi Li <wenqil@nvidia.com>
Adds several improvements to DataAnalyzer, including - Calculates image sizes in mm and their summaries (in additional to shapes and spacing) - Saves the datastats.yaml file as 2 files, the summary and the statistics by case. The datastats.yaml will have only summaries, to be able to load it faster. Otherwise for a large datasets (with many labels) YAML loading takes over 2minutes. ### Description A few sentences describing the changes proposed in this pull request. ### 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: myron <amyronenko@nvidia.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes # .
Description
A few sentences describing the changes proposed in this pull request.
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.