Should there be a permute transformation? #624
-
Hi @fepegar, I may be mis-understanding something but here is the possible issue I'm facing... When loading a CT scan from disk as a However, when doing 3D convolution with I suppose which axes correspond to "height", "width", and "depth" is context dependent. If so, should there be a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I would say the concept of permutation is typically replaced by reorientation in medical imaging. Have you taken a look at In [1]: import torchio as tio
In [2]: t1 = tio.datasets.FPG().t1
In [3]: t1.shape, t1.orientation
Out[3]: ((1, 256, 256, 176), ('P', 'I', 'R')) Thankfully, we can think anatomically to describe better-defined axes names than depth, height, etc. It is typical to normalize all images to have the same orientation during training, normally RAS (I guess sometimes LPS). Instead of figuring out permutations, flipping, etc., you can use In [4]: to_ras = tio.ToCanonical()
In [5]: reoriented = to_ras(t1) # data is permuted
In [6]: reoriented.shape, reoriented.orientation
Out[6]: ((1, 176, 256, 256), ('R', 'A', 'S')) What do you think? More info on NiBabel docs: Image voxel orientation |
Beta Was this translation helpful? Give feedback.
I would say the concept of permutation is typically replaced by reorientation in medical imaging. Have you taken a look at
ToCanonical
?Thankfully, we can think anatomically to describe better-defined axes names than depth, height, etc. It is typical to normalize all images to have the same orientation during training, normally RAS (I guess sometimes LPS). Instead of figuring out permutations, flipping, etc., you can use
ToCanonical
to transform all images to RAS, so all dimensions mean the same across the dataset.