Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
)
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)
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']),
)
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,
)
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']),
)
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='.',
)
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
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)
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']),
)