ITK icon indicating copy to clipboard operation
ITK copied to clipboard

Segmentation fault

Open Mr-Blue-Sky-Candy opened this issue 4 months ago • 25 comments

I only get segmentation fault. I can share the code I wrote but not the Dicom series. The code I wrote works for all others but not for some particular CT scans. How can I help you resolve this?

The code I wrote is the following:

names_generator = itk.GDCMSeriesFileNames.New()
names_generator.SetUseSeriesDetails(True)
names_generator.SetGlobalWarningDisplay(True)
names_generator.SetNumberOfWorkUnits(os.cpu_count())
names_generator.SetLoadPrivateTags(False)
names_generator.DebugOn()

dicomIO = itk.GDCMImageIO.New()
dicomIO.LoadPrivateTagsOff()
dicomIO.SetGlobalWarningDisplay(True)
reader = itk.ImageSeriesReader[itk.Image[itk.ctype("int"), 3]].New()
reader.SetGlobalWarningDisplay(True)
reader.SetMetaDataDictionaryArrayUpdate(True)
reader.SetNumberOfWorkUnits(os.cpu_count())
reader.SetImageIO(dicomIO)
reader.ForceOrthogonalDirectionOff()

It gives segmentation fault at the line names_generator.SetDirectory(folder)

This code also gives segmentation fault:

reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(folder)
reader.SetFileNames(dicom_names)
image = reader.Execute()

Pydicom is able to read it but its metadata is very messy and hard to format besides it cannot read other particular Dicom series of CT scans.

ITK version is 5.3 on both ubuntu 22 and archlinux

Mr-Blue-Sky-Candy avatar Apr 22 '24 09:04 Mr-Blue-Sky-Candy