Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
588c7ef
[FSL] Updated BEDPOSTX and XFibres
oesteban Sep 10, 2014
3f677eb
fixed gradient nonlinearities implementation
oesteban Sep 10, 2014
834571c
fixed errors
oesteban Sep 11, 2014
0f1c179
fixed bug
oesteban Sep 11, 2014
68ab056
fixed XFibres
oesteban Sep 11, 2014
449452f
fix doctest of BEDPOSTX
oesteban Sep 11, 2014
dc1a4cd
tested new XFibres. new parallel workflow
oesteban Sep 11, 2014
0de90cf
preparing new workflow for parallel processing
oesteban Sep 11, 2014
9336dee
new split and merge interfaces
oesteban Sep 12, 2014
6c01665
added test and some missing files in last commit
oesteban Sep 12, 2014
f177e3f
new parallel bedpostx finished :)
oesteban Sep 12, 2014
2afca1b
new naming conventions
oesteban Oct 6, 2014
6e8c5ae
Merge branch 'master' into enh/UpdateBEDPOSTX
oesteban Oct 6, 2014
1f00894
bedpostx_parallel avoid computation of dyads uncertainty available
oesteban Oct 6, 2014
5ee0ffb
Interface Merge for large files
oesteban Oct 6, 2014
3974692
Merge branch 'enh/UpdateBEDPOSTX' of github.com:oesteban/nipype into …
oesteban Oct 6, 2014
a3a420e
fix missing comma
oesteban Oct 6, 2014
5fef712
added computation of mean f samples in bedpostx
oesteban Oct 7, 2014
edb7faf
fix missing connections
oesteban Oct 7, 2014
983cee1
fixed several bugs. tested in practice
oesteban Oct 7, 2014
310160d
Merge remote-tracking branch 'upstream/master' into fix/bedpostx
satra Oct 7, 2014
a1636f8
Merge remote-tracking branch 'upstream/master' into fix/bedpostx
satra Oct 7, 2014
c8e82c0
fix: clean up bedpostx and xfibres implementations
satra Oct 8, 2014
fbf5db1
Merge remote-tracking branch 'upstream/master' into fix/bedpostx
satra Oct 8, 2014
400050b
tst: cleaned auto tests and imports
satra Oct 8, 2014
12e7608
tst: fixed all failing tests
satra Oct 8, 2014
fce9b33
resolved conflicts
satra Oct 8, 2014
0a79223
Merge branch 'satra-fix/bedpostx' into enh/UpdateBEDPOSTX
oesteban Oct 8, 2014
f43ea3b
make check-before-commit
oesteban Oct 8, 2014
6b69b33
Merge remote-tracking branch 'upstream/master' into fix/bedpostx
satra Oct 8, 2014
23b27d9
Merge branch 'master' into fix/bedpostx
satra Oct 15, 2014
983a5ee
fix: added tests to suppress auto generation
satra Oct 15, 2014
59b6a82
fix: resolved conflict
satra Oct 15, 2014
20c5052
Merge branch 'satra-fix/bedpostx2' into enh/UpdateBEDPOSTX
oesteban Oct 16, 2014
acf5380
Merge branch 'master' into enh/UpdateBEDPOSTX
oesteban Oct 16, 2014
13c7cfa
Merge with upstream master, make specs, make check-before-commit
oesteban Oct 16, 2014
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: clean up bedpostx and xfibres implementations
  • Loading branch information
satra committed Oct 8, 2014
commit c8e82c05edb63b9db1b11f1d9fa0b0d57e134e7e
139 changes: 0 additions & 139 deletions nipype/interfaces/fsl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,145 +245,6 @@ def _overload_extension(self, value, name=None):
return value + Info.output_type_to_ext(self.inputs.output_type)


class FSLXCommandInputSpec(FSLCommandInputSpec):
dwi = File(exists=True, argstr='--data=%s', mandatory=True,
desc='diffusion weighted image data file')
mask = File(exists=True, argstr='--mask=%s', mandatory=True,
desc='brain binary mask file (i.e. from BET)')
bvecs = File(exists=True, argstr='--bvecs=%s', mandatory=True,
desc='b vectors file')
bvals = File(exists=True, argstr='--bvals=%s', mandatory=True,
desc='b values file')

logdir = Directory('.', argstr='--logdir=%s', usedefault=True)
n_fibres = traits.Range(low=1, argstr='--nfibres=%d', desc=('Maximum '
'number of fibres to fit in each voxel'))
model = traits.Enum(1, 2, argstr='--model=%d',
desc=('use monoexponential (1, default, required for '
'single-shell) or multiexponential (2, multi-'
'shell) model'))
fudge = traits.Int(argstr='--fudge=%d',
desc='ARD fudge factor')
n_jumps = traits.Int(5000, argstr='--njumps=%d',
desc='Num of jumps to be made by MCMC')
burn_in = traits.Range(low=0, default=0, argstr='--burnin=%d',
desc=('Total num of jumps at start of MCMC to be '
'discarded'))
burn_in_no_ard = traits.Range(low=0, default=0, argstr='--burninnoard=%d',
desc=('num of burnin jumps before the ard is'
' imposed'))
sample_every = traits.Range(low=0, default=1, argstr='--sampleevery=%d',
desc='Num of jumps for each sample (MCMC)')
update_proposal_every = traits.Range(low=1, default=40,
argstr='--updateproposalevery=%d',
desc=('Num of jumps for each update '
'to the proposal density std '
'(MCMC)'))
seed = traits.Int(argstr='--seed=%d',
desc='seed for pseudo random number generator')

