-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
493 integrate 3rd party transforms into MONAI #500
493 integrate 3rd party transforms into MONAI #500
Conversation
@Nic-Ma EXCELLENT. I need the MRI Bias correction capabilities from TorchIO for my work in about 2 weeks from now. Thank you. |
do you mean randomised simulation of bias fields? I don't think there's a bias field correction algo in TorchIO |
Yes. I do mean simulation of bias fields. I misspoke. Much of my input data is overly pre-processed, and I need to simulate what would come off the scanner. I need to simulate the "undoing" of correction. :). |
/black |
have you tried the adaptor in MONAI? I put a quick example here: from monai.transforms import Compose, adaptor
class MyTransform:
def __call__(self, **args):
return {"img": args["image"] + 1, "new_field": args["seg"] + 1}
class MyTransformDict:
def __call__(self, data_dict):
data_dict["images"] += 1
return data_dict
xform = Compose([adaptor(MyTransform(), outputs={"img": "image", "new_field": "images"}), MyTransformDict()])
out = xform({"image": 1, "seg": 2})
print(out)
>>> {'image': 2, 'seg': 2, 'images': 4} |
Hi @wyli , Thanks for your review and suggestions. |
/black |
Hi @wyli , Thanks for your review. |
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.
thanks for looking into these!
Fixes #493 .
Description
This PR implemented a tutorial to integrate 3rd party transforms into MONAI.
Including: BatchGenerator, TorchIO and Rising.
Status
Ready
Types of changes