- edited description
Segmentations oblique to the acquisition plane of the source data are not yet supported
Hello,
I was trying to run MONAILabel inference on a dicom scan, the inference runs smoothly without errors, but the output segmentation was not displayed on the viewer. In the console log, this error appeared.
Initially i thought this would be a simple fix by changing the ImageOrientationPatient, rounding it to 1 and 0’s. But that doesn’t seem to work.
I have also opened an issue on monailabel’s repo: https://github.com/Project-MONAI/MONAILabel/issues/1336#issuecomment-1622914349
Comments (13)
-
reporter -
Hi Jun,
Do the ImageOrientationPatient values are the same for all the frames in the DICOM dataset?
Kind regards,
Mo
-
- changed status to open
-
reporter Hello Mo,
ImageOrientationPatient stays constant throughout the entire scan
ImagePositionPatient values are not the same
Example:
First sliceNext slice
Next slice
-
I need to look into this further. Would you please be able to share the DICOM files?
-
reporter Can you give me your email please so I could send it to you?
-
reporter -
reporter -
Thanks Jun, I will try to reproduce the issue and fix it. Will get back to you shortly.
-
Hello Mo, were you able to reproduce this error? I have been editing different tags and their values and I cant seem to find a workaround.
-
reporter I was modifying some dicom tags, trying to make it work, these are the dicom tags which i have edited on my end:
# Calculate the direction cosines for the image orientation direction_cosines = reference_file.ImageOrientationPatient row_cosine = [float(direction_cosines[0]), float(direction_cosines[1]), float(direction_cosines[2])] column_cosine = [float(direction_cosines[3]), float(direction_cosines[4]), float(direction_cosines[5])] for i, ds in enumerate(dicom_files): # Calculate the new ImagePositionPatient values using the slice number and direction cosines new_position = [(i + 1) * row_cosine[j] + ds.ImagePositionPatient[j] * column_cosine[j] for j in range(3)] # Update the ImagePositionPatient values for the current DICOM file ds.ImagePositionPatient = new_position # To ensure order of slices ds.ImagePositionPatient[2] = ds.InstanceNumber ds.ImageOrientationPatient = [1,0,0,0,1,0] ds.ImageType = ['ORIGINAL', 'PRIMARY', 'AXIAL'] ds.PatientOrientation = ['L', 'P']
I haven’t tested it out on more scans yet, would anyone be able to confirm that this is one of the way to solve the oblique issue?
-
So i figured the main issue was just the dicom metadata being corrupted / bad so some kind of editing was required. We can close this issue
-
- changed status to resolved
- Log in to comment