transform torchio subject - mask with multiple masks and different shapes than image
See original GitHub issueI have an RGB Image and a 7-class ground truth mask and I’m trying to figure out how to integrate torchio into my pipeline. I get this error
ValueError: Images in sample have inconsistent shapes:
{'Image': (1, 3, 4041, 2817), 'Mask': (1, 7, 4041, 2817)}
Also, when transforming the ground truth mask, what is the appropriate shape? onehot (eg. 1, 7, 4041, 2817) or categorical (eg. 1, 1 ,4041, 2817)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
torchio.transforms.preprocessing.intensity.mask - Read the Docs
If ``None``, all values larger than zero will be used for the mask. ... image to mask >>> transformed = mask(subject) # Set...
Read more >TorchIO: A Python library for efficient loading ... - arXiv
We present TorchIO, an open-source Python library to enable effi- cient loading, preprocessing, augmentation and patch-based sampling of medical.
Read more >API Reference - ivadomed documentation
Compute a soft Dice coefficient between im1 and im2, ie equals twice the sum of the two masks product, divided by the sum...
Read more >TorchIO: a Python library for efficient loading ... - arXiv Vanity
In comparison, many medical images are reconstructed such that voxel location ... TorchIO provides several MRI-specific augmentation transforms related to ...
Read more >How to perform identical transform on both image and target ...
If you want to treat each mask separately as a sample, you could call view(-1, height, width) on it to put all masks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use
image_interpolation='linear'
.Interpolation with B-splines of order 1 is equivalent to using linear interpolation, AFAIK. In 2 and 3D, linear interpolation is also called bilinear and trilinear interpolation, respectively.
Yes. I though that Resample does resize… Although I resize 2d images, I think it works. I use the bspline interpolation method (since there is no bilinear or bicubic). Am I missing something?