def setUp(self):
        self.config = GadgetronConfig()

        path = 'mr_utils/test_data/tests/gadgetron/client/'
        file = 'grappa_test_data.h5'
        load_test_data(path, [file], do_return=False)
        self.filename = '%s/%s' % (path, file)
Exemple #2
0
def epi():
    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('ReconX', 'EPIReconXGadget')
    config.add_gadget('EPICorr')
    config.add_gadget('FFTX', dll='gadgetron_epi')
    config.add_gadget('AccTrig',
                      'AcquisitionAccumulateTriggerGadget',
                      props=[('trigger_dimension', 'repetition'),
                             ('sorting_dimension', 'slice')])
    config.add_gadget('Buff',
                      'BucketToBufferGadget',
                      props=[('N_dimension', ''), ('S_dimension', ''),
                             ('split_slices', 'true'),
                             ('ignore_segment', 'true')])
    config.add_gadget('FFT')
    config.add_gadget('Combine')
    config.add_gadget('Extract')
    config.add_gadget('AutoScale')
    config.add_gadget('FloatToShort', 'FloatToUShortGadget')
    config.add_gadget('ImageFinish')
    return (config)
Exemple #3
0
def distributed_image_default():
    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1022', 'MRIImageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_writer('1008', 'GadgetIsmrmrdAcquisitionMessageWriter')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('AccTrig',
                      'AcquisitionAccumulateTriggerGadget',
                      props=[('trigger_dimension', 'repetition'),
                             ('sorting_dimension', 'slice')])
    config.add_gadget('Buff',
                      'BucketToBufferGadget',
                      props=[('N_dimension', ''), ('S_dimension', ''),
                             ('split_slices', 'true')])
    config.add_gadget('SimpleRecon')
    config.add_gadget('ImageArraySplit')

    config.add_gadget('Distribute',
                      'IsmrmrdImageDistributeGadget',
                      dll='gadgetron_distributed',
                      props=[('parallel_dimension', 'repetition'),
                             ('use_this_node_for_compute', 'true'),
                             ('single_package_mode', 'true')])
    config.add_gadget('Extract')
    config.add_gadget('Collect', dll='gadgetron_distributed')
    config.add_gadget('ImageSort', props=[('sorting_dimension', 'repetition')])
    config.add_gadget('ImageFinish')
    return (config)
Exemple #4
0
 def setUp(self):
     self.config = GadgetronConfig()
     self.filename = GadgetronClient.grappa_input_filename()
Exemple #5
0
class GadgetronConfigTestCase(unittest.TestCase):

    def setUp(self):
        self.config = GadgetronConfig()
        self.filename = GadgetronClient.grappa_input_filename()

    def test_create_xml(self):
        self.config.add_reader(1008,'GadgetIsmrmrdAcquisitionMessageReader')
        self.config.add_writer(1004,'MRIImageWriterCPLX')
        self.config.add_writer(1005,'MRIImageWriterFLOAT')
        self.config.add_writer(1006,'MRIImageWriterUSHORT')
        self.config.add_gadget('Acc','AccumulatorGadget')
        self.config.add_gadget('FFT')
        self.config.add_gadget('Extract')
        self.config.add_gadget('ImageFinishFLOAT','ImageFinishGadgetFLOAT')
        # self.config.print()

    def test_create_default_config(self):
        config = configs.default()
        truth = GadgetronTestConfig.default_config()
        res = len(main.diff_texts(truth.encode(),config.tostring().encode()))
        self.assertTrue(res == 0)

    def test_use_default_config(self):
        # Give the filename of raw data to the client
        filename = GadgetronClient.raw_input_filename()

        # Send gadgetron the local default configuration file
        config = configs.default()
        # print(config)
        # data,header = client(filename,config_local=config.get_filename())
        data,header = client(filename,config_local=config.tostring())

        # Make sure the output is the same as when h5 is given
        true_output_data = GadgetronClient.true_output_data()
        self.assertTrue(np.allclose(data,true_output_data))

    def test_use_grappa_cpu_config(self):
        config = configs.grappa_cpu()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='grappa_cpu.xml')
        self.assertTrue(np.allclose(data,data_true))

    def test_use_grappa_float_cpu_config(self):
        config = configs.grappa_float_cpu()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='grappa_float_cpu.xml')
        self.assertTrue(np.allclose(data,data_true))

    def test_use_grappa_unoptimized_cpu_config(self):
        config = configs.grappa_unoptimized_cpu()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='grappa_unoptimized.xml')
        self.assertTrue(np.allclose(data,data_true))

    def test_use_grappa_unoptimized_float_cpu_config(self):
        config = configs.grappa_unoptimized_float_cpu()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='grappa_unoptimized_float.xml')
        self.assertTrue(np.allclose(data,data_true))

    def test_use_distributed_default_config(self):
        config = configs.distributed_default()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='distributed_default.xml')
        self.assertTrue(np.allclose(data,data_true))

    def test_use_distributed_image_default_config(self):
        config = configs.distributed_image_default()
        data,header = client(self.filename,config_local=config.tostring())
        data_true,header_true = client(self.filename,config='distributed_image_default.xml')
        self.assertTrue(np.allclose(data,data_true))
