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
DICOM read error
- David Parker
- Posts: 1716
- Joined: Tue Aug 23, 2005 2:43 pm
Re: DICOM read error
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
This uses SimpleITK, installed using pip install SimpleITK.
Cheers,
Dave
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))
Cheers,
Dave