Skip to content

Commit b930d22

Browse files
committed
make check changes
1 parent 4b9e4fa commit b930d22

File tree

11 files changed

+47
-43
lines changed

11 files changed

+47
-43
lines changed

examples/fmri_ants_openfmri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def create_reg_workflow(name='registration'):
175175
"""
176176
Create a mask of the median image coregistered to the anatomical image
177177
"""
178-
178+
179179
mean2anat_mask = Node(fsl.BET(mask=True), name='mean2anat_mask')
180180
register.connect(mean2anatbbr, 'out_file', mean2anat_mask, 'in_file')
181181

nipype/interfaces/dipy/tensors.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
def tensor_fitting(data, bvals, bvecs, mask_file=None):
3333
"""
3434
Use dipy to fit DTI
35-
35+
3636
Parameters
3737
----------
3838
in_file : str
@@ -58,7 +58,7 @@ def tensor_fitting(data, bvals, bvecs, mask_file=None):
5858

5959
# Load information about the gradients:
6060
gtab = grad.gradient_table(self.inputs.bvals, self.inputs.bvecs)
61-
61+
6262
# Fit it
6363
tenmodel = dti.TensorModel(gtab)
6464
return tenmodel.fit(data, mask), affine
@@ -84,7 +84,7 @@ class DTIOutputSpec(TraitedSpec):
8484
class DTI(BaseInterface):
8585
"""
8686
Calculates the diffusion tensor model parameters
87-
87+
8888
Example
8989
-------
9090
@@ -99,7 +99,7 @@ class DTI(BaseInterface):
9999
output_spec = DTIOutputSpec
100100

101101
def _run_interface(self, runtime):
102-
ten_fit, affine = tensor_fitting(self.inputs.in_file,
102+
ten_fit, affine = tensor_fitting(self.inputs.in_file,
103103
self.inputs.bvals,
104104
self.inputs.bvecs,
105105
self.inputs.mask_file)
@@ -124,7 +124,7 @@ def _gen_filename(self, name):
124124
def _gen_outfilename(self):
125125
_, name, _ = split_filename(self.inputs.in_file)
126126
return name + '_dti.nii'
127-
127+
128128

129129
class TensorModeInputSpec(TraitedSpec):
130130
in_file = File(exists=True, mandatory=True,

nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ def test_SimulateMultiTensor_inputs():
77
),
88
bvalues=dict(usedefault=True,
99
),
10+
diff_iso=dict(usedefault=True,
11+
),
12+
diff_sf=dict(usedefault=True,
13+
),
1014
gradients=dict(),
1115
ignore_exception=dict(nohash=True,
1216
usedefault=True,

nipype/interfaces/fsl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ImageStats, FilterRegressor, Overlay, Slicer,
1717
PlotTimeSeries, PlotMotionParams, ConvertXFM,
1818
SwapDimensions, PowerSpectrum, Reorient2Std,
19-
Complex, InvWarp, WarpUtils, ConvertWarp, WarpPoints,
19+
Complex, InvWarp, WarpUtils, ConvertWarp, WarpPoints,
2020
WarpPointsToStd, RobustFOV)
2121

2222
from .epi import (PrepareFieldmap, TOPUP, ApplyTOPUP, Eddy, EPIDeWarp,

nipype/interfaces/fsl/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class RobustFOVInputSpec(FSLCommandInputSpec):
3636
desc='input filename',
3737
argstr='-i %s', position=0, mandatory=True)
3838
out_roi = File(desc="ROI volume output name", argstr="-r %s",
39-
name_source=['in_file'], hash_files=False,
39+
name_source=['in_file'], hash_files=False,
4040
name_template='%s_ROI')
41-
42-
41+
42+
4343
class RobustFOVOutputSpec(TraitedSpec):
4444
out_roi = File(exists=True, desc="ROI volume output name")
4545

@@ -48,7 +48,7 @@ class RobustFOV(FSLCommand):
4848
_cmd = 'robustfov'
4949
input_spec = RobustFOVInputSpec
5050
output_spec = RobustFOVOutputSpec
51-
51+
5252

5353
class ImageMeantsInputSpec(FSLCommandInputSpec):
5454
in_file = File(exists=True,

nipype/interfaces/semtools/diffusion/diffusion.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class dtiaverage(SEMLikeCommandLine):
2323
2424
category: Diffusion.Diffusion Tensor Images.CommandLineOnly
2525
26-
description: dtiaverage is a program that allows to compute the average of an arbitrary number of tensor fields (listed after the --inputs option) This program is used in our pipeline as the last step of the atlas building processing. When all the tensor fields have been deformed in the same space, to create the average tensor field (--tensor_output) we use dtiaverage.
26+
description: dtiaverage is a program that allows to compute the average of an arbitrary number of tensor fields (listed after the --inputs option) This program is used in our pipeline as the last step of the atlas building processing. When all the tensor fields have been deformed in the same space, to create the average tensor field (--tensor_output) we use dtiaverage.
2727
Several average method can be used (specified by the --method option): euclidian, log-euclidian and pga. The default being euclidian.
2828
2929
version: 1.0.0
@@ -84,14 +84,14 @@ class dtiestim(SEMLikeCommandLine):
8484
8585
category: Diffusion.Diffusion Weighted Images
8686
87-
description: dtiestim is a tool that takes in a set of DWIs (with --dwi_image option) in nrrd format and estimates a tensor field out of it. The output tensor file name is specified with the --tensor_output option
88-
There are several methods to estimate the tensors which you can specify with the option --method lls|wls|nls|ml . Here is a short description of the different methods:
87+
description: dtiestim is a tool that takes in a set of DWIs (with --dwi_image option) in nrrd format and estimates a tensor field out of it. The output tensor file name is specified with the --tensor_output option
88+
There are several methods to estimate the tensors which you can specify with the option --method lls|wls|nls|ml . Here is a short description of the different methods:
8989
lls Linear least squares. Standard estimation technique that recovers the tensor parameters by multiplying the log of the normalized signal intensities by the pseudo-inverse of the gradient matrix. Default option.
9090
wls Weighted least squares. This method is similar to the linear least squares method except that the gradient matrix is weighted by the original lls estimate. (See Salvador, R., Pena, A., Menon, D. K., Carpenter, T. A., Pickard, J. D., and Bullmore, E. T. Formal characterization and extension of the linearized diffusion tensor model. Human Brain Mapping 24, 2 (Feb. 2005), 144-155. for more information on this method). This method is recommended for most applications. The weight for each iteration can be specified with the --weight_iterations. It is not currently the default due to occasional matrix singularities.
91-
nls Non-linear least squares. This method does not take the log of the signal and requires an optimization based on levenberg-marquadt to optimize the parameters of the signal. The lls estimate is used as an initialization. For this method the step size can be specified with the --step option.
91+
nls Non-linear least squares. This method does not take the log of the signal and requires an optimization based on levenberg-marquadt to optimize the parameters of the signal. The lls estimate is used as an initialization. For this method the step size can be specified with the --step option.
9292
ml Maximum likelihood estimation. This method is experimental and is not currently recommended. For this ml method the sigma can be specified with the option --sigma and the step size can be specified with the --step option.
9393
You can set a threshold (--threshold) to have the tensor estimated to only a subset of voxels. All the baseline voxel value higher than the threshold define the voxels where the tensors are computed. If not specified the threshold is calculated using an OTSU threshold on the baseline image.The masked generated by the -t option or by the otsu value can be saved with the --B0_mask_output option.
94-
dtiestim also can extract a few scalar images out of the DWI set of images:
94+
dtiestim also can extract a few scalar images out of the DWI set of images:
9595
the average baseline image (--B0) which is the average of all the B0s.
9696
the IDWI (--idwi)which is the geometric mean of the diffusion images.
9797
You can also load a mask if you want to compute the tensors only where the voxels are non-zero (--brain_mask) or a negative mask and the tensors will be estimated where the negative mask has zero values (--bad_region_mask)
@@ -176,13 +176,13 @@ class dtiprocess(SEMLikeCommandLine):
176176
category: Diffusion.Diffusion Tensor Images
177177
178178
description: dtiprocess is a tool that handles tensor fields. It takes as an input a tensor field in nrrd format.
179-
It can generate diffusion scalar properties out of the tensor field such as : FA (--fa_output), Gradient FA image (--fa_gradient_output), color FA (--color_fa_output), MD (--md_output), Frobenius norm (--frobenius_norm_output), lbd1, lbd2, lbd3 (--lambda{1,2,3}_output), binary map of voxel where if any of the eigenvalue is negative, the voxel is set to 1 (--negative_eigenvector_output)
179+
It can generate diffusion scalar properties out of the tensor field such as : FA (--fa_output), Gradient FA image (--fa_gradient_output), color FA (--color_fa_output), MD (--md_output), Frobenius norm (--frobenius_norm_output), lbd1, lbd2, lbd3 (--lambda{1,2,3}_output), binary map of voxel where if any of the eigenvalue is negative, the voxel is set to 1 (--negative_eigenvector_output)
180180
It also creates 4D images out of the tensor field such as: Highest eigenvector map (highest eigenvector at each voxel) (--principal_eigenvector_output)
181181
Masking capabilities: For any of the processing done with dtiprocess, it's possible to apply it on a masked region of the tensor field. You need to use the --mask option for any of the option to be applied on that tensor field sub-region only. If you want to save the masked tensor field use the option --outmask and specify the new masked tensor field file name.
182182
dtiprocess also allows a range of transformations on the tensor fields. The transformed tensor field file name is specified with the option --deformation_output. There are 3 resampling interpolation methods specified with the tag --interpolation followed by the type to use (nearestneighbor, linear, cubic) Then you have several transformations possible to apply:
183-
- Affine transformations using as an input
183+
- Affine transformations using as an input
184184
- itk affine transformation file (based on the itkAffineTransform class)
185-
- Affine transformations using rview (details and download at http://www.doc.ic.ac.uk/~dr/software/). There are 2 versions of rview both creating transformation files called dof files. The old version of rview outputs text files containing the transformation parameters. It can be read in with the --dof_file option. The new version outputs binary dof files. These dof files can be transformed into human readable file with the dof2mat tool which is part of the rview package. So you need to save the output of dof2mat into a text file which can then be used with the -- newdof_file option. Usage example: dof2mat mynewdoffile.dof >> mynewdoffile.txt dtiprocess --dti_image mytensorfield.nhdr --newdof_file mynewdoffile.txt --rot_output myaffinetensorfield.nhdr
185+
- Affine transformations using rview (details and download at http://www.doc.ic.ac.uk/~dr/software/). There are 2 versions of rview both creating transformation files called dof files. The old version of rview outputs text files containing the transformation parameters. It can be read in with the --dof_file option. The new version outputs binary dof files. These dof files can be transformed into human readable file with the dof2mat tool which is part of the rview package. So you need to save the output of dof2mat into a text file which can then be used with the -- newdof_file option. Usage example: dof2mat mynewdoffile.dof >> mynewdoffile.txt dtiprocess --dti_image mytensorfield.nhdr --newdof_file mynewdoffile.txt --rot_output myaffinetensorfield.nhdr
186186
Non linear transformations as an input: The default transformation file type is d-field (displacement field) in nrrd format. The option to use is --forward with the name of the file. If the transformation file is a h-field you have to add the option --hField.
187187
188188
version: 1.0.1

nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class fiberprocess(SEMLikeCommandLine):
3535
3636
category: Diffusion.Tractography
3737
38-
description: fiberprocess is a tool that manage fiber files extracted from the fibertrack tool or any fiber tracking algorithm. It takes as an input .fib and .vtk files (--fiber_file) and saves the changed fibers (--fiber_output) into the 2 same formats. The main purpose of this tool is to deform the fiber file with a transformation field as an input (--displacement_field or --h_field depending if you deal with dfield or hfield). To use that option you need to specify the tensor field from which the fiber file was extracted with the option --tensor_volume. The transformation applied on the fiber file is the inverse of the one input. If the transformation is from one case to an atlas, fiberprocess assumes that the fiber file is in the atlas space and you want it in the original case space, so it's the inverse of the transformation which has been computed.
39-
You have 2 options for fiber modification. You can either deform the fibers (their geometry) into the space OR you can keep the same geometry but map the diffusion properties (fa, md, lbd's...) of the original tensor field along the fibers at the corresponding locations. This is triggered by the --no_warp option. To use the previous example: when you have a tensor field in the original space and the deformed tensor field in the atlas space, you want to track the fibers in the atlas space, keeping this geometry but with the original case diffusion properties. Then you can specify the transformations field (from original case -> atlas) and the original tensor field with the --tensor_volume option.
38+
description: fiberprocess is a tool that manage fiber files extracted from the fibertrack tool or any fiber tracking algorithm. It takes as an input .fib and .vtk files (--fiber_file) and saves the changed fibers (--fiber_output) into the 2 same formats. The main purpose of this tool is to deform the fiber file with a transformation field as an input (--displacement_field or --h_field depending if you deal with dfield or hfield). To use that option you need to specify the tensor field from which the fiber file was extracted with the option --tensor_volume. The transformation applied on the fiber file is the inverse of the one input. If the transformation is from one case to an atlas, fiberprocess assumes that the fiber file is in the atlas space and you want it in the original case space, so it's the inverse of the transformation which has been computed.
39+
You have 2 options for fiber modification. You can either deform the fibers (their geometry) into the space OR you can keep the same geometry but map the diffusion properties (fa, md, lbd's...) of the original tensor field along the fibers at the corresponding locations. This is triggered by the --no_warp option. To use the previous example: when you have a tensor field in the original space and the deformed tensor field in the atlas space, you want to track the fibers in the atlas space, keeping this geometry but with the original case diffusion properties. Then you can specify the transformations field (from original case -> atlas) and the original tensor field with the --tensor_volume option.
4040
With fiberprocess you can also binarize a fiber file. Using the --voxelize option will create an image where each voxel through which a fiber is passing is set to 1. The output is going to be a binary image with the values 0 or 1 by default but the 1 value voxel can be set to any number with the --voxel_label option. Finally you can create an image where the value at the voxel is the number of fiber passing through. (--voxelize_count_fibers)
4141
4242
version: 1.0.0

nipype/interfaces/semtools/diffusion/tractography/fibertrack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class fibertrack(SEMLikeCommandLine):
3333
category: Diffusion.Tractography
3434
3535
description: This program implements a simple streamline tractography method based on the principal eigenvector of the tensor field. A fourth order Runge-Kutta integration rule used to advance the streamlines.
36-
As a first parameter you have to input the tensor field (with the --input_tensor_file option). Then the region of interest image file is set with the --input_roi_file. Next you want to set the output fiber file name after the --output_fiber_file option.
36+
As a first parameter you have to input the tensor field (with the --input_tensor_file option). Then the region of interest image file is set with the --input_roi_file. Next you want to set the output fiber file name after the --output_fiber_file option.
3737
You can specify the label value in the input_roi_file with the --target_label, --source_label and --fobidden_label options. By default target label is 1, source label is 2 and forbidden label is 0. The source label is where the streamlines are seeded, the target label defines the voxels through which the fibers must pass by to be kept in the final fiber file and the forbidden label defines the voxels where the streamlines are stopped if they pass through it. There is also a --whole_brain option which, if enabled, consider both target and source labels of the roi image as target labels and all the voxels of the image are considered as sources.
3838
During the tractography, the --fa_min parameter is used as the minimum value needed at different voxel for the tracking to keep going along a streamline. The --step_size parameter is used for each iteration of the tracking algorithm and defines the length of each step. The --max_angle option defines the maximum angle allowed between two successive segments along the tracked fiber.
3939
0 Bytes
Binary file not shown.

nipype/testing/data/von_errmap.nii.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)