Exemple #6
0
    data = '%s/%s' % (path, file)

    # Look at the data to make sure we got what we got
    with h5py.File(data, 'r') as f:
        coil_images = f['dataset']['coil_images']
        coil_images = coil_images['real'] + 1j * coil_images['imag']

        # R = 2
        tmp = np.fft.fft2(coil_images)
        tmp[..., ::2, :] = 0
        aliased = np.fft.ifft2(tmp)
        view(aliased, montage_axis=0)

    # Make the config
    num_coils = 16
    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('CoilReduction', props=[('coils_out', str(num_coils))])
    # RO asymmetric echo handling
    config.add_gadget('AsymmetricEcho', 'AsymmetricEchoAdjustROGadget')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('Grappa',
                      props=[
                          ('target_coils', str(num_coils)),
                          ('use_gpu', 'false'),
                          ('uncombined_channels',
                           ','.join(str(x) for x in range(num_coils))),
                      ])
Exemple #7
0
def python_short():
    # pylint: disable=C0301
    '''python_short.xml

    Generates [2]_.

    References
    ==========
    .. [2] https://github.com/gadgetron/gadgetron/blob/master/gadgets/python/config/python_short.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('RemoveOversamplingPython',
                      'PythonGadget',
                      props=[
                          ('python_path', '/home/myuser/scripts/python'),
                          ('python_module', 'remove_2x_oversampling'),
                          ('python_class', 'Remove2xOversampling'),
                      ])
    config.add_gadget('AccReconPython',
                      'PythonGadget',
                      props=[
                          ('python_path', '/home/myuser/scripts/python'),
                          ('python_module', 'accumulate_and_recon'),
                          ('python_class', 'AccumulateAndRecon'),
                      ])
    config.add_gadget('CoilCombinePython',
                      'PythonGadget',
                      props=[
                          ('python_path', '/home/myuser/scripts/python'),
                          ('python_module', 'rms_coil_combine'),
                          ('python_class', 'RMSCoilCombine'),
                      ])
    config.add_gadget('Extract')
    config.add_gadget('AutoScale')
    config.add_gadget('FloatToShort', 'FloatToUShortGadget')
    config.add_gadget('ImageFinish')
    return config
Exemple #8
0
def grappa_float_cpu():
    config = GadgetronConfig()
    config.add_reader('1008','GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026','GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022','MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('PCA','PCACoilGadget')
    config.add_gadget('CoilReduction',props=[
        ('coils_out','16')
    ])
    config.add_gadget('AsymmetricEcho','AsymmetricEchoAdjustROGadget') # RO asymmetric echo handling
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('Grappa',props=[
        ('target_coils','8'),
        ('use_gpu','false')
    ])
    config.add_gadget('GrappaUnmixing')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinish')
    return(config)
Exemple #9
0
def grappa_unoptimized_float_cpu():
    # pylint: disable=C0301
    '''Generates grappa_unoptimized_float_cpu.xml.

    Generates [4]_.

    References
    ==========
    .. [4] https://github.com/gadgetron/gadgetron/blob/master/gadgets/grappa/config/grappa_unoptimized_float.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('Grappa',
                      props=[('target_coils', '8'), ('use_gpu', 'false')])
    config.add_gadget('GrappaUnmixing')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinish')
    return config
Exemple #10
0
def default():
    config = GadgetronConfig()
    config.add_reader('1008','GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026','GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022','MRIImageWriter')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('AccTrig','AcquisitionAccumulateTriggerGadget',props=[
        ('trigger_dimension','repetition'),
        ('sorting_dimension','slice')
    ])
    config.add_gadget('Buff','BucketToBufferGadget',props=[
        ('N_dimension',''),
        ('S_dimension',''),
        ('split_slices','true')
    ])
    config.add_gadget('SimpleRecon')
    config.add_gadget('ImageArraySplit')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinish')
    return(config)
Exemple #11
0
def grappa_cpu():
    # pylint: disable=C0301
    '''Generates grappa_cpu.xml.

    Generates [1]_.

    References
    ==========
    .. [1] https://github.com/gadgetron/gadgetron/blob/master/gadgets/grappa/config/grappa_cpu.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('PCA', 'PCACoilGadget')
    config.add_gadget('CoilReduction', props=[('coils_out', '16')])
    # RO asymmetric echo handling
    config.add_gadget('AsymmetricEcho', 'AsymmetricEchoAdjustROGadget')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('Grappa',
                      props=[('target_coils', '8'), ('use_gpu', 'false')])
    config.add_gadget('GrappaUnmixing')
    config.add_gadget('Extract')
    config.add_gadget('AutoScale')
    config.add_gadget('FloatToShort', 'FloatToUShortGadget')
    config.add_gadget('ImageFinish')
    return config
from mr_utils.test_data import load_test_data
from mr_utils.definitions import ROOT_DIR
from mr_utils import view

if __name__ == '__main__':

    # Load in a numerical phantom to play around with
    path = 'mr_utils/test_data/tests/gadgetron/client/'
    file = 'input.h5'
    load_test_data(path, [file], do_return=False)
    data = '%s/%s' % (path, file)

    # Make a config
    script_dir = 'tmp/'
    default_dir = ''
    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('RemoveOversamplingPython',
                      'PythonGadget',
                      props=[
                          ('python_path', default_dir),
                          ('python_module', 'remove_2x_oversampling'),
                          ('python_class', 'Remove2xOversampling'),
                      ])
    config.add_gadget('AccReconPython',
                      'PythonGadget',
                      props=[
                          ('python_path', default_dir),
                          ('python_module', 'accumulate_and_recon'),
Exemple #13
0
def distributed_default():
    # pylint: disable=C0301
    '''Generates distributed_default.xml.

    Generates [1]_.

    References
    ==========
    .. [1] https://github.com/gadgetron/gadgetron/blob/master/gadgets/distributed/config/distributed_default.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1022', 'MRIImageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_writer('1008', 'GadgetIsmrmrdAcquisitionMessageWriter')
    config.add_gadget('Distribute',
                      'IsmrmrdAcquisitionDistributeGadget',
                      dll='gadgetron_distributed',
                      props=[('parallel_dimension', 'repetition'),
                             ('use_this_node_for_compute', 'true')])
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('AccTrig',
                      'AcquisitionAccumulateTriggerGadget',
                      props=[('trigger_dimension', 'repetition'),
                             ('sorting_dimension', 'slice')])
    config.add_gadget('Buff',
                      'BucketToBufferGadget',
                      props=[('N_dimension', ''), ('S_dimension', ''),
                             ('split_slices', 'true')])
    config.add_gadget('SimpleRecon')
    config.add_gadget('ImageArraySplit')
    config.add_gadget('Collect', dll='gadgetron_distributed')
    config.add_gadget('Extract')
    config.add_gadget('Sort',
                      'ImageSortGadget',
                      props=[('sorting_dimension', 'repetition')])
    config.add_gadget('ImageFinish')
    return config
Exemple #14
0
'''Example of how to programmatically generate a config file.'''

from mr_utils.gadgetron import GadgetronConfig

