Exemplo n.º 1
0
                                         "{}:{}".format(subj_id, visit_id))
                if subj_id == 'subject1' and visit_id == 'visit3':
                    self.assertNotIn(
                        'ten', [d.name for d in session.filesets],
                        "'ten' should not be generated for "
                        "subject1:visit3 as hundred and thousand are "
                        "already present")


test1_format = FileFormat('test1', extension='.t1')
test2_format = FileFormat('test2',
                          extension='.t2',
                          converters={'test1': IdentityConverter})
test3_format = FileFormat('test3', extension='.t3')

FileFormat.register(test1_format)
FileFormat.register(test2_format)
FileFormat.register(test3_format)


class TestInputValidationStudy(with_metaclass(StudyMetaClass, Study)):

    add_data_specs = [
        AcquiredFilesetSpec('a', (test1_format, test2_format)),
        AcquiredFilesetSpec('b', test3_format),
        FilesetSpec('c', test2_format, 'identity_pipeline'),
        FilesetSpec('d', test3_format, 'identity_pipeline')
    ]

    def identity_pipeline(self, **name_maps):
        pipeline = self.pipeline(
Exemplo n.º 2
0
png_format = FileFormat(name='png', extension='.png')
jpg_format = FileFormat(name='jpg', extension='.jpg')

# PET formats
list_mode_format = FileFormat(name='pet_list_mode', extension='.bf')

# Raw formats
dat_format = FileFormat(name='dat', extension='.dat')

# MRS format
rda_format = FileFormat(name='raw', extension='.rda')

# Record list of all data formats registered by module (not really
# used currently but could be useful in future)
registered_file_formats = []

# Register all data formats in module
for file_format in copy(globals()).values():
    if isinstance(file_format, FileFormat):
        FileFormat.register(file_format)
        registered_file_formats.append(file_format.name)

# Since the conversion from DICOM->NIfTI is unfortunately slightly
# different between MRConvert and Dcm2niix, these data formats can
# be used in pipeline input specs that need to use MRConvert instead
# of Dcm2niix (i.e. motion-detection pipeline)
mrconvert_nifti_format = deepcopy(nifti_format)
mrconvert_nifti_format._converters['dicom'] = MrtrixConverter
mrconvert_nifti_gz_format = deepcopy(nifti_gz_format)
mrconvert_nifti_gz_format._converters['dicom'] = MrtrixConverter