Commit a4e2d37a authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'master' into 'master'

ENH: Added wrapper for epi_reg

See merge request fsl/fslpy!306
parents ef9ce000 506e534a
......@@ -110,4 +110,5 @@ from .misc import (fslreorient2std, # noqa
from .epi_reg import epi_reg
from . import tbss # noqa
#!/usr/bin/env python
# - Wrapper for the epi_reg command.
# Author:
"""This module provides the :func:`epi_reg` function, a wrapper for the FSL
`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')
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
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('--=',
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')
Supports Markdown
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