merge master#61
Merged
Nic-Ma merged 124 commits intoNic-Ma:1905-enhance-brats-transformfrom Mar 31, 2021
Merged
Conversation
* update openmp flag Signed-off-by: Wenqi Li <[email protected]> * improves boundtype docs Signed-off-by: Wenqi Li <[email protected]> * update setup.py Signed-off-by: Wenqi Li <[email protected]> * input validation 1d Signed-off-by: Wenqi Li <[email protected]> * fixes typos Signed-off-by: Wenqi Li <[email protected]> * fixes typos Signed-off-by: Wenqi Li <[email protected]> * merge upstream changes Signed-off-by: Wenqi Li <[email protected]> * tests enums Signed-off-by: Wenqi Li <[email protected]> * init. test grid pull Signed-off-by: Wenqi Li <[email protected]> * update Signed-off-by: Wenqi Li <[email protected]> * test grid_pull Signed-off-by: Wenqi Li <[email protected]> * fixes min test Signed-off-by: Wenqi Li <[email protected]> * adds device tests Signed-off-by: Wenqi Li <[email protected]> * bwd tests Signed-off-by: Wenqi Li <[email protected]>
move transforms out of compose file. this is backwards compatible.
* pad_collation Signed-off-by: Richard Brown <[email protected]> * increase number of test cases to ensure required testing errors Signed-off-by: Richard Brown <[email protected]> * determinism in setUp Signed-off-by: Richard Brown <[email protected]> * pad collate for list of lists Signed-off-by: Richard Brown <[email protected]> * code format Signed-off-by: Richard Brown <[email protected]> * allow padding options Signed-off-by: Richard Brown <[email protected]>
decollate batch
enhance random range parameters If element `i` is iterable, then `uniform[-rotate_range[i][0], rotate_range[i][1])` will be used to generate the rotation parameter for the ith dimension. If not, `uniform[-rotate_range[i], rotate_range[i])` will be used. This can be altered on a per-dimension basis. E.g., `((0,3), 1, ...)`: for dim0, rotation will be in range `[0, 3]`, and for dim1 `[-1, 1]` will be used. Setting a single value will use `[-x, x]` for dim0 and nothing for the remaining dimensions. Backwards compatibility is ensured because the old behaviour used to do `uniform[-rotate_range[i], rotate_range[i])`, and this PR just adds the possibility to do `uniform[-rotate_range[i][0], rotate_range[i][1])`.
* Fixing issues preventing loss functions from being compatible with Torchscript Signed-off-by: Eric Kerfoot <[email protected]> * Updates Signed-off-by: Eric Kerfoot <[email protected]> * Updates Signed-off-by: Eric Kerfoot <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * Updates Signed-off-by: Eric Kerfoot <[email protected]> * Adding conditional skip to Torchscript tests Signed-off-by: Eric Kerfoot <[email protected]> Co-authored-by: monai-bot <[email protected]>
* [DLMED] fix length > 1024 issue in string list all gather Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] add more test Signed-off-by: Nic Ma <[email protected]> Co-authored-by: Yiheng Wang <[email protected]>
* DeleteChannel array, dictionary, tests Signed-off-by: Leo Tam <[email protected]> * formatting Signed-off-by: Leo Tam <[email protected]> * DeleteChannel array, dictionary, tests Signed-off-by: Leo Tam <[email protected]> * Register in transform init Signed-off-by: Leo Tam <[email protected]> * clean comment Signed-off-by: Leo Tam <[email protected]> * Dict init Signed-off-by: Leo Tam <[email protected]> * Register D and Dict Signed-off-by: Leo Tam <[email protected]> * Style fix Signed-off-by: Leo Tam <[email protected]> * Safety cast Signed-off-by: Leo Tam <[email protected]> * Changinging names from DeleteChannel to RemoveRepeatedChannel Signed-off-by: Leo Tam <[email protected]> * Lint fixes Signed-off-by: Leo Tam <[email protected]> * Test import fix, autofix again Signed-off-by: Leo Tam <[email protected]>
Signed-off-by: Nic Ma <[email protected]> Co-authored-by: Eric Kerfoot <[email protected]>
* update distcall Signed-off-by: Wenqi Li <[email protected]> * update final closing Signed-off-by: Wenqi Li <[email protected]> Co-authored-by: Eric Kerfoot <[email protected]>
* Add ToPIL transformation Signed-off-by: Behrooz <[email protected]> * Add ToPILd, ToPILD, ToPILDict Signed-off-by: Behrooz <[email protected]> * Remove has_pil Signed-off-by: Behrooz <[email protected]> * Include ToPIL, ToPILd, ToPILD, and ToPILDict Also include ToNumpyD, ToNumpyDict, TorchVisionD, and TorchVisionDict Signed-off-by: Behrooz <[email protected]> * Fix a typing issue Signed-off-by: Behrooz <[email protected]> * Fix PIL optional import Signed-off-by: Behrooz <[email protected]> * Add unittests for ToPIL and ToPILD Signed-off-by: Behrooz <[email protected]> * Fix formatting Signed-off-by: Behrooz <[email protected]> * Fix formatting Signed-off-by: Behrooz <[email protected]> * Add PILImage.Image as the input for ToNumpy and ToTensor Signed-off-by: Behrooz <[email protected]> * Fix type checking issue for PIL.Image.Image Signed-off-by: Behrooz <[email protected]> * Change PILImage_fromarray to lower case Signed-off-by: Behrooz <[email protected]>
add RandomizableTransform
* Add more tests to test_deepgrow_dataset Signed-off-by: YuanTingHsieh <[email protected]>
* Add inference transforms Signed-off-by: YuanTingHsieh <[email protected]> * Remove unused import Signed-off-by: YuanTingHsieh <[email protected]> * Fix review comments Signed-off-by: YuanTingHsieh <[email protected]> Co-authored-by: SACHIDANAND ALLE <[email protected]>
* [DLMED] add RandAxisFlip transforms Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix flake8 issues Signed-off-by: Nic Ma <[email protected]> Co-authored-by: monai-bot <[email protected]>
fix big endianness problem for dictionary reading. Also allow dictionary image_only
* [DLMED] add AutoAdjustChannel transform Signed-off-by: Nic Ma <[email protected]> * [DLMED] add dict version transform Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix doc-build issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to Wenqi's comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] update doc-strings Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> Co-authored-by: monai-bot <[email protected]>
Allow missing keys
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
* Update load pretrain for densenet Signed-off-by: Yiheng Wang <[email protected]> * Fix isort issue Signed-off-by: Yiheng Wang <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Yiheng Wang <[email protected]>
* [DLMED] add suqeeze to handler Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]>
* fixes #1285 Signed-off-by: Wenqi Li <[email protected]> * adds test Signed-off-by: Wenqi Li <[email protected]>
* fixes #1685 Signed-off-by: Wenqi Li <[email protected]> * add temp test Signed-off-by: Wenqi Li <[email protected]> * adds docstring Signed-off-by: Wenqi Li <[email protected]> * fixes dist sampler Signed-off-by: Wenqi Li <[email protected]> * remove temp tests Signed-off-by: Wenqi Li <[email protected]> * fixes type hint issue Signed-off-by: Wenqi Li <[email protected]>
* fixes data type in switching Signed-off-by: Wenqi Li <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> Co-authored-by: monai-bot <[email protected]>
* Implement CuImageReader and OpenSlideReader Signed-off-by: Behrooz <[email protected]> * Add unittests for CuImageReader Signed-off-by: Behrooz <[email protected]> * Add unittests for OpenSlideReader Signed-off-by: Behrooz <[email protected]> * Sort imports Signed-off-by: Behrooz <[email protected]> * Add correct boundaries Signed-off-by: Behrooz <[email protected]> * Add test cases for reading patches on a grid for CuImage Signed-off-by: Behrooz <[email protected]> * Add patch whole slide imaging dataset for pathology Signed-off-by: Behrooz <[email protected]> * Add test case for read patches for OpenSlide Signed-off-by: Behrooz <[email protected]> * flake8 and few minor changes Signed-off-by: Behrooz <[email protected]> * black Signed-off-by: Behrooz <[email protected]> * flake8 Signed-off-by: Behrooz <[email protected]> * Add kwargs to CuImageReader and OpenSlideReader's read method Signed-off-by: Behrooz <[email protected]> * Change the type hint from np.dtype to DTypeLike Signed-off-by: Behrooz <[email protected]> * Fix a bug Signed-off-by: Behrooz <[email protected]> * Implement WSIReader and unittests Signed-off-by: Behrooz <[email protected]> * Minor updates Signed-off-by: Behrooz <[email protected]> * Fix few typing issues Signed-off-by: Behrooz <[email protected]> * Revert datasets Signed-off-by: Behrooz <[email protected]> * Add shape property to openslide image object Reverse size to be compatible with output size (hxw) Signed-off-by: Behrooz <[email protected]> * Add untittest for loading the whole image Reverse the size accroding to the WSIReader Signed-off-by: Behrooz <[email protected]> * Update the whole image size Signed-off-by: Behrooz <[email protected]> * Remove optional size Signed-off-by: Behrooz <[email protected]> * Remove optional dtype Signed-off-by: Behrooz <[email protected]> * Remove _get_spatial_shape return type Signed-off-by: Behrooz <[email protected]> * Reverse the orders of dimensions of `location` to be compatible with image shape Signed-off-by: Behrooz <[email protected]> * Change test cases to use smaller image and revese location's dimensions Signed-off-by: Behrooz <[email protected]> * Replace the test TIFF and some upgrades Signed-off-by: Behrooz <[email protected]> * Update dependencies for OpenSlide Signed-off-by: Behrooz <[email protected]> * Update unittests for OpenSlide and CuImage Signed-off-by: Behrooz <[email protected]> * Fix openslide dependency Signed-off-by: Behrooz <[email protected]> * Fix doc dependencies Signed-off-by: Behrooz <[email protected]> * Minor changes Signed-off-by: Behrooz <[email protected]> * Few variable name changes Signed-off-by: Behrooz <[email protected]> * Add EnsureChannelFirst Signed-off-by: Behrooz <[email protected]> * Add metadata to WSIReader Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
* conditional random field implementation Signed-off-by: charliebudd <[email protected]>
* [DLMED] fix affine error and thread-safe issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] update CI tests Signed-off-by: Nic Ma <[email protected]> * [DLMED] update typehints Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix flake8 Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] make cachedataset to be thread-safe Signed-off-by: Nic Ma <[email protected]> * [DLMED] remove inverse ID check Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] restore CacheDataset and inverse transform Signed-off-by: Nic Ma <[email protected]> Co-authored-by: monai-bot <[email protected]>
* Implement PatchWSIDataset and SmartCachePathWSIDataset Signed-off-by: Behrooz <[email protected]> * Remove label preprocessing and adopt new type of inputs Signed-off-by: Behrooz <[email protected]> * Update type hints Signed-off-by: Behrooz <[email protected]> * Add init file Signed-off-by: Behrooz <[email protected]> * Change grid_size to grid_shape Signed-off-by: Behrooz <[email protected]> * Add a unittest for PatchWSIDataset Signed-off-by: Behrooz <[email protected]> * Add more unittests Signed-off-by: Behrooz <[email protected]> * Update docstrings and make minor changes Signed-off-by: Behrooz <[email protected]> * Convert labels to numpy to match the change in dataset Signed-off-by: Behrooz <[email protected]> * Update location from center to corner Signed-off-by: Behrooz <[email protected]> * Update unittests locations from center to corner Signed-off-by: Behrooz <[email protected]> * Update docs for pathology datasets Signed-off-by: Behrooz <[email protected]> * Update type hint and doc Signed-off-by: Behrooz <[email protected]> * Update docstrings Signed-off-by: Behrooz <[email protected]> * Format docstring Signed-off-by: Behrooz <[email protected]> * Update length of the smartcache dataset Signed-off-by: Behrooz <[email protected]> * Add unittest for SmartCachePatchWSIDataset Signed-off-by: Behrooz <[email protected]> * Minor changes and fixes Signed-off-by: Behrooz <[email protected]> * Add unnittest for OpenSlide option Signed-off-by: Behrooz <[email protected]> * Add new line Signed-off-by: Behrooz <[email protected]> * Remove SmartCachePatchWSIDataset test to fix it Signed-off-by: Behrooz <[email protected]> * move init docstring to class docstring Signed-off-by: Richard Brown <[email protected]>
* Implement fully convolutional version of torchvision models Signed-off-by: Behrooz <[email protected]> * Update networks init with TorchVisionFullyConvModel Signed-off-by: Behrooz <[email protected]> * Add unittests for TorchVisionFullyConvModel Signed-off-by: Behrooz <[email protected]> * Add another test case Signed-off-by: Behrooz <[email protected]> * Upate docs for TorchVisionFullyConvModel Signed-off-by: Behrooz <[email protected]> * Make torchvision import optional Signed-off-by: Behrooz <[email protected]> * Skip the tests if torchvision not available Signed-off-by: Behrooz <[email protected]> * Improve the model based on comments Signed-off-by: Behrooz <[email protected]> * Update and add test cases Signed-off-by: Behrooz <[email protected]>
* Add label dimensions to be compatible with changes in model output Signed-off-by: Behrooz <[email protected]> * Update test case outputs and add new test case Signed-off-by: Behrooz <[email protected]>
* fixes init affinehead Signed-off-by: Wenqi Li <[email protected]> * fixes unit tests Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
* fixes #1857, SpatialCrop is compatible with tensors Signed-off-by: Wenqi Li <[email protected]> * update val comparisons Signed-off-by: Wenqi Li <[email protected]>
* Optimize speed and support any dimensions Signed-off-by: Yiheng Wang <[email protected]> * Fix black issue Signed-off-by: Yiheng Wang <[email protected]> * Add unittest and docstrings Signed-off-by: Yiheng Wang <[email protected]> * Modify box size and others Signed-off-by: Yiheng Wang <[email protected]> * Add pathology nms Signed-off-by: Yiheng Wang <[email protected]> * Update docs Signed-off-by: Yiheng Wang <[email protected]> * Update pathology nms Signed-off-by: Yiheng Wang <[email protected]> Co-authored-by: Behrooz <[email protected]> Co-authored-by: Wenqi Li <[email protected]>
* [DLMED] fix read permission issue Signed-off-by: Nic Ma <[email protected]>
* fix lr finder
* [DLMED] add MapLabelValue Signed-off-by: Nic Ma <[email protected]> * [DLMED] add unit tests Signed-off-by: Nic Ma <[email protected]> * [DLMED] add missing doc-string Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]>
* Add unittests for SmartCachePatchWSIDataset Signed-off-by: Behrooz <[email protected]> * Turn off shuffle for SmartCachePatchWSIDataset Signed-off-by: Behrooz <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
* fixes #1848 Signed-off-by: Wenqi Li <[email protected]> * temp tests Signed-off-by: Wenqi Li <[email protected]> * Revert "temp tests" This reverts commit 563e7ea. Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
Allowing the choice of epoch and iteration interval. Signed-off-by: Petru-Daniel Tudosiu <[email protected]>
* [DLMED] enhance list_collate Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] update based on comments Co-authored-by: Wenqi Li <[email protected]> Signed-off-by: Nic Ma <[email protected]> Co-authored-by: monai-bot <[email protected]> Co-authored-by: Wenqi Li <[email protected]>
Signed-off-by: Nic Ma <[email protected]>
* [DLMED] add slicing support in datasets Signed-off-by: Nic Ma <[email protected]> * [DLMED] add unit tests Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> * [DLMED] fix typo Signed-off-by: Nic Ma <[email protected]> * [DLMED] update according to comments Signed-off-by: Nic Ma <[email protected]> * [DLMED] update doc-strings and typehints Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> * [DLMED] fix flake8 issue Signed-off-by: Nic Ma <[email protected]> Co-authored-by: monai-bot <[email protected]>
* download_if_not_exist Signed-off-by: Behrooz <[email protected]> * Update cuimage reader tests Signed-off-by: Behrooz <[email protected]> * Update openslide reader tests Signed-off-by: Behrooz <[email protected]> * Update the file path to be relative to the test file Signed-off-by: Behrooz <[email protected]> * Update patch wsi dataset tests Signed-off-by: Behrooz <[email protected]> * Update smartcache patch wsi dataset tests Signed-off-by: Behrooz <[email protected]> * Revert "download_if_not_exist" This reverts commit a4c65f3. Signed-off-by: Behrooz <[email protected]> * Update with download_url Signed-off-by: Behrooz <[email protected]> * [MONAI] python code formatting
* Implement random bias field transform Signed-off-by: Yiheng Wang <[email protected]>
* Fixing error in saving non-pytorch-variable parameters for backwards pass Signed-off-by: chaliebudd <[email protected]> * Adding unit tests to check bilateral filter backwards runs Signed-off-by: chaliebudd <[email protected]> * fixing typo introduced by merge Signed-off-by: chaliebudd <[email protected]> * code reformatting Signed-off-by: chaliebudd <[email protected]>
* fixes warping Signed-off-by: Wenqi Li <[email protected]> * fixes types Signed-off-by: Wenqi Li <[email protected]> * update based on comments Signed-off-by: Wenqi Li <[email protected]> * fixes warnings in setup.cfg, config, deprecated assertexecption Signed-off-by: Wenqi Li <[email protected]>
* Remove assert statement from non-test files * Remove redundant `None` default * Use `is` to compare type of objects * Refactor unnecessary `else` / `elif` when `if` block has a `raise` statement * Refactor unnecessary `else` / `elif` when `if` block has a `return` statement * runtests.sh --autofix Signed-off-by: Wenqi Li <[email protected]> * autofix/7d8e8b86-113e-4a5a-8d0d-c621aab7b5f2 Signed-off-by: Wenqi Li <[email protected]> * fixes assert types Signed-off-by: Wenqi Li <[email protected]> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Wenqi Li <[email protected]>
Signed-off-by: Behrooz <[email protected]>
* Implement MaskedInferenceWSIDataset for pathology inference Signed-off-by: Behrooz <[email protected]> * Update pathology init Signed-off-by: Behrooz <[email protected]> * Update docs Signed-off-by: Behrooz <[email protected]> * Remove last elemnt of cum_num_patches Signed-off-by: Behrooz <[email protected]> * Add unittest with multiple cases for MaskedInferenceWSIDataset Signed-off-by: Behrooz <[email protected]> * sort imports in init Signed-off-by: Behrooz <[email protected]> * Remove list dataset Signed-off-by: Behrooz <[email protected]> * Remove try/except and add type hint Signed-off-by: Behrooz <[email protected]> * Convert the sample output to a list Signed-off-by: Behrooz <[email protected]> * Remove some type hints Signed-off-by: Behrooz <[email protected]> * Remove prints Signed-off-by: Behrooz <[email protected]> * Update based on commnets Signed-off-by: Behrooz <[email protected]> * Update patch_size Signed-off-by: Behrooz <[email protected]> * Update unittests Signed-off-by: Behrooz <[email protected]> * Add more type hints Signed-off-by: Behrooz <[email protected]>
* remove unused in_channels in LNCC Signed-off-by: Wenqi Li <[email protected]> * update integration tests Signed-off-by: Wenqi Li <[email protected]> * extending warp options Signed-off-by: Wenqi Li <[email protected]>
This file contains hidden or 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
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.
Status
Ready/Work in progress/Hold
Types of changes
./runtests.sh --codeformat --coverage../runtests.sh --quick.make htmlcommand in thedocs/folder.