if __name__ == '__main__':

    config = GadgetronConfig()
    config.add_reader(1008, 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_writer(1004, 'MRIImageWriterCPLX')
    config.add_writer(1005, 'MRIImageWriterFLOAT')
    config.add_writer(1006, 'MRIImageWriterUSHORT')
    config.add_gadget('Acc', 'AccumulatorGadget')
    config.add_gadget('FFT')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinishFLOAT', 'ImageFinishGadgetFLOAT')
    print(config.tostring())
Exemple #15
0
def epi_gtplus_grappa():
    '''GT Plus configuration file for general 2D epi reconstruction.'''

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('ReconX', 'EPIReconXGadget')
    config.add_gadget('EPICorr')
    config.add_gadget('FFTX', dll='gadgetron_epi')
    config.add_gadget('Acc',
                      'GtPlusAccumulatorWorkOrderTriggerGadget',
                      props=[('verboseMode', 'false'),
                             ('noacceleration_triggerDim1', 'DIM_Repetition'),
                             ('noacceleration_triggerDim2', 'DIM_NONE'),
                             ('noacceleration_numOfKSpace_triggerDim1', '1'),
                             ('separate_triggerDim1', 'DIM_Repetition'),
                             ('separate_triggerDim2', 'DIM_NONE'),
                             ('separate_numOfKSpace_triggerDim1', '1'),
                             ('other_kspace_matching_Dim', 'DIM_Repetition')])

    # Recon computation for 2DT cases
    config.add_gadget(
        'Recon',
        'GtPlusRecon2DTGadget',
        props=[
            # kspace data
            ('dim_4th', 'DIM_Contrast'),
            ('dim_5th', 'DIM_Slice'),

            # ork flow
            ('workOrder_ShareDim', 'DIM_Repetition'),

            # o accelaration mode
            ('no_acceleration_averageall_ref', 'true'),
            ('no_acceleration_ref_numOfModes', '0'),
            ('no_acceleration_same_combinationcoeff_allS', 'false'),
            ('no_acceleration_whichS_combinationcoeff', '0'),

            # separate mode
            ('separate_averageall_ref', 'true'),
            ('separate_ref_numOfModes', '0'),
            ('separate_fullres_coilmap', 'false'),
            ('separate_same_combinationcoeff_allS', 'false'),
            ('separate_whichS_combinationcoeff', '0'),

            # coil compression
            ('same_coil_compression_coeff_allS', 'false'),
            ('downstream_coil_compression', 'false'),
            ('coil_compression_thres', '-1'),
            ('coil_compression_num_modesKept', '-1'),

            # parameters for coil map estimation
            ('coil_map_algorithm', 'ISMRMRD_SOUHEIL'),
            ('csm_kSize', '7'),
            ('csm_powermethod_num', '3'),
            ('csm_true_3D', 'false'),
            ('csm_iter_num', '5'),
            ('csm_iter_thres', '0.001'),

            # algorithm
            ('recon_algorithm', 'ISMRMRD_GRAPPA'),
            ('recon_kspace_needed', 'false'),
            ('recon_auto_parameters', 'true'),

            # parameters for ISMRMRD_GRAPPA
            ('grappa_kSize_RO', '5'),
            ('grappa_kSize_E1', '4'),
            ('grappa_kSize_E2', '4'),
            ('grappa_reg_lamda', '0.0005'),
            ('grappa_calib_over_determine_ratio', '0'),

            # parameters for scaling and image sending
            ('min_intensity_value', '64'),
            ('max_intensity_value', '4095'),
            ('scalingFactor', '-1.0'),
            ('use_constant_scalingFactor', 'false'),

            # parameters for kspace filter, image data
            ('filterRO', 'Gaussian'),
            ('filterRO_sigma', '1.0'),
            ('filterRO_width', '0.15'),
            ('filterE1', 'Gaussian'),
            ('filterE1_sigma', '1.0'),
            ('filterE1_width', '0.15'),
            ('filterE2', 'Gaussian'),
            ('filterE2_sigma', '1.0'),
            ('filterE2_width', '0.15'),

            # parameters for kspace filter, ref data
            ('filterRefRO', 'Hanning'),
            ('filterRefRO_sigma', '1.5'),
            ('filterRefRO_width', '0.15'),
            ('filterRefE1', 'Hanning'),
            ('filterRefE1_sigma', '1.5'),
            ('filterRefE1_width', '0.15'),
            ('filterRefE2', 'Hanning'),
            ('filterRefE2_sigma', '1.5'),
            ('filterRefE2_width', '0.15'),

            # parameters for debug and timing
            ('debugFolder', ''),
            ('debugFolder2', ''),
            ('cloudNodeFile', 'myCloud_2DT.txt'),
            ('performTiming', 'true'),
            ('verboseMode', 'false'),

            # parameters for system acquisition
            ('timeStampResolution', '0.0025'),

            # parameters for recon job split
            ('job_split_by_S', 'false'),
            ('job_num_of_N', '32'),
            ('job_max_Megabytes', '10240'),
            ('job_overlap', '2'),
            ('job_perform_on_control_node', 'true')
        ])
    config.add_gadget('ComplexToFloatAttrib', 'ComplexToFloatGadget')
    config.add_gadget('FloatToShortAttrib', 'FloatToUShortGadget')
    config.add_gadget('ImageFinish')
    return (config)
Exemple #16
0
def default():
    # pylint: disable=C0301
    '''Default config file, default.xml.

    Generates [1]_.

    References
    ==========
    .. [1] https://github.com/gadgetron/gadgetron/blob/master/gadgets/mri_core/config/default.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('AccTrig',
                      'AcquisitionAccumulateTriggerGadget',
                      props=[('trigger_dimension', 'repetition'),
                             ('sorting_dimension', 'slice')])
    config.add_gadget('Buff',
                      'BucketToBufferGadget',
                      props=[('N_dimension', ''), ('S_dimension', ''),
                             ('split_slices', 'true')])
    config.add_gadget('SimpleRecon')
    config.add_gadget('ImageArraySplit')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinish')
    return config
Exemple #17
0
def generic_cartesian_grappa():
    config = GadgetronConfig()
    config.add_reader('1008','GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026','GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022','MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('AsymmetricEcho','AsymmetricEchoAdjustROGadget')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('AccTrig','AcquisitionAccumulateTriggerGadget',props=[
        ('trigger_dimension',''),
        ('sorting_dimension','')
    ])
    config.add_gadget('BucketToBuffer',props=[
        ('N_dimension','contrast'),
        ('S_dimension','average'),
        ('split_slices','false'),
        ('ignore_segment','true'),
        ('verbose','true')
    ])
    config.add_gadget('PrepRef','GenericReconCartesianReferencePrepGadget',props=[
        ('debug_folder',''),
        ('perform_timing','true'),
        ('verbose','true'),
        ('average_all_ref_N','true'),
        ('average_all_ref_S','true'),
        ('prepare_ref_always','true')
    ])
    config.add_gadget('CoilCompression','GenericReconEigenChannelGadget',props=[
        ('debug_folder',''),
        ('perform_timing','true'),
        ('verbose','true'),
        ('average_all_ref_N','true'),
        ('average_all_ref_S','true'),
        ('upstream_coil_compression','true'),
        ('upstream_coil_compression_thres','0.002'),
        ('upstream_coil_compression_num_modesKept','0')
    ])
    config.add_gadget('Recon','GenericReconCartesianGrappaGadget',props=[
        ('image_series','0'),
        ('coil_map_algorithm','Inati'),
        ('downstream_coil_compression','true'),
        ('downstream_coil_compression_thres','0.01'),
        ('downstream_coil_compression_num_modesKept','0'),
        ('debug_folder',''),
        ('perform_timing','true'),
        ('verbose','true'),
        ('send_out_gfactor','false')
    ])
    config.add_gadget('PartialFourierHandling','GenericReconPartialFourierHandlingFilterGadget',props=[
        ('debug_folder',''),
        ('perform_timing','false'),
        ('verbose','false'),
        ('skip_processing_meta_field','Skip_processing_after_recon'),
        ('partial_fourier_filter_RO_width','0.15'),
        ('partial_fourier_filter_E1_width','0.15'),
        ('partial_fourier_filter_E2_width','0.15'),
        ('partial_fourier_filter_densityComp','false')
    ])
    config.add_gadget('KSpaceFilter','GenericReconKSpaceFilteringGadget',props=[
        ('debug_folder',''),
        ('perform_timing','false'),
        ('verbose','false'),
        ('skip_processing_meta_field','Skip_processing_after_recon'),
        ('filterRO','Gaussian'),
        ('filterRO_sigma','1.0'),
        ('filterRO_width','0.15'),
        ('filterE1','Gaussian'),
        ('filterE1_sigma','1.0'),
        ('filterE1_width','0.15'),
        ('filterE2','Gaussian'),
        ('filterE2_sigma','1.0'),
        ('filterE2_width','0.15'),
    ])
    config.add_gadget('FOVAdjustment','GenericReconFieldOfViewAdjustmentGadget',props=[
        ('debug_folder',''),
        ('perform_timing','false'),
        ('verbose','false')
    ])
    config.add_gadget('Scaling','GenericReconImageArrayScalingGadget',props=[
        ('perform_timing','false'),
        ('verbose','false'),
        ('min_intensity_value','64'),
        ('max_intensity_value','4095'),
        ('scalingFactor','10.0'),
        ('use_constant_scalingFactor','true'),
        ('auto_scaling_only_once','true'),
        ('scalingFactor_dedicated','100.0')
    ])
    config.add_gadget('ImageArraySplit')
    config.add_gadget('ComplexToFloatAttrib','ComplexToFloatGadget')
    config.add_gadget('FloatToShortAttrib','FloatToUShortGadget',props=[
        ('max_intensity','32767'),
        ('min_intensity','0'),
        ('intensity_offset','0')
    ])
    config.add_gadget('ImageFinish')
    return(config)
Exemple #18
0
    def test_gadgetron_grappa_coil_output(self):

        config = GadgetronConfig()
        config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
        config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
        config.add_writer('1022', 'MRIImageWriter')
        config.add_gadget('RemoveROOversampling')
        config.add_gadget('Grappa',
                          props=[('target_coils', '8'), ('use_gpu', 'false'),
                                 ('uncombined_channels',
                                  '1,2,3,4,5,6,7,8,9,10,11,12')])
        config.add_gadget('GrappaUnmixing')
        config.add_gadget('Extract',
                          props=[('extract_magnitude', 'false')('extract_real',
                                                                'true'),
                                 ('extract_imag', 'true')])
        config.add_gadget('ImageFinish')

        data, header = client(self.filename, config_local=config.tostring())
        data = data[0, ...] + 1j * data[1, ...]
        view(data, montage_axis=0)
Exemple #19
0
def grappa_unoptimized_float_cpu():
    config = GadgetronConfig()
    config.add_reader('1008','GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026','GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022','MRIImageWriter')
    config.add_gadget('RemoveROOversampling')
    config.add_gadget('Grappa',props=[
        ('target_coils','8'),
        ('use_gpu','false')
    ])
    config.add_gadget('GrappaUnmixing')
    config.add_gadget('Extract')
    config.add_gadget('ImageFinish')
    return(config)
Exemple #20
0
def epi():
    # pylint: disable=C0301
    '''Generates epi.xml.

    Generates [1]_.

    References
    ==========
    .. [1] https://github.com/gadgetron/gadgetron/blob/master/gadgets/epi/epi.xml
    '''
    # pylint: enable=C0301

    config = GadgetronConfig()
    config.add_reader('1008', 'GadgetIsmrmrdAcquisitionMessageReader')
    config.add_reader('1026', 'GadgetIsmrmrdWaveformMessageReader')
    config.add_writer('1022', 'MRIImageWriter')
    config.add_gadget('NoiseAdjust')
    config.add_gadget('ReconX', 'EPIReconXGadget')
    config.add_gadget('EPICorr')
    config.add_gadget('FFTX', dll='gadgetron_epi')
    config.add_gadget('AccTrig',
                      'AcquisitionAccumulateTriggerGadget',
                      props=[('trigger_dimension', 'repetition'),
                             ('sorting_dimension', 'slice')])
    config.add_gadget('Buff',
                      'BucketToBufferGadget',
                      props=[('N_dimension', ''), ('S_dimension', ''),
                             ('split_slices', 'true'),
                             ('ignore_segment', 'true')])
    config.add_gadget('FFT')
    config.add_gadget('Combine')
    config.add_gadget('Extract')
    config.add_gadget('AutoScale')
    config.add_gadget('FloatToShort', 'FloatToUShortGadget')
    config.add_gadget('ImageFinish')
    return config