allow slicing with SpatialCrop(d)#1954
Conversation
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
|
could this be used to support #1993? |
Signed-off-by: Richard Brown <[email protected]>
Signed-off-by: Richard Brown <[email protected]>
|
@wyli do you know if the line I deleted in the most recent commit was required? |
I think those are needed because |
|
similarly the current inverse logic uses the original box_start/end, we might have some issues... MONAI/monai/transforms/croppad/dictionary.py Lines 602 to 604 in 5f47407 |
Signed-off-by: Richard Brown <[email protected]>
|
The inverse of If possible, I'd rather not keep |
Allow the use of a list of
slicewhen cropping. This allows indexing from the back orNoneto not crop in that direction of that dimension. As requested here: #1929 and #1935.I decided to add
slicesrather than modifyingroi_startto accept -ve numbers, for example, as this would break backwards compatibility (and doesn't allow forNone).Description
Transform can now be called with e.g.,
SpatialCrop(roi_slices=[slice(-10, None), slice(None)])to take the last 10 elements in the first dimension, and leave the second dimension untouched.Implement the inverse using the slices rather than
roi_startandroi_end, as was done previously.PR is backwards compatible.
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.