Page 1 of 1

DICOM read error

Posted: Wed Sep 02, 2020 11:31 am
by smatsumoto
Hi,

I am unable to import DICOM stacks into SV due to some errors with the DICOM files. It seems there are separate instances of DICOM slices/volumes within a folder.

I tried the solution suggested by Dave viewtopicPhpbb.php?f=188&t=12247&p=0&st ... 76d091fc19 but it didn't work.

Is there some way to specify which volume within a stack of DICOM files to use in creating a stack to be segmented?

Thanks,
Shion

Re: DICOM read error

Posted: Wed Sep 02, 2020 8:19 pm
by davep
Hi Shion,

The SV image reader does not currently support selecting images grouped by series although it should, I will try to add something to this in the next couple of months or so but it is not clear if I can implement this in the framework SV uses (MITK).

To read the DICOM into SV you will need to move the DICOM files into separate directories by file name. The following Python script gets and prints the file names for each series

Code: Select all

import os
from pathlib import Path
import sys
import SimpleITK as sitk

data_directory = "./dicom_data"
series_IDs = sitk.ImageSeriesReader.GetGDCMSeriesIDs(data_directory)

## Print each series file names.
#
for seriesID in series_IDs:
    print("---------- series {0:s} ---------- ".format(seriesID))
    series_file_names = sitk.ImageSeriesReader.GetGDCMSeriesFileNames(data_directory, seriesID)
    series_reader = sitk.ImageSeriesReader()
    series_reader.SetFileNames(series_file_names)
    print("Number of series file names: {0:d}".format(len(series_file_names)))
    print("Series file names: ")
    for file_name in series_file_names:
        print("  file names: {0:s}".format(file_name))
This uses SimpleITK, installed using pip install SimpleITK.

Cheers,
Dave