Is there a way to adapt the example at Read Image Meta-Data Dictionary and Print so that it shows image metadata of the whole DICOM series?
Specifically, with the above example it is possible to read a single dicom slice and get its image metadata which, of course, won’t reflect the image metadata of the whole series. For example,
GetSize() would show
(512,512,1), whereas I would like it to show the size of the whole series, e.g.
(512, 512, 120).
I tried the following, but the
ImageSeriesReader does not have
ReadImageInformation() so only by running
Execute() am I able to get the image metadata, but at the cost of loading the series images.
path = # path to DICOM folder reader = sitk.ImageSeriesReader() dicom_paths = reader.GetGDCMSeriesFileNames(path) reader.SetFileNames(dicom_paths) reader.LoadPrivateTagsOn() reader.ReadImageInformation() # AttributeError: 'ImageSeriesReader' object has no attribute 'ReadImageInformation'