Exemplo n.º 1
0
def test_FilterRegressor_outputs():
    output_map = dict(out_file=dict(), )
    outputs = FilterRegressor.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value
Exemplo n.º 2
0
def test_FilterRegressor_outputs():
    output_map = dict(out_file=dict())
    outputs = FilterRegressor.output_spec()

    for key, metadata in output_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(outputs.traits()[key], metakey), value
Exemplo n.º 3
0
def test_FilterRegressor_inputs():
    input_map = dict(
        args=dict(argstr='%s', ),
        design_file=dict(
            argstr='-d %s',
            mandatory=True,
            position=3,
        ),
        environ=dict(
            nohash=True,
            usedefault=True,
        ),
        filter_all=dict(
            argstr="-f '%s'",
            mandatory=True,
            position=4,
            xor=['filter_columns'],
        ),
        filter_columns=dict(
            argstr="-f '%s'",
            mandatory=True,
            position=4,
            xor=['filter_all'],
        ),
        ignore_exception=dict(
            nohash=True,
            usedefault=True,
        ),
        in_file=dict(
            argstr='-i %s',
            mandatory=True,
            position=1,
        ),
        mask=dict(argstr='-m %s', ),
        out_file=dict(
            argstr='-o %s',
            genfile=True,
            hash_files=False,
            position=2,
        ),
        out_vnscales=dict(argstr='--out_vnscales', ),
        output_type=dict(),
        terminal_output=dict(
            mandatory=True,
            nohash=True,
        ),
        var_norm=dict(argstr='--vn', ),
    )
    inputs = FilterRegressor.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value
Exemplo n.º 4
0
def test_FilterRegressor_inputs():
    input_map = dict(ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    out_file=dict(hash_files=False,
    genfile=True,
    position=2,
    argstr='-o %s',
    ),
    filter_all=dict(mandatory=True,
    position=4,
    xor=['filter_columns'],
    argstr="-f '%s'",
    ),
    out_vnscales=dict(argstr='--out_vnscales',
    ),
    args=dict(argstr='%s',
    ),
    mask=dict(argstr='-m %s',
    ),
    terminal_output=dict(mandatory=True,
    nohash=True,
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    in_file=dict(position=1,
    mandatory=True,
    argstr='-i %s',
    ),
    output_type=dict(),
    filter_columns=dict(xor=['filter_all'],
    position=4,
    mandatory=True,
    argstr="-f '%s'",
    ),
    var_norm=dict(argstr='--vn',
    ),
    design_file=dict(position=3,
    mandatory=True,
    argstr='-d %s',
    ),
    )
    inputs = FilterRegressor.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value
Exemplo n.º 5
0
def test_FilterRegressor_inputs():
    input_map = dict(
        args=dict(argstr="%s"),
        design_file=dict(argstr="-d %s", mandatory=True, position=3),
        environ=dict(nohash=True, usedefault=True),
        filter_all=dict(argstr="-f '%s'", mandatory=True, position=4, xor=["filter_columns"]),
        filter_columns=dict(argstr="-f '%s'", mandatory=True, position=4, xor=["filter_all"]),
        ignore_exception=dict(nohash=True, usedefault=True),
        in_file=dict(argstr="-i %s", mandatory=True, position=1),
        mask=dict(argstr="-m %s"),
        out_file=dict(argstr="-o %s", genfile=True, hash_files=False, position=2),
        out_vnscales=dict(argstr="--out_vnscales"),
        output_type=dict(),
        terminal_output=dict(nohash=True),
        var_norm=dict(argstr="--vn"),
    )
    inputs = FilterRegressor.input_spec()

    for key, metadata in input_map.items():
        for metakey, value in metadata.items():
            yield assert_equal, getattr(inputs.traits()[key], metakey), value
Exemplo n.º 6
0
         glob.glob(curdir + '/*' +
                   curfunc.split('task-')[1].split('_')[0] + '*' +
                   curfunc.split('run-')[1].split('_')[0] + '*' +
                   '*AROMAnoiseICs.csv')[0],
         delimiter=',').astype('int'))
 if (not os.path.isfile(outfile) or
         overwrite) or (not os.path.isfile(tmpAROMA) and overwrite):
     FilterRegressor(
         design_file=glob.glob(
             curdir + '/*' +
             curfunc.split('task-')[1].split('_')[0] + '*' +
             curfunc.split('run-')[1].split('_')[0] + '*' +
             '*MELODIC*.tsv')[0],
         filter_columns=list(
             np.loadtxt(
                 glob.glob(curdir + '/*' +
                           curfunc.split('task-')[1].split('_')[0] +
                           '*' +
                           curfunc.split('run-')[1].split('_')[0] +
                           '*' + '*AROMAnoiseICs.csv')[0],
                 delimiter=',').astype('int')),
         in_file=curfunc,
         mask=curmask,
         out_file=tmpAROMA).run()
 if not os.path.isfile(tmpAROMAconf):
     if not os.path.isfile(tmpAROMAwm) or not os.path.isfile(
             tmpAROMAcsf):
         from nipype.interfaces.fsl.maths import Threshold
         from nipype.interfaces.fsl.utils import ImageMeants
         Threshold(
             in_file=cursegm,