In [4]:
import os.path as op
import io3d
dd = io3d.dcmreaddata.DicomDirectory(op.expanduser("~/data/medical/orig/jatra_5mm/"))
dd.get_sorted_series_files(sort_keys=["SeriesNumber", "SliceLocation"], return_files_with_info=True, return_files=False)
Out[4]:
[{'AcquisitionTime': '103528.539000',
'SeriesNumber': '7',
'SliceLocation': -1061.6,
'filename': 'IM-0001-0093.dcm'},
{'AcquisitionTime': '103528.383000',
'SeriesNumber': '7',
'SliceLocation': -1056.6,
'filename': 'IM-0001-0092.dcm'},
{'AcquisitionTime': '103528.228000',
'SeriesNumber': '7',
'SliceLocation': -1051.6,
'filename': 'IM-0001-0091.dcm'},
{'AcquisitionTime': '103528.034000',
'SeriesNumber': '7',
'SliceLocation': -1046.6,
'filename': 'IM-0001-0090.dcm'},
{'AcquisitionTime': '103527.877000',
'SeriesNumber': '7',
'SliceLocation': -1041.6,
'filename': 'IM-0001-0089.dcm'},
{'AcquisitionTime': '103527.722000',
'SeriesNumber': '7',
'SliceLocation': -1036.6,
'filename': 'IM-0001-0088.dcm'},
{'AcquisitionTime': '103527.566000',
'SeriesNumber': '7',
'SliceLocation': -1031.6,
'filename': 'IM-0001-0087.dcm'},
{'AcquisitionTime': '103527.410000',
'SeriesNumber': '7',
'SliceLocation': -1026.6,
'filename': 'IM-0001-0086.dcm'},
{'AcquisitionTime': '103527.255000',
'SeriesNumber': '7',
'SliceLocation': -1021.6,
'filename': 'IM-0001-0085.dcm'},
{'AcquisitionTime': '103527.060000',
'SeriesNumber': '7',
'SliceLocation': -1016.6,
'filename': 'IM-0001-0084.dcm'},
{'AcquisitionTime': '103526.906000',
'SeriesNumber': '7',
'SliceLocation': -1011.6,
'filename': 'IM-0001-0083.dcm'},
{'AcquisitionTime': '103526.749000',
'SeriesNumber': '7',
'SliceLocation': -1006.6,
'filename': 'IM-0001-0082.dcm'},
{'AcquisitionTime': '103526.593000',
'SeriesNumber': '7',
'SliceLocation': -1001.6,
'filename': 'IM-0001-0081.dcm'},
{'AcquisitionTime': '103526.438000',
'SeriesNumber': '7',
'SliceLocation': -996.6,
'filename': 'IM-0001-0080.dcm'},
{'AcquisitionTime': '103526.281000',
'SeriesNumber': '7',
'SliceLocation': -991.6,
'filename': 'IM-0001-0079.dcm'},
{'AcquisitionTime': '103526.086000',
'SeriesNumber': '7',
'SliceLocation': -986.6,
'filename': 'IM-0001-0078.dcm'},
{'AcquisitionTime': '103525.930000',
'SeriesNumber': '7',
'SliceLocation': -981.6,
'filename': 'IM-0001-0077.dcm'},
{'AcquisitionTime': '103525.774000',
'SeriesNumber': '7',
'SliceLocation': -976.6,
'filename': 'IM-0001-0076.dcm'},
{'AcquisitionTime': '103525.618000',
'SeriesNumber': '7',
'SliceLocation': -971.6,
'filename': 'IM-0001-0075.dcm'},
{'AcquisitionTime': '103525.462000',
'SeriesNumber': '7',
'SliceLocation': -966.6,
'filename': 'IM-0001-0074.dcm'},
{'AcquisitionTime': '103525.305000',
'SeriesNumber': '7',
'SliceLocation': -961.6,
'filename': 'IM-0001-0073.dcm'},
{'AcquisitionTime': '103525.110000',
'SeriesNumber': '7',
'SliceLocation': -956.6,
'filename': 'IM-0001-0072.dcm'},
{'AcquisitionTime': '103524.954000',
'SeriesNumber': '7',
'SliceLocation': -951.6,
'filename': 'IM-0001-0071.dcm'},
{'AcquisitionTime': '103524.798000',
'SeriesNumber': '7',
'SliceLocation': -946.6,
'filename': 'IM-0001-0070.dcm'},
{'AcquisitionTime': '103524.641000',
'SeriesNumber': '7',
'SliceLocation': -941.6,
'filename': 'IM-0001-0069.dcm'},
{'AcquisitionTime': '103524.486000',
'SeriesNumber': '7',
'SliceLocation': -936.6,
'filename': 'IM-0001-0068.dcm'},
{'AcquisitionTime': '103524.330000',
'SeriesNumber': '7',
'SliceLocation': -931.6,
'filename': 'IM-0001-0067.dcm'},
{'AcquisitionTime': '103524.137000',
'SeriesNumber': '7',
'SliceLocation': -926.6,
'filename': 'IM-0001-0066.dcm'},
{'AcquisitionTime': '103523.980000',
'SeriesNumber': '7',
'SliceLocation': -921.6,
'filename': 'IM-0001-0065.dcm'},
{'AcquisitionTime': '103523.823000',
'SeriesNumber': '7',
'SliceLocation': -916.6,
'filename': 'IM-0001-0064.dcm'},
{'AcquisitionTime': '103523.668000',
'SeriesNumber': '7',
'SliceLocation': -911.6,
'filename': 'IM-0001-0063.dcm'},
{'AcquisitionTime': '103523.512000',
'SeriesNumber': '7',
'SliceLocation': -906.6,
'filename': 'IM-0001-0062.dcm'},
{'AcquisitionTime': '103523.356000',
'SeriesNumber': '7',
'SliceLocation': -901.6,
'filename': 'IM-0001-0061.dcm'},
{'AcquisitionTime': '103523.162000',
'SeriesNumber': '7',
'SliceLocation': -896.6,
'filename': 'IM-0001-0060.dcm'},
{'AcquisitionTime': '103523.007000',
'SeriesNumber': '7',
'SliceLocation': -891.6,
'filename': 'IM-0001-0059.dcm'},
{'AcquisitionTime': '103522.852000',
'SeriesNumber': '7',
'SliceLocation': -886.6,
'filename': 'IM-0001-0058.dcm'},
{'AcquisitionTime': '103522.696000',
'SeriesNumber': '7',
'SliceLocation': -881.6,
'filename': 'IM-0001-0057.dcm'},
{'AcquisitionTime': '103522.541000',
'SeriesNumber': '7',
'SliceLocation': -876.6,
'filename': 'IM-0001-0056.dcm'},
{'AcquisitionTime': '103522.384000',
'SeriesNumber': '7',
'SliceLocation': -871.6,
'filename': 'IM-0001-0055.dcm'},
{'AcquisitionTime': '103522.189000',
'SeriesNumber': '7',
'SliceLocation': -866.6,
'filename': 'IM-0001-0054.dcm'},
{'AcquisitionTime': '103522.035000',
'SeriesNumber': '7',
'SliceLocation': -861.6,
'filename': 'IM-0001-0053.dcm'},
{'AcquisitionTime': '103521.877000',
'SeriesNumber': '7',
'SliceLocation': -856.6,
'filename': 'IM-0001-0052.dcm'},
{'AcquisitionTime': '103521.723000',
'SeriesNumber': '7',
'SliceLocation': -851.6,
'filename': 'IM-0001-0051.dcm'},
{'AcquisitionTime': '103521.567000',
'SeriesNumber': '7',
'SliceLocation': -846.6,
'filename': 'IM-0001-0050.dcm'},
{'AcquisitionTime': '103521.411000',
'SeriesNumber': '7',
'SliceLocation': -841.6,
'filename': 'IM-0001-0049.dcm'},
{'AcquisitionTime': '103521.217000',
'SeriesNumber': '7',
'SliceLocation': -836.6,
'filename': 'IM-0001-0048.dcm'},
{'AcquisitionTime': '103521.060000',
'SeriesNumber': '7',
'SliceLocation': -831.6,
'filename': 'IM-0001-0047.dcm'},
{'AcquisitionTime': '103520.904000',
'SeriesNumber': '7',
'SliceLocation': -826.6,
'filename': 'IM-0001-0046.dcm'},
{'AcquisitionTime': '103520.748000',
'SeriesNumber': '7',
'SliceLocation': -821.6,
'filename': 'IM-0001-0045.dcm'},
{'AcquisitionTime': '103520.591000',
'SeriesNumber': '7',
'SliceLocation': -816.6,
'filename': 'IM-0001-0044.dcm'},
{'AcquisitionTime': '103520.435000',
'SeriesNumber': '7',
'SliceLocation': -811.6,
'filename': 'IM-0001-0043.dcm'},
{'AcquisitionTime': '103520.239000',
'SeriesNumber': '7',
'SliceLocation': -806.6,
'filename': 'IM-0001-0042.dcm'},
{'AcquisitionTime': '103520.083000',
'SeriesNumber': '7',
'SliceLocation': -801.6,
'filename': 'IM-0001-0041.dcm'},
{'AcquisitionTime': '103519.928000',
'SeriesNumber': '7',
'SliceLocation': -796.6,
'filename': 'IM-0001-0040.dcm'},
{'AcquisitionTime': '103519.771000',
'SeriesNumber': '7',
'SliceLocation': -791.6,
'filename': 'IM-0001-0039.dcm'},
{'AcquisitionTime': '103519.616000',
'SeriesNumber': '7',
'SliceLocation': -786.6,
'filename': 'IM-0001-0038.dcm'},
{'AcquisitionTime': '103519.460000',
'SeriesNumber': '7',
'SliceLocation': -781.6,
'filename': 'IM-0001-0037.dcm'},
{'AcquisitionTime': '103519.266000',
'SeriesNumber': '7',
'SliceLocation': -776.6,
'filename': 'IM-0001-0036.dcm'},
{'AcquisitionTime': '103519.110000',
'SeriesNumber': '7',
'SliceLocation': -771.6,
'filename': 'IM-0001-0035.dcm'},
{'AcquisitionTime': '103518.953000',
'SeriesNumber': '7',
'SliceLocation': -766.6,
'filename': 'IM-0001-0034.dcm'},
{'AcquisitionTime': '103518.799000',
'SeriesNumber': '7',
'SliceLocation': -761.6,
'filename': 'IM-0001-0033.dcm'},
{'AcquisitionTime': '103518.644000',
'SeriesNumber': '7',
'SliceLocation': -756.6,
'filename': 'IM-0001-0032.dcm'},
{'AcquisitionTime': '103518.487000',
'SeriesNumber': '7',
'SliceLocation': -751.6,
'filename': 'IM-0001-0031.dcm'},
{'AcquisitionTime': '103518.292000',
'SeriesNumber': '7',
'SliceLocation': -746.6,
'filename': 'IM-0001-0030.dcm'},
{'AcquisitionTime': '103518.136000',
'SeriesNumber': '7',
'SliceLocation': -741.6,
'filename': 'IM-0001-0029.dcm'},
{'AcquisitionTime': '103517.981000',
'SeriesNumber': '7',
'SliceLocation': -736.6,
'filename': 'IM-0001-0028.dcm'},
{'AcquisitionTime': '103517.825000',
'SeriesNumber': '7',
'SliceLocation': -731.6,
'filename': 'IM-0001-0027.dcm'},
{'AcquisitionTime': '103517.669000',
'SeriesNumber': '7',
'SliceLocation': -726.6,
'filename': 'IM-0001-0026.dcm'},
{'AcquisitionTime': '103517.513000',
'SeriesNumber': '7',
'SliceLocation': -721.6,
'filename': 'IM-0001-0025.dcm'},
{'AcquisitionTime': '103517.319000',
'SeriesNumber': '7',
'SliceLocation': -716.6,
'filename': 'IM-0001-0024.dcm'},
{'AcquisitionTime': '103517.163000',
'SeriesNumber': '7',
'SliceLocation': -711.6,
'filename': 'IM-0001-0023.dcm'},
{'AcquisitionTime': '103517.007000',
'SeriesNumber': '7',
'SliceLocation': -706.6,
'filename': 'IM-0001-0022.dcm'},
{'AcquisitionTime': '103516.850000',
'SeriesNumber': '7',
'SliceLocation': -701.6,
'filename': 'IM-0001-0021.dcm'},
{'AcquisitionTime': '103516.695000',
'SeriesNumber': '7',
'SliceLocation': -696.6,
'filename': 'IM-0001-0020.dcm'},
{'AcquisitionTime': '103516.539000',
'SeriesNumber': '7',
'SliceLocation': -691.6,
'filename': 'IM-0001-0019.dcm'},
{'AcquisitionTime': '103516.344000',
'SeriesNumber': '7',
'SliceLocation': -686.6,
'filename': 'IM-0001-0018.dcm'},
{'AcquisitionTime': '103516.189000',
'SeriesNumber': '7',
'SliceLocation': -681.6,
'filename': 'IM-0001-0017.dcm'},
{'AcquisitionTime': '103516.032000',
'SeriesNumber': '7',
'SliceLocation': -676.6,
'filename': 'IM-0001-0016.dcm'},
{'AcquisitionTime': '103515.878000',
'SeriesNumber': '7',
'SliceLocation': -671.6,
'filename': 'IM-0001-0015.dcm'},
{'AcquisitionTime': '103515.721000',
'SeriesNumber': '7',
'SliceLocation': -666.6,
'filename': 'IM-0001-0014.dcm'},
{'AcquisitionTime': '103515.565000',
'SeriesNumber': '7',
'SliceLocation': -661.6,
'filename': 'IM-0001-0013.dcm'},
{'AcquisitionTime': '103515.370000',
'SeriesNumber': '7',
'SliceLocation': -656.6,
'filename': 'IM-0001-0012.dcm'},
{'AcquisitionTime': '103515.215000',
'SeriesNumber': '7',
'SliceLocation': -651.6,
'filename': 'IM-0001-0011.dcm'},
{'AcquisitionTime': '103515.059000',
'SeriesNumber': '7',
'SliceLocation': -646.6,
'filename': 'IM-0001-0010.dcm'},
{'AcquisitionTime': '103514.901000',
'SeriesNumber': '7',
'SliceLocation': -641.6,
'filename': 'IM-0001-0009.dcm'},
{'AcquisitionTime': '103514.747000',
'SeriesNumber': '7',
'SliceLocation': -636.6,
'filename': 'IM-0001-0008.dcm'},
{'AcquisitionTime': '103514.590000',
'SeriesNumber': '7',
'SliceLocation': -631.6,
'filename': 'IM-0001-0007.dcm'},
{'AcquisitionTime': '103514.396000',
'SeriesNumber': '7',
'SliceLocation': -626.6,
'filename': 'IM-0001-0006.dcm'},
{'AcquisitionTime': '103514.240000',
'SeriesNumber': '7',
'SliceLocation': -621.6,
'filename': 'IM-0001-0005.dcm'},
{'AcquisitionTime': '103514.084000',
'SeriesNumber': '7',
'SliceLocation': -616.6,
'filename': 'IM-0001-0004.dcm'},
{'AcquisitionTime': '103513.928000',
'SeriesNumber': '7',
'SliceLocation': -611.6,
'filename': 'IM-0001-0003.dcm'},
{'AcquisitionTime': '103513.775000',
'SeriesNumber': '7',
'SliceLocation': -606.6,
'filename': 'IM-0001-0002.dcm'},
{'AcquisitionTime': '103513.737000',
'SeriesNumber': '7',
'SliceLocation': -601.6,
'filename': 'IM-0001-0001.dcm'}]
In [2]:
help(dd.get_sorted_series_files)
Help on method get_sorted_series_files in module io3d.dcmreaddata:
get_sorted_series_files(startpath='', series_number=None, return_files_with_info=False, sort_keys='SliceLocation', return_files=True) method of io3d.dcmreaddata.DicomDirectory instance
Function returns sorted list of dicom files. File paths are organized
by SeriesUID, StudyUID and FrameUID
:param startpath: path prefix. E.g. "~/data"
:param series_number: ID of series used for filtering the data
:param return_files_with_info: return more complex information about sorted files
:param return_files: return simple list of sorted files
:type sort_keys: One key or list of keys used for sorting method by the order of keys.
Content source: kunesj/io3d
Similar notebooks: