Commit 523a4071 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'rel/3.6.4' into 'v3.6'

Rel/3.6.4

See merge request fsl/fslpy!308
parents ac8f74a1 981055cb
Pipeline #10055 passed with stages
in 1 minute and 28 seconds
......@@ -10,6 +10,7 @@ Added
^^^^^
* New :func:`.epi_reg` wrapper function (!306).
* New :meth:`.fslmaths.kernel` and :meth:`.fslmaths.fmeanu` options on the
:class:`.fslmaths` wrapper (!304).
......
......@@ -110,4 +110,5 @@ from .misc import (fslreorient2std, # noqa
slicer,
cluster,
gps)
from .epi_reg import epi_reg
from . import tbss # noqa
#!/usr/bin/env python
#
# epi_reg.py - Wrapper for the epi_reg command.
#
# Author:
#
"""This module provides the :func:`epi_reg` function, a wrapper for the FSL
`epi_reg <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FLIRT/UserGuide#epi_reg>`_ command.
"""
import fsl.utils.assertions as asrt
from . import wrapperutils as wutils
@wutils.fileOrImage('epi', 't1', 't1brain', 'fmap', 'fmapmag', 'fmapmagbrain', 'gdc', 'wmseg', 'weight', outprefix='out')
@wutils.fslwrapper
def epi_reg(epi, t1, t1brain, out='epi_reg', **kwargs):
"""Wrapper for the ``epi_reg`` command.
:arg epi: Input EPI image
:arg t1: Input wholehead T1 image
:arg t1brain: Input brain extracted T1 image
:arg out: Output name
"""
asrt.assertIsNifti(epi)
asrt.assertIsNifti(t1)
asrt.assertIsNifti(t1brain)
valmap = {
'nofmapreg' : wutils.SHOW_IF_TRUE,
'noclean' : wutils.SHOW_IF_TRUE,
'v' : wutils.SHOW_IF_TRUE,
}
cmd = ['epi_reg', '--epi='+epi, '--t1='+t1, '--t1brain='+t1brain, '--out='+out]
cmd += wutils.applyArgStyle('--=',
valmap=valmap,
singlechar_args=True,
**kwargs)
return cmd
......@@ -93,6 +93,14 @@ def test_flirt():
assert checkResult(result.stdout[0], *expected)
def test_epi_reg():
with asrt.disabled(), run.dryrun(), mockFSLDIR(bin=('epi_reg',)) as fsldir:
epi_reg = op.join(fsldir, 'bin', 'epi_reg')
result = fw.epi_reg('epi', 't1', 't1brain', 'out')
expected = epi_reg + ' --epi=epi --t1=t1 --t1brain=t1brain --out=out'
assert result.stdout[0] == expected
def test_applyxfm():
with asrt.disabled(), run.dryrun(), mockFSLDIR(bin=('flirt',)) as fsldir:
flirt = op.join(fsldir, 'bin', 'flirt')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment