Repository: nipy/nipype

Issue:
Missing mask1 and mask2 arguments in doc example for Similarity
The mandatory arguments mask1 and mask2 are missing from the example here:

http://nipy.sourceforge.net/nipype/interfaces/generated/nipype.interfaces.nipy.utils.html

ApplyXFM does not set default value of required flag
from @davidgutman

Just noticed this, after scratching my head for a bit....  by default
it seems the ApplyXfm doesn't bass the applyxfm.inputs.apply_xfm=True
parameter... in which case it is rerunning the registration ...

I couldn't figure out why my transformation was working oddly and
realized it's because that flag wasn't being passed, and I
inadvertently assumed that that was the default behavior of ApplyXfm
(i.e. to apply an XFM)....

Not sure if this should be changed or not as the default behavior that
can be overridden (in which case.. you'd probably just want to use
fsl.FLIRT() anyway)..

More of a semantics thing I guess..

ApplyXfm
Code: http://github.com/nipy/nipype/blob/master/nipype/interfaces/fsl/preprocess.py#L495

Wraps command flirt

Currently just a light wrapper around FLIRT, with no modifications

ApplyXfm is used to apply an existing tranform to an image

Examples

> > > import nipype.interfaces.fsl as fsl
> > > from nipype.testing import example_data
> > > applyxfm = fsl.ApplyXfm()
> > > applyxfm.inputs.in_file = example_data('structural.nii')
> > > applyxfm.inputs.in_matrix_file = example_data('trans.mat')
> > > applyxfm.inputs.out_file = 'newfile.nii'
> > > applyxfm.inputs.reference = example_data('mni.nii')
> > > applyxfm.inputs.apply_xfm = True
> > > result = applyxfm.run()
> > > Inputs:

[Mandatory]
in_file: (an existing file name)
        input file
reference: (an existing file name)
        reference file

[Optional]
angle_rep: ('quaternion' or 'euler')
        representation of rotation angles
apply_xfm: (a boolean)
        apply transformation supplied by in_matrix_file
## 

David A Gutman, M.D. Ph.D.



Discussion:

Hey,

I just started building my own preproc-pipeline and just found out about this and wanted to post this issue. It took me a lot of time and frustration to figure out today. I do love the software so keep up the good work.

:)


Resolving patch:
diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py
--- a/nipype/interfaces/fsl/preprocess.py
+++ b/nipype/interfaces/fsl/preprocess.py
@@ -407,13 +407,13 @@ class FLIRTInputSpec(FSLCommandInputSpec):
                            argstr='-datatype %s',
                            desc='force output data type')
     cost = traits.Enum('mutualinfo', 'corratio', 'normcorr', 'normmi',
-                       'leastsq', 'labeldiff',
+                       'leastsq', 'labeldiff','bbr',
                        argstr='-cost %s',
                        desc='cost function')
     # XXX What is the difference between 'cost' and 'searchcost'?  Are
     # these both necessary or do they map to the same variable.
     cost_func = traits.Enum('mutualinfo', 'corratio', 'normcorr', 'normmi',
-                            'leastsq', 'labeldiff',
+                            'leastsq', 'labeldiff','bbr',
                             argstr='-searchcost %s',
                             desc='cost function')
     uses_qform = traits.Bool(argstr='-usesqform',
@@ -475,6 +475,37 @@ class FLIRTInputSpec(FSLCommandInputSpec):
     verbose = traits.Int(argstr='-verbose %d',
                          desc='verbose mode, 0 is least')
 
+    # BBR options
+    wm_seg = File(
+        argstr='-wmseg %s', min_ver='5.0.0',
+        desc='white matter segmentation volume needed by BBR cost function')
+    wmcoords = File(
+        argstr='-wmcoords %s', min_ver='5.0.0',
+        desc='white matter boundary coordinates for BBR cost function')
+    wmnorms = File(
+        argstr='-wmnorms %s', min_ver='5.0.0',
+        desc='white matter boundary normals for BBR cost function')
+    fieldmap = File(
+        argstr='-fieldmap %s', min_ver='5.0.0',
+        desc='fieldmap image in rads/s - must be already registered to the reference image')
+    fieldmapmask = File(
+        argstr='-fieldmapmask %s', min_ver='5.0.0',
+        desc='mask for fieldmap image')
+    pedir = traits.Int(
+        argstr='-pedir %d', min_ver='5.0.0',
+        desc='phase encode direction of EPI - 1/2/3=x/y/z & -1/-2/-3=-x/-y/-z')
+    echospacing = traits.Float(
+        argstr='-echospacing %f', min_ver='5.0.0',
+        desc='value of EPI echo spacing - units of seconds')
+    bbrtype = traits.Enum(
+        'signed', 'global_abs', 'local_abs',
+        argstr='-bbrtype %s', min_ver='5.0.0',
+        desc='type of bbr cost function: signed [default], global_abs, local_abs')
+    bbrslope = traits.Float(
+        argstr='-bbrslope %f', min_ver='5.0.0',
+        desc='value of bbr slope')
+    
+
 
 class FLIRTOutputSpec(TraitedSpec):
     out_file = File(exists=True,


Test patch: