Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nifti output of autopipeline has different dimensions that original DICOM #132

Open
strixy16 opened this issue Oct 25, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@strixy16
Copy link
Collaborator

I ran autopipeline on a CT image from the TCIA LIDC-IDRI dataset and it changed the image dimensions.

I tried this specifically patient LIDC-IDRI-0001 with the CT series ID 1.3.6.1.4.1.14519.5.2.1.6279.6001.179049373636438705059720603192

When I load the DICOM image with read_dicom_series from imgtools.io, I get this:

# DICOM CT Loading
from imgtools.io import read_dicom_series

# Path to CT image directory
path_to_dicom_directory = '../../rawdata/LIDC-IDRI/images/LIDC-IDRI-0001/01-01-2000-NA-NA-30178/3000566.000000-NA-03192'

# load the CT using med-imagetools function 
ct_dicom = read_dicom_series(path_to_dicom_directory)

# Should return a SimpleITK image object
print("DICOM CT loaded:")
print("Type: ", type(ct_dicom))
print("Shape: ", ct_dicom.GetSize())
DICOM CT loaded:
Type:  <class 'SimpleITK.SimpleITK.Image'>
Shape:  (512, 512, 133)

but if I load the converted NIfTI using Nibabel, I get the following:

import nibabel as nib

# Path to single CT nifti file
path_to_ct_nifti = "../../procdata/mit_test/0_LIDC-IDRI-0001/CT/CT.nii.gz"

# Load in the image as a nibabel object
ct_nifti = nib.load(path_to_ct_nifti)

print("NIfTI image loaded:")
print("Type: ", type(ct_nifti))
print("Shape: ", ct_nifti.shape)
NIfTI image loaded:
Type:  <class 'nibabel.nifti1.Nifti1Image'>
Shape:  (360, 360, 133)

If I convert the DICOM image by loading it in with SimpleITK as above and then saving it with sitk.WriteImage, the dimensions don't change.

@strixy16 strixy16 added the bug Something isn't working label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant