0

I have converted DICOM files to NIFTI format using dicom2nifti.dicom_series_to_nifti(case,output_path). But when I see labels/ground truths on the NIFTI image they appear horizontally flipped so do not show a mask for the correct region in an image.

How to correct this? Thank you in advance. I am working on feature extraction using pyradiomics. I need both image and mask in NIFTI format for this purpose. But when I convert dicom image to nii image labels are not aligned. Here I provide images for reference. dicom images and corresponding .nii segmentation and
converted nii image and corresponding label

Any help is appreciated. Thanks

  • Please provide enough code so others can better understand or reproduce the problem. – Community Jun 08 '22 at 05:08
  • Have you tried to use something like `numpy.flip(mask, axis=0)` to flip the ground truth mask along the horizontal axis (or `axis=1` for vertical flip)? – asdf Jun 09 '22 at 13:48
  • Hi, are the labels and scans both dicom files? Do you process them in the same way? If you show us what you're doing we may be able to help. – alle_meije Jun 10 '22 at 11:04
  • I am working on feature extraction using pyradiomics, therfore I need both image and label in .nii format. I have images in dicom and labels in .nii format. – Rohini Gaikar Jun 10 '22 at 14:54
  • So the labels were never in dicom format - I think that the problem may be your s-form or q-form, which determines the direction of the images. Have you compared the `affine` matrix of your 2 nifti images (see https://nipy.org/nibabel/coordinate_systems.html)? – alle_meije Jun 13 '22 at 15:45

0 Answers0