def test_ApplyTransform_outputs():
    output_map = dict(out_file=dict())
    outputs = ApplyTransform.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value
def test_ApplyTransform_outputs():
    output_map = dict(out_file=dict(), )
    outputs = ApplyTransform.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value
def test_ApplyTransform_inputs():
    input_map = dict(
        ignore_exception=dict(
            nohash=True,
            usedefault=True,
        ),
        in_file=dict(
            copyfile=True,
            mandatory=True,
        ),
        mat=dict(mandatory=True, ),
        matlab_cmd=dict(),
        mfile=dict(usedefault=True, ),
        out_file=dict(genfile=True, ),
        paths=dict(),
        use_mcr=dict(),
        use_v8struct=dict(
            min_ver='8',
            usedefault=True,
        ),
    )
    inputs = ApplyTransform.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value
def test_ApplyTransform_inputs():
    input_map = dict(
        ignore_exception=dict(nohash=True, usedefault=True),
        in_file=dict(copyfile=True, mandatory=True),
        mat=dict(mandatory=True),
        matlab_cmd=dict(),
        mfile=dict(usedefault=True),
        out_file=dict(genfile=True),
        paths=dict(),
        use_mcr=dict(),
        use_v8struct=dict(min_ver="8", usedefault=True),
    )
    inputs = ApplyTransform.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value
Beispiel #5
0
    spm.SPMCommand.set_mlab_paths(matlab_cmd=matlab_cmd, use_mcr=True)

    # Test whether spm version is printed to the screen
    spm.SPMCommand().version

    # Setting the parameters from collected arguments

    transf_mat_path = '/data/mat_file/transform.mat'
    tpm_path = '/data/tpm_file/TPM.nii'

    #Create vbm_spm12 dir
    if not os.path.exists(vbm_out + "/vbm_spm12"):
        os.makedirs(vbm_out + "/vbm_spm12")

    # Reorientation node and settings
    reorient = pe.Node(interface=ApplyTransform(), name='reorient')
    reorient.inputs.mat = transf_mat_path
    reorient.inputs.in_file = nifti_file
    reorient.inputs.out_file = vbm_out + "/vbm_spm12/Re.nii"

    # Segementation Node and settings
    segmentation = pe.Node(interface=NewSegment(), name='segmentation')
    segmentation.inputs.channel_info = (0.0001, 60, (False, False))
    Tis1 = ((tpm_path, 1), 1, (True, False), (True, True))
    Tis2 = ((tpm_path, 2), 1, (True, False), (True, True))
    Tis3 = ((tpm_path, 3), 2, (True, False), (True, True))
    Tis4 = ((tpm_path, 4), 3, (True, False), (True, True))
    Tis5 = ((tpm_path, 5), 4, (True, False), (True, True))
    Tis6 = ((tpm_path, 6), 2, (True, False), (True, True))
    segmentation.inputs.tissues = [Tis1, Tis2, Tis3, Tis4, Tis5, Tis6]