How to use the niworkflows.utils.spaces.Reference function in niworkflows

To help you get started, we’ve selected a few niworkflows examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nipreps / dmriprep / test_docs / api / dmriprep-workflows-base-2.py View on Github external
wf = init_single_subject_wf(
    anat_only=False,
    debug=False,
    force_syn=True,
    freesurfer=True,
    hires=True,
    ignore=[],
    layout=BIDSLayout('.'),
    longitudinal=False,
    low_mem=False,
    name='single_subject_wf',
    omp_nthreads=1,
    output_dir='.',
    reportlets_dir='.',
    skull_strip_fixed_seed=False,
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(
        spaces=['MNI152Lin',
                ('fsaverage', {'density': '10k'}),
                'T1w',
                'fsnative'],
        checkpoint=True),
    subject_id='test',
    use_syn=True,
)
github poldracklab / niworkflows / niworkflows / utils / spaces.py View on Github external
def check_space(space):
        """Build a :class:`Reference` object."""
        try:
            if isinstance(space, Reference):
                return space
        except IndexError:
            pass

        spec = {}
        if not isinstance(space, str):
            try:
                spec = space[1] or {}
            except IndexError:
                pass
            except TypeError:
                space = (None,)

            space = space[0]
        return Reference(space, spec)
github poldracklab / smriprep / 0.4.0rc4 / api / smriprep-workflows-anatomical-1.py View on Github external
from niworkflows.utils.spaces import SpatialReferences, Reference
from smriprep.workflows.anatomical import init_anat_preproc_wf
wf = init_anat_preproc_wf(
    bids_root='.',
    freesurfer=True,
    hires=True,
    longitudinal=False,
    t1w=['t1w.nii.gz'],
    omp_nthreads=1,
    output_dir='.',
    skull_strip_mode='force',
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(spaces=['MNI152NLin2009cAsym', 'fsaverage5']),
)
github nipreps / dmriprep / api / dmriprep-workflows-base-2.py View on Github external
wf = init_single_subject_wf(
    anat_only=False,
    debug=False,
    force_syn=True,
    freesurfer=True,
    hires=True,
    ignore=[],
    layout=BIDSLayout('.'),
    longitudinal=False,
    low_mem=False,
    name='single_subject_wf',
    omp_nthreads=1,
    output_dir='.',
    reportlets_dir='.',
    skull_strip_fixed_seed=False,
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(
        spaces=['MNI152Lin',
                ('fsaverage', {'density': '10k'}),
                'T1w',
                'fsnative'],
        checkpoint=True),
    subject_id='test',
    use_syn=True,
)
github poldracklab / smriprep / 0.5.3 / api / smriprep-workflows-anatomical-1.py View on Github external
from niworkflows.utils.spaces import SpatialReferences, Reference
from smriprep.workflows.anatomical import init_anat_preproc_wf
wf = init_anat_preproc_wf(
    bids_root='.',
    freesurfer=True,
    hires=True,
    longitudinal=False,
    t1w=['t1w.nii.gz'],
    omp_nthreads=1,
    output_dir='.',
    skull_strip_mode='force',
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(spaces=['MNI152NLin2009cAsym', 'fsaverage5']),
)
github nipreps / dmriprep / 0.2.1 / api / dmriprep-workflows-base-1.py View on Github external
wf = init_dmriprep_wf(
    anat_only=False,
    debug=False,
    force_syn=True,
    freesurfer=True,
    fs_subjects_dir=None,
    hires=True,
    ignore=[],
    layout=BIDSLayout('.'),
    longitudinal=False,
    low_mem=False,
    omp_nthreads=1,
    output_dir='.',
    run_uuid='X',
    skull_strip_fixed_seed=False,
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(
        spaces=['MNI152Lin',
                ('fsaverage', {'density': '10k'}),
                'T1w',
                'fsnative'],
        checkpoint=True),
    subject_list=['dmripreptest'],
    use_syn=True,
    work_dir='.',
)
github nipreps / dmriprep / dmriprep / config / __init__.py View on Github external
def get(cls):
        """Return defined settings."""
        out = {}
        for k, v in cls.__dict__.items():
            if k.startswith("_") or v is None:
                continue
            if callable(getattr(cls, k)):
                continue
            if k in cls._paths:
                v = str(v)
            if isinstance(v, _SRs):
                v = " ".join([str(s) for s in v.references]) or None
            if isinstance(v, _Ref):
                v = str(v) or None
            out[k] = v
        return out
github poldracklab / niworkflows / niworkflows / utils / spaces.py View on Github external
if isinstance(space, Reference):
                return space
        except IndexError:
            pass

        spec = {}
        if not isinstance(space, str):
            try:
                spec = space[1] or {}
            except IndexError:
                pass
            except TypeError:
                space = (None,)

            space = space[0]
        return Reference(space, spec)
github poldracklab / smriprep / master / api / smriprep-workflows-anatomical-1.py View on Github external
from niworkflows.utils.spaces import SpatialReferences, Reference
from smriprep.workflows.anatomical import init_anat_preproc_wf
wf = init_anat_preproc_wf(
    bids_root='.',
    freesurfer=True,
    hires=True,
    longitudinal=False,
    t1w=['t1w.nii.gz'],
    omp_nthreads=1,
    output_dir='.',
    skull_strip_mode='force',
    skull_strip_template=Reference('OASIS30ANTs'),
    spaces=SpatialReferences(spaces=['MNI152NLin2009cAsym', 'fsaverage5']),
)