Commit d65f0d3d authored by Mark Hymers's avatar Mark Hymers

Initial (non-working) ISSS support

Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 93a2dcc8
Pipeline #1358 failed with stage
in 11 minutes and 31 seconds
......@@ -431,7 +431,8 @@ class DICOMSeries(object):
'MOSAIC': self.IsMosaic,
'ORIGINAL': self.IsOriginal,
'PHYSIO': self.IsPhysiological,
'NIFTI': self.ShouldCreateNIFTI}
'NIFTI': self.ShouldCreateNIFTI,
'ISSS': self.IsISSS}
flags = ', '.join([ x for x in sorted(list(flags.keys())) if flags[x] ])
......@@ -775,6 +776,22 @@ class DICOMSeries(object):
return True
@property
def IsISSS(self):
"""
Check whether this was acquired by one of the ISSS-style sequences
which mean that we can't check for Contiguity (as we won't have
data for every volume)
"""
raise Exception("TODO: THIS CAN'T WORK - SS isn't the right thing")
try:
dat = self.get_first_property('SequenceVariant')
return 'SS' in dat
except ValueError:
# Some files won't have SequenceVariant; in that case, we're
# not ISSS
return False
@property
def ShouldCreateNIFTI(self):
"""
......@@ -783,8 +800,13 @@ class DICOMSeries(object):
know of the series, as to whether we should create a NIFTI
image.
"""
return (self.IsOriginal and self.IsContiguous and self.IsSingleOrientation) and \
not self.IsPhysiological
if self.IsISSS:
return (self.IsOriginal and self.IsSingleOrientation) and \
not self.IsPhysiological
else:
return (self.IsOriginal and self.IsContiguous and self.IsSingleOrientation) and \
not self.IsPhysiological
@property
def EchoTimes(self):
......
......@@ -123,7 +123,7 @@ class IncomingProcessor(object):
unlink(fname)
# We need to check whether our series is an error series
if not series.IsContiguous:
if not series.IsISSS and not series.IsContiguous:
# Just move everything to the error directory (including dups)
# Make an error directory
errordir = mkdtemp(prefix=series.seriesUID, dir=self.dest_error)
......
......@@ -48,7 +48,7 @@ class TestCaseSiemensLocaliser(BaseStudySeriesTests):
'seriesdatetime': '20170329150157',
'mosaic_type': False, 'original_type': True,
'singleorientation_type': False, 'contiguous_type': True,
'create_nifti': False, 'physio': False,
'isss_type': False, 'create_nifti': False, 'physio': False,
'series_description': 'localizer',
'sanitised_series_description': 'localizer',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2017032915015871464421212'}
......@@ -80,12 +80,44 @@ class TestCaseSiemensFMRIMosaicCoronal(BaseStudySeriesTests):
'seriesdatetime': '20170329151117',
'mosaic_type': True, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'fmri_tr3_192mm_3mm_iso cor',
'sanitised_series_description': 'fmri_tr3_192mm_3mm_iso_cor',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2017032915111276911825587'}
}
class TestCaseSiemensFMRIISSS(BaseStudySeriesTests):
inputs_dirs = ['siemens/isss']
exp_study_info = {
'1.3.12.2.1107.5.2.43.66095.30000019120311083690300000004':
{'study_description': 'C1008a',
'sanitised_study_description': 'C1008a',
'studydate': '20191203', 'studytime': '120328',
'studydatetime': '20191203120328',
'patientid': 'E2000',
'sanitised_patientid': 'E2000'
}
}
exp_series = {'1.3.12.2.1107.5.2.43.66095.30000019120311083690300000004':
['1.3.12.2.1107.5.2.43.66095.2019120312153725194892971.0.0.0'] }
exp_series_info = {
'1.3.12.2.1107.5.2.43.66095.2019120312153725194892971.0.0.0':
{'series_number': 2, 'sanitised_series_number': '2',
'num_image_files': 63,
'seriesdate': '20191203', 'seriestime': '121655',
'seriesdatetime': '20191203121655',
'mosaic_type': True, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': False,
'isss_type': True, 'create_nifti': True, 'physio': False,
'series_description': 'ContextRun1',
'sanitised_series_description': 'ContextRun1',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2019120312160294144793204'}
}
# Test copying the raw data to a directory
class TestCaseSiemensCopyRawFiles(BaseIncomingTest):
inputs_dirs = ['siemens/12']
......@@ -177,6 +209,7 @@ class TestCaseSiemensFMRINormal(BaseStudySeriesTests):
'mosaic_type': False, 'original_type': True,
'create_nifti': True, 'physio': False,
'singleorientation_type': True, 'contiguous_type': True,
'isss_type': False,
'series_description': 'ep2d_FMRI non moco no mosaic axial',
'sanitised_series_description': 'ep2d_FMRI_non_moco_no_mosaic_axial',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2017032915141333115325858',
......@@ -213,7 +246,7 @@ class TestCaseSiemensGREFieldMap(BaseStudySeriesTests):
'seriesdatetime': '20170329152011',
'mosaic_type': False, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'gre_field_mapping_ECHO1',
'sanitised_series_description': 'gre_field_mapping_ECHO1',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2017032915201213377226475',
......@@ -225,7 +258,7 @@ class TestCaseSiemensGREFieldMap(BaseStudySeriesTests):
'seriesdatetime': '20170329152011',
'mosaic_type': False, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'gre_field_mapping_ECHO2',
'sanitised_series_description': 'gre_field_mapping_ECHO2',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2017032915201278528626575',
......@@ -263,7 +296,7 @@ class TestCaseSiemensMultiEchoSeries(BaseStudySeriesTests):
'seriesdatetime': '20190124121222',
'mosaic_type': True, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO1',
'sanitised_series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO1',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2019012412121947061227498',
......@@ -275,7 +308,7 @@ class TestCaseSiemensMultiEchoSeries(BaseStudySeriesTests):
'seriesdatetime': '20190124121222',
'mosaic_type': True, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO2',
'sanitised_series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO2',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2019012412121949327027503',
......@@ -287,7 +320,7 @@ class TestCaseSiemensMultiEchoSeries(BaseStudySeriesTests):
'seriesdatetime': '20190124121222',
'mosaic_type': True, 'original_type': True,
'singleorientation_type': True, 'contiguous_type': True,
'create_nifti': True, 'physio': False,
'isss_type': False, 'create_nifti': True, 'physio': False,
'series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO3',
'sanitised_series_description': 'MB2_ME3_GRAPPA2_AXIAL_INTERLEAVED_ECHO3',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2019012412121949388227504',
......@@ -321,7 +354,7 @@ class TestCaseSiemensCSAReport(BaseStudySeriesTests):
'seriesdatetime': '20170329155626',
'mosaic_type': False, 'original_type': True,
'singleorientation_type': False, 'contiguous_type': True,
'create_nifti': False, 'physio': False,
'isss_type': False, 'create_nifti': False, 'physio': False,
'series_description': 'PhoenixZIPReport',
'sanitised_series_description': 'PhoenixZIPReport',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.30000017032907295838900000072',
......@@ -353,7 +386,7 @@ class TestCaseSiemensPhysiologicalData(BaseStudySeriesTests):
'seriesdatetime': '20181011142011',
'mosaic_type': False, 'original_type': True,
'singleorientation_type': False, 'contiguous_type': True,
'create_nifti': False, 'physio': True,
'isss_type': False, 'create_nifti': False, 'physio': True,
'series_description': 'CURR_cmmr_MB0_ms_MB1_PhysioLog',
'sanitised_series_description': 'CURR_cmmr_MB0_ms_MB1_PhysioLog',
'lowest_image_uid': '1.3.12.2.1107.5.2.43.66095.2018101114201272307559809',
......
......@@ -348,6 +348,11 @@ class BaseStudySeriesTests(BaseIncomingTest):
self._test_series_attribute('IsContiguous',
'contiguous_type')
def test_is_isss(self):
self._test_series_attribute('IsISSS',
'isss_type')
def test_is_physio(self):
self._test_series_attribute('IsPhysiological',
'physio')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment