Replies: 7 comments 13 replies
-
Can you please share code and data to reproduce this? |
Beta Was this translation helpful? Give feedback.
-
Hi again, I used
Do you know how I can fix this ?
|
Beta Was this translation helpful? Give feedback.
-
Hi As pointed by fernando, you input image do not match. Although the segmentation may com (I guess) from the mri volume both affine differ (avec the axis order is different too) import torchio as tio
suj = tio.Subject(t1=tio.ScalarImage('patient1.nii.gz'), seg = tio.LabelMap('9001104.segmentation_masks.nii.gz'))
transform_repair_affine = tio.Compose([tio.ToCanonical(),
tio.CopyAffine(target='t1')])
suj.t1.save('patient_ok.nii')
suj.seg.save('mask_ok.nii') note that because the axis ordering is different, it is important to first go to Canonical (same axis order) and then copy the affine I then try this full transform transform = tio.Compose([tio.ToCanonical(),
tio.CopyAffine(target='t1'),
tio.Resample((0.70,0.36,0.36)),
tio.RemapLabels({0:0, 1:1, 2:2, 3:1, 4:2}),
tio.CropOrPad((128,128,128)) ]) and did not get any error |
Beta Was this translation helpful? Give feedback.
-
no it is not necessary, the save was just for checking in a external viewer how was the overlay |
Beta Was this translation helpful? Give feedback.
-
I am currently facing another problem and I was wondering if you could help me again
The most confusing part is that the error dissapears when I set the batch_size = 1 and then all mris pass through the network normally but it seems the model does not fit to the training data.
|
Beta Was this translation helpful? Give feedback.
-
Hi |
Beta Was this translation helpful? Give feedback.
-
Please open a new issue and follow the instructions in the template. This discussion is about a problem with |
Beta Was this translation helpful? Give feedback.
-
Hi, I tried to use the tio.Mask() function but there is a problem as it appears in the picture below with the sagittal and the axial plane. It seems that they are flipped somehow. The coronal plane is ok. Does anybody know why this is happening and how I can fix that
?
Beta Was this translation helpful? Give feedback.
All reactions