Skip to content

Commit

Permalink
Move metatensor support into dev branch (crop/pad) (#4548)
Browse files Browse the repository at this point in the history
* [DLMED] adapt Pad transform for MetaTensor

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] format code

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update inverse and spatial_pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update divisible pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] make thread safe

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update CenterSpatialCrop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update scale crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix flake8

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random scale crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random spatial crop samples

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] adjust Pad design

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update CropForeground

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random weighted crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update RandCropPosNeg

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand crop by label classes

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update ResizeCropOrPad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] restore numpy pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update dict spatial pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad and divisible pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update center spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand scale crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand spatial crop samples dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update crop foreground dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand weighted crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update pos neg crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [DLMED] update crop by labels dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update resize with pad or crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update format

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix all the mypy errors

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add crop / pad base tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update pad transforms

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update samples crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update crop tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add test for deepcopy

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update docs

Signed-off-by: Nic Ma <nma@nvidia.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and wyli committed Jun 30, 2022
1 parent edf3b74 commit 1d0c129
Show file tree
Hide file tree
Showing 35 changed files with 1,599 additions and 1,839 deletions.
24 changes: 24 additions & 0 deletions docs/source/transforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ Crop and Pad
:members:
:special-members: __call__

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

`SpatialCrop`
"""""""""""""
.. image:: https://github.com/Project-MONAI/DocImages/raw/main/transforms/SpatialCrop.png
Expand Down Expand Up @@ -995,6 +1001,12 @@ Dictionary Transforms
Crop and Pad (Dict)
^^^^^^^^^^^^^^^^^^^

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

`SpatialPadd`
"""""""""""""
.. image:: https://github.com/Project-MONAI/DocImages/raw/main/transforms/SpatialPadd.png
Expand All @@ -1019,6 +1031,18 @@ Crop and Pad (Dict)
:members:
:special-members: __call__

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

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

`SpatialCropd`
""""""""""""""
.. image:: https://github.com/Project-MONAI/DocImages/raw/main/transforms/SpatialCropd.png
Expand Down
14 changes: 13 additions & 1 deletion monai/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
BoundingRect,
CenterScaleCrop,
CenterSpatialCrop,
Crop,
CropForeground,
DivisiblePad,
Pad,
Expand Down Expand Up @@ -43,19 +44,30 @@
CenterSpatialCropd,
CenterSpatialCropD,
CenterSpatialCropDict,
Cropd,
CropD,
CropDict,
CropForegroundd,
CropForegroundD,
CropForegroundDict,
DivisiblePadd,
DivisiblePadD,
DivisiblePadDict,
PadModeSequence,
Padd,
PadD,
PadDict,
RandCropd,
RandCropD,
RandCropDict,
RandCropByLabelClassesd,
RandCropByLabelClassesD,
RandCropByLabelClassesDict,
RandCropByPosNegLabeld,
RandCropByPosNegLabelD,
RandCropByPosNegLabelDict,
RandCropd,
RandCropD,
RandCropDict,
RandScaleCropd,
RandScaleCropD,
RandScaleCropDict,
Expand Down
Loading

0 comments on commit 1d0c129

Please sign in to comment.