-
Notifications
You must be signed in to change notification settings - Fork 231
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
Possible bug: All images in subject transformed when using patches #330
Comments
Hi, @dmus. Thanks for the MWE, I appreciate it. Can you try this? subject = torchio.Subject(
mr=torchio.ScalarImage(tensor=np.random.rand(1, 8, 16, 16)),
out=torchio.ScalarImage(tensor=np.random.rand(1, 8, 16, 16)),
sampling_map=torchio.Image(tensor=np.random.rand(1, 8, 16, 16), type=torchio.SAMPLING_MAP) # this line changed
) The transform thinks that the image named The documentation is not very clear about this. I'll try to improve it soon. |
Thanks, that works |
Do the transforms work on the complete images or on the patches only? Ideally only the patch I guess, because of efficiency, but for the RescaleIntensity for example the min and max from the input should be computed on the complete image I think. Can you tell me how this works? |
As you can see in the docs, transforms are applied to the volumes: |
Okay, and can you tell me when the 'keys' argument of a transform is used. What if I have an intensity transform that should only apply to 'mr' and another intensity transform that should only apply to 'out' (which are both intensity images)? |
Have you read the docs for
At the moment, this can only happen if you use a |
I saw that torchio.Image is inheriting from dict I think this is an important feature. Because Subject is already inheriting from dict it should not be that much work? Do you have ideas? Maybe I want to contribute, but I am still taking a dive into the codebase |
I'll move the discussion to #54. |
With this piece of code:
The following error occurs:
ValueError: Negative values found in probability map "sampling_map"
It looks like the RescaleIntensity does also apply the transform to the sampling map, is this a bug or am I doing something wrong here?
The text was updated successfully, but these errors were encountered: