-
Notifications
You must be signed in to change notification settings - Fork 55
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
Final transform module #691
base: clinicadl_v2
Are you sure you want to change the base?
Final transform module #691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thing: What do you think about doing something like this for the Subject
class? This way, we are forced to have an image
and a label
in the class, while still being able to work with all the TorchIO transforms.
class ClinicaDLSubject(tio.Subject):
"""
A TorchIO Subject with an 'image' attribute, a TorchIO ScalarImage and a 'label' attribute, which can be either a float, int or torch.Tensor.
"""
image: tio.ScalarImage
label: Union[float, int, torch.Tensor]
Otherwise, LGTM ! Thanks :)
clinicadl/data/utils.py
Outdated
self.mask = Path(mask) | ||
else: | ||
self.common_mask = False | ||
self.mask = mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.mask = mask | |
self.mask = Path(mask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, mask
is not a path, but rather a suffix. E.g. with Mask("brain")
, the mask will be expected in sub-..._ses-..._brain.nii.gz
.
So, I'm not sure we should put it in a Path
object.
Thanks for the review @camillebrianceau. Sounds a good idea, let me check if it works! |
As you suggested @camillebrianceau, I added a subclass of TorchIO |
I didn't want to put |
Besides, I added two TorchIO transforms I had forgotten: Resample and ToCanonical. |
First of all, lots of outdated files deleted:
networks/old_network
and the associated tests intests/unittests/nn
.On
transforms
Config classes for TorchIO transforms
Supported transforms are:
clinicadl
)Supported augmentations are:
Transforms
objectThe main object of the module,
Transforms
, now supports config classes as inputs (and still supports raw transforms as well). E.g:The whole
transforms
module is tested with 100% coverage.