def _select_template(template): from niworkflows.utils.misc import get_template_specs template, specs = template template = template.split(':')[0] # Drop any cohort modifier if present specs = specs.copy() specs['suffix'] = specs.get('suffix', 'T1w') # Sanitize resolution res = specs.pop('res', None) or specs.pop('resolution', None) or 'native' # workaround for templates without res- identifier if template in ('UNCInfant', ): res = None if res != 'native': specs['resolution'] = res return get_template_specs(template, template_spec=specs)[0] # Map nonstandard resolutions to existing resolutions specs['resolution'] = 2 try: out = get_template_specs(template, template_spec=specs) except RuntimeError: specs['resolution'] = 1 out = get_template_specs(template, template_spec=specs) return out[0]
def _select_template(template, template_specs): from niworkflows.utils.misc import get_template_specs specs = template_specs[template] specs['suffix'] = specs.get('suffix', 'T1w') return get_template_specs(template, template_spec=specs)[0]
def _get_template(template, template_spec, suffix='T1w', desc=None): from niworkflows.utils.misc import get_template_specs template_spec['suffix'] = suffix template_spec['desc'] = desc return get_template_specs(template, template_spec=template_spec)[0]