You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain children of the base class torchio.Transform do not adhere to the *args and **kwargs provided during __init__ as they utilise already existing transformations in apply_transform. This mainly includes the kwarg copy, which is not passed to the transform utilised in apply_transform. However, other attributes may be required depending on the circumstances.
Examples of this are:
torchio.transforms.preprocessing.spatial.crop_or_pad.CropOrPad: L.282 and L.286 -> no instantiation of Crop/Pad with self.copy
torchio.transforms.preprocessing.label.sequential_labels.SequentialLabels: L. 55 -> no instantiation of RemapLabels with self.copy
torchio.transforms.preprocessing.spatial.ensure_shape_multiple.EnsureShapeMultiple: L.136 -> no instantiation of CropOrPad with self.copy
torchio.transforms.preprocessing.spatial.resize.Resize: L. 75 -> no instantiation of CropOrPad with self.copy
This extends to any transformation that re-utilises an already defined base transformation.
The underlying transform in apply_transform is not called with copy=False as intended in the Constructor. This results in the copying of the respective copying of the Subject despite not defined by the user.
Error messages
No response
Expected outcome
All *args and **kwargs of any Transform should be passed onto each temporary/placeholder transform during apply_transform if it utilises an already implemented Transform opposed to a standalone implementation.
Is there an existing issue for this?
Bug summary
Certain children of the base class
torchio.Transform
do not adhere to the *args and **kwargs provided during__init__
as they utilise already existing transformations inapply_transform
. This mainly includes the kwargcopy
, which is not passed to the transform utilised inapply_transform
. However, other attributes may be required depending on the circumstances.Examples of this are:
torchio.transforms.preprocessing.spatial.crop_or_pad.CropOrPad
: L.282 and L.286 -> no instantiation ofCrop
/Pad
withself.copy
torchio.transforms.preprocessing.label.sequential_labels.SequentialLabels
: L. 55 -> no instantiation ofRemapLabels
withself.copy
torchio.transforms.preprocessing.spatial.ensure_shape_multiple.EnsureShapeMultiple
: L.136 -> no instantiation ofCropOrPad
withself.copy
torchio.transforms.preprocessing.spatial.resize.Resize
: L. 75 -> no instantiation ofCropOrPad
withself.copy
This extends to any transformation that re-utilises an already defined base transformation.
Code for reproduction
Actual outcome
The underlying transform in
apply_transform
is not called withcopy=False
as intended in the Constructor. This results in the copying of the respective copying of theSubject
despite not defined by the user.Error messages
No response
Expected outcome
All *args and **kwargs of any
Transform
should be passed onto each temporary/placeholder transform duringapply_transform
if it utilises an already implementedTransform
opposed to a standalone implementation.System info
The text was updated successfully, but these errors were encountered: