Skip to content

Commit 1e4fa0a

Browse files
committed
[ENH] [FSL-POSSUM] b0calc interface
1 parent 3fdd693 commit 1e4fa0a

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

nipype/interfaces/fsl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
IsotropicSmooth, TemporalFilter, DilateImage, ErodeImage,
3232
SpatialFilter, UnaryMaths, BinaryMaths, MultiImageMaths)
3333

34-
from .possum import (B0Calc)
34+
from .possum import B0Calc

nipype/interfaces/fsl/possum.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# -*- coding: utf-8 -*-
33
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
44
# vi: set ft=python sts=4 ts=4 sw=4 et:
5-
#
6-
# @Author: oesteban - [email protected]
7-
# @Date: 2014-07-03 15:27:53
8-
# @Last Modified by: oesteban
9-
# @Last Modified time: 2014-07-03 17:05:47
105
"""
116
The possum module provides classes for interfacing with `POSSUM
127
<http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/POSSUM>`_ command line tools.
@@ -22,14 +17,8 @@
2217
2318
"""
2419

25-
import os
26-
import shutil
27-
import warnings
28-
29-
from nipype.interfaces.fsl.base import FSLCommand, FSLCommandInputSpec, Info
30-
from nipype.interfaces.base import (TraitedSpec, isdefined, File, Directory,
31-
InputMultiPath, OutputMultiPath, traits)
32-
from nipype.utils.filemanip import fname_presuffix, split_filename, copyfile
20+
from .base import FSLCommand, FSLCommandInputSpec
21+
from ..base import TraitedSpec, File, traits
3322

3423

3524
class B0CalcInputSpec(FSLCommandInputSpec):
@@ -54,9 +43,10 @@ class B0CalcInputSpec(FSLCommandInputSpec):
5443
z_b0 = traits.Float(1.0, argstr='--b0=%0.2f', desc=('Value for zeroth-order b0 field '
5544
'(z-component), in Tesla'), xor=['xyz_b0'])
5645

57-
xyz_b0 = traits.Tuple(traits.Float, traits.Float, traits.Float,
58-
argstr='--b0x=%0.2f --b0y=%0.2f --b0=%0.2f', xor=['x_b0','y_b0','z_b0'],
59-
desc='Zeroth-order B0 field in Tesla')
46+
xyz_b0 = traits.Tuple(
47+
traits.Float, traits.Float, traits.Float,
48+
argstr='--b0x=%0.2f --b0y=%0.2f --b0=%0.2f', xor=['x_b0','y_b0','z_b0'],
49+
desc='Zeroth-order B0 field in Tesla')
6050

6151
delta = traits.Float(-9.45e-6, argstr='-d %e', desc='Delta value (chi_tissue - chi_air)')
6252
chi_air = traits.Float(4.0e-7, argstr='--chi0=%e', desc='susceptibility of air')

nipype/interfaces/fsl/tests/test_auto_B0Calc.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2-
from nipype.testing import assert_equal
3-
from nipype.interfaces.fsl.possum import B0Calc
2+
from ....testing import assert_equal
3+
from ..possum import B0Calc
4+
45

56
def test_B0Calc_inputs():
67
input_map = dict(args=dict(argstr='%s',
@@ -32,34 +33,39 @@ def test_B0Calc_inputs():
3233
position=1,
3334
),
3435
output_type=dict(),
35-
terminal_output=dict(mandatory=True,
36-
nohash=True,
36+
terminal_output=dict(nohash=True,
3737
),
3838
x_b0=dict(argstr='--b0x=%0.2f',
39+
xor=['xyz_b0'],
3940
),
4041
x_grad=dict(argstr='--gx=%0.4f',
4142
),
43+
xyz_b0=dict(argstr='--b0x=%0.2f --b0y=%0.2f --b0=%0.2f',
44+
xor=['x_b0', 'y_b0', 'z_b0'],
45+
),
4246
y_b0=dict(argstr='--b0y=%0.2f',
47+
xor=['xyz_b0'],
4348
),
4449
y_grad=dict(argstr='--gy=%0.4f',
4550
),
4651
z_b0=dict(argstr='--b0=%0.2f',
52+
xor=['xyz_b0'],
4753
),
4854
z_grad=dict(argstr='--gz=%0.4f',
4955
),
5056
)
5157
inputs = B0Calc.input_spec()
5258

53-
for key, metadata in input_map.items():
54-
for metakey, value in metadata.items():
59+
for key, metadata in list(input_map.items()):
60+
for metakey, value in list(metadata.items()):
5561
yield assert_equal, getattr(inputs.traits()[key], metakey), value
5662

63+
5764
def test_B0Calc_outputs():
5865
output_map = dict(out_file=dict(),
5966
)
6067
outputs = B0Calc.output_spec()
6168

62-
for key, metadata in output_map.items():
63-
for metakey, value in metadata.items():
69+
for key, metadata in list(output_map.items()):
70+
for metakey, value in list(metadata.items()):
6471
yield assert_equal, getattr(outputs.traits()[key], metakey), value
65-

0 commit comments

Comments
 (0)