_xor_inputs1 = ('no_ard', 'all_ard')
no_ard = traits.Bool(argstr='--noard', xor=_xor_inputs1,
desc='Turn ARD off on all fibres')
all_ard = traits.Bool(argstr='--allard', xor=_xor_inputs1,
desc='Turn ARD on on all fibres')

_xor_inputs2 = ('no_spat', 'non_linear', 'cnlinear')
no_spat = traits.Bool(argstr='--nospat', xor=_xor_inputs2,
desc='Initialise with tensor, not spatially')
non_linear = traits.Bool(argstr='--nonlinear', xor=_xor_inputs2,
desc='Initialise with nonlinear fitting')
cnlinear = traits.Bool(argstr='--cnonlinear', xor=_xor_inputs2,
desc=('Initialise with constrained nonlinear '
'fitting'))
rician = traits.Bool(argstr='--rician', desc=('use Rician noise modeling'))

_xor_inputs3 = ['f0_noard', 'f0_ard']
f0_noard = traits.Bool(argstr='--f0', xor=_xor_inputs3,
desc=('Noise floor model: add to the model an '
'unattenuated signal compartment f0'))
f0_ard = traits.Bool(argstr='--f0 --ardf0', xor=_xor_inputs3 + ['all_ard'],
desc=('Noise floor model: add to the model an '
'unattenuated signal compartment f0'))
force_dir = traits.Bool(True, argstr='--forcedir', usedefault=True,
desc=('use the actual directory name given '
'(do not add + to make a new directory)'))


class FSLXCommandOutputSpec(TraitedSpec):
dsamples = File(desc=('Samples from the distribution on diffusivity d'))
d_stdsamples = File(desc=('Std of samples from the distribution d'))
dyads = OutputMultiPath(File(), desc=('Mean of PDD distribution'
' in vector form.'))
fsamples = OutputMultiPath(File(), desc=('Samples from the '
'distribution on f anisotropy'))
mean_dsamples = File(desc='Mean of distribution on diffusivity d')
mean_d_stdsamples = File(desc='Mean of distribution on diffusivity d')
mean_fsamples = OutputMultiPath(File(), desc=('Mean of '
'distribution on f anisotropy'))
mean_S0samples = File(desc='Mean of distribution on T2w'
'baseline signal intensity S0')
mean_tausamples = File(desc='Mean of distribution on '
'tau samples (only with rician noise)')
phsamples = OutputMultiPath(File(), desc=('phi samples, per fiber'))
thsamples = OutputMultiPath(File(), desc=('theta samples, per fiber'))


class FSLXCommand(FSLCommand):
"""
Base support for ``xfibres`` and ``bedpostx``
"""
input_spec = FSLXCommandInputSpec
output_spec = FSLXCommandOutputSpec

def _run_interface(self, runtime):
self._out_dir = os.getcwd()
runtime = super(FSLXCommand, self)._run_interface(runtime)
if runtime.stderr:
self.raise_exception(runtime)
return runtime

def _list_outputs(self):
outputs = self.output_spec().get()
out_dir = self._out_dir

if isdefined(self.inputs.logdir):
out_dir = os.path.abspath(self.inputs.logdir)
else:
out_dir = os.path.abspath('logdir')

multi_out = ['dyads', 'fsamples', 'mean_fsamples',
'phsamples', 'thsamples']
single_out = ['dsamples', 'd_stdsamples', 'mean_dsamples',
'mean_S0samples', 'mean_d_stdsamples']

for k in single_out:
outputs[k] = self._gen_fname(k, cwd=out_dir)

if isdefined(self.inputs.rician) and self.inputs.rician:
outputs['mean_tausamples'] = self._gen_fname('mean_tausamples',
cwd=out_dir)

for k in multi_out:
outputs[k] = []

for i in xrange(self.inputs.n_fibres + 1):
outputs['fsamples'].append(self._gen_fname('f%dsamples' % i,
cwd=out_dir))
outputs['mean_fsamples'].append(self._gen_fname(('mean_f%d'
'samples') % i, cwd=out_dir))

for i in xrange(1, self.inputs.n_fibres + 1):
outputs['dyads'].append(self._gen_fname('dyads%d' % i,
cwd=out_dir))
outputs['phsamples'].append(self._gen_fname('ph%dsamples' % i,
cwd=out_dir))
outputs['thsamples'].append(self._gen_fname('th%dsamples' % i,
cwd=out_dir))

return outputs


def check_fsl():
ver = Info.version()
if ver:
Expand Down
Loading