diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 553f6eb42a..e3ab23b03a 100755 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1331,7 +1331,7 @@ class TCorrelate(AFNICommand): def _list_outputs(self): outputs = self.output_spec().get() - + if not isdefined(self.inputs.out_file): outputs['out_file'] = self._gen_fname(self.inputs.xset, suffix=self.inputs.suffix) diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index f8d6f60939..4e3c203152 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -308,7 +308,7 @@ class SurfaceTransformInputSpec(FSTraitedSpec): help="subject id of target surface") target_ico_order = traits.Enum(1, 2, 3, 4, 5, 6, 7, argstr="--trgicoorder %d", help="order of the icosahedron if target_subject is 'ico'") - source_type = traits.Enum(filetypes, argstr='--sfmt %s', requires=['source_file'], + source_type = traits.Enum(filetypes, argstr='--sfmt %s', requires=['source_file'], help="source file format") target_type = traits.Enum(filetypes, argstr='--tfmt %s', help="output format") reshape = traits.Bool(argstr="--reshape", help="reshape output surface to conform with Nifti") @@ -988,7 +988,7 @@ class MakeAverageSubjectOutputSpec(TraitedSpec): class MakeAverageSubject(FSCommand): """Make an average freesurfer subject - + Examples -------- diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 4850f1ebcb..1948e2d43f 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -23,7 +23,7 @@ class MathsInput(FSLCommandInputSpec): output_datatype = traits.Enum(*_dtypes, position=-1, argstr="-odt %s", desc="datatype to use for output (default uses input type)") - + nan2zeros = traits.Bool(position=3, argstr='-nan', desc='change NaNs to zeros before doing anything') diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 44aa23654c..d3a21abd8a 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -464,7 +464,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): return outputs class AvScaleInputSpec(FSLCommandInputSpec): - mat_file = File(exists=True, argstr="%s", + mat_file = File(exists=True, argstr="%s", desc='mat file to read', position=0) @@ -477,7 +477,7 @@ class AvScaleOutputSpec(TraitedSpec): forward_half_transform = traits.Any(desc='Forward Half Transform') backward_half_transform = traits.Any(desc='Backwards Half Transform') left_right_orientation_preserved = traits.Bool(desc='True if LR orientation preserved') - + class AvScale(FSLCommand): """Use FSL avscale command to extract info from mat file output of FLIRT @@ -505,7 +505,7 @@ def lines_to_float(lines): values = line.split() out.append([float(val) for val in values]) return out - + out = runtime.stdout.split('\n') outputs.rotation_translation_matrix = lines_to_float(out[1:5]) diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 9c1e1b1ffd..cd77cd93a8 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -1117,7 +1117,7 @@ def capture_provenance(): def push_provenance(): pass - + class SQLiteSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): database_file = File(exists=True, mandatory = True) table_name = traits.Str(mandatory=True) @@ -1206,7 +1206,7 @@ def _list_outputs(self): """ import MySQLdb if isdefined(self.inputs.config): - conn = MySQLdb.connect(db=self.inputs.database_name, + conn = MySQLdb.connect(db=self.inputs.database_name, read_default_file=self.inputs.config) else: conn = MySQLdb.connect(host=self.inputs.host, diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index aab2e5c65f..3bf35f885c 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -100,7 +100,7 @@ class FmriRealign4dInputSpec(BaseInterfaceInputSpec): class FmriRealign4dOutputSpec(TraitedSpec): - out_file = OutputMultiPath(File(exists=True), + out_file = OutputMultiPath(File(exists=True), desc="Realigned files") par_file = OutputMultiPath(File(exists=True), desc="Motion parameter files") diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index a74705ecfc..4b91313edf 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -61,14 +61,14 @@ def _run_interface(self, runtime): vol1_nii = nb.load(self.inputs.volume1) vol2_nii = nb.load(self.inputs.volume2) - + if isdefined(self.inputs.mask1): mask1_nii = nb.load(self.inputs.mask1) mask1_nii = nb.Nifti1Image(nb.load(self.inputs.mask1).get_data() == 1, mask1_nii.get_affine(), mask1_nii.get_header()) else: mask1_nii = None - + if isdefined(self.inputs.mask2): mask2_nii = nb.load(self.inputs.mask2) mask2_nii = nb.Nifti1Image(nb.load(self.inputs.mask2).get_data() == 1, mask2_nii.get_affine(), diff --git a/nipype/interfaces/slicer/converters.py b/nipype/interfaces/slicer/converters.py index cd763b9fe9..21234eda4e 100644 --- a/nipype/interfaces/slicer/converters.py +++ b/nipype/interfaces/slicer/converters.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -21,27 +21,27 @@ class DicomToNrrdConverterOutputSpec(TraitedSpec): class DicomToNrrdConverter(SlicerCommandLine): - """title: - Dicom to Nrrd Converter - + """title: + Dicom to Nrrd Converter -category: + +category: Converters - -description: + +description: Converts diffusion weighted MR images in dicom series into Nrrd format for analysis in Slicer. This program has been tested on only a limited subset of DTI dicom formats available from Siemens, GE, and Phillips scanners. Work in progress to support dicom multi-frame data. The program parses dicom header to extract necessary information about measurement frame, diffusion weighting directions, b-values, etc, and write out a nrrd image. For non-diffusion weighted dicom images, it loads in an entire dicom series and writes out a single dicom volume in a .nhdr/.raw pair. - + version: 0.2.0.$Revision: 916 $(alpha) documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.0/Modules/DicomToNrrdConverter -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: Xiaodong Tao -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa. diff --git a/nipype/interfaces/slicer/diffusion/denoising.py b/nipype/interfaces/slicer/diffusion/denoising.py index 1ac5ec5386..76a38d5669 100644 --- a/nipype/interfaces/slicer/diffusion/denoising.py +++ b/nipype/interfaces/slicer/diffusion/denoising.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -23,19 +23,19 @@ class jointLMMSE(SlicerCommandLine): category: Diffusion.Denoising -description: +description: This module reduces Rician noise (or unwanted detail) on a set of diffusion weighted images. For this, it filters the image in the mean squared error sense using a Rician noise model. The N closest gradient directions to the direction being processed are filtered together to improve the results: the noise-free signal is seen as an n-diemensional vector which has to be estimated with the LMMSE method from a set of corrupted measurements. To that end, the covariance matrix of the noise-free vector and the cross covariance between this signal and the noise have to be estimated, which is done taking into account the image formation process. The noise parameter is automatically estimated from a rough segmentation of the background of the image. In this area the signal is simply 0, so that Rician statistics reduce to Rayleigh and the noise power can be easily estimated from the mode of the histogram. A complete description of the algorithm may be found in: -Antonio Tristan-Vega and Santiago Aja-Fernandez, DWI filtering using joint information for DTI and HARDI, Medical Image Analysis, Volume 14, Issue 2, Pages 205-218. 2010. - +Antonio Tristan-Vega and Santiago Aja-Fernandez, DWI filtering using joint information for DTI and HARDI, Medical Image Analysis, Volume 14, Issue 2, Pages 205-218. 2010. + version: 0.1.1.$Revision: 1 $(alpha) documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.0/Modules/JointRicianLMMSEImageFilter contributor: Antonio Tristan Vega, Santiago Aja Fernandez. University of Valladolid (SPAIN). Partially founded by grant number TEC2007-67073/TCM from the Comision Interministerial de Ciencia y Tecnologia (Spain). - + """ @@ -68,11 +68,11 @@ class dwiNoiseFilter(SlicerCommandLine): category: Diffusion.Denoising -description: +description: This module reduces noise (or unwanted detail) on a set of diffusion weighted images. For this, it filters the image in the mean squared error sense using a Rician noise model. Images corresponding to each gradient direction, including baseline, are processed individually. The noise parameter is automatically estimated (noise estimation improved but slower). Note that this is a general purpose filter for MRi images. The module jointLMMSE has been specifically designed for DWI volumes and shows a better performance, so its use is recommended instead. A complete description of the algorithm in this module can be found in: -S. Aja-Fernandez, M. Niethammer, M. Kubicki, M. Shenton, and C.-F. Westin. Restoration of DWI data using a Rician LMMSE estimator. IEEE Transactions on Medical Imaging, 27(10): pp. 1389-1403, Oct. 2008. +S. Aja-Fernandez, M. Niethammer, M. Kubicki, M. Shenton, and C.-F. Westin. Restoration of DWI data using a Rician LMMSE estimator. IEEE Transactions on Medical Imaging, 27(10): pp. 1389-1403, Oct. 2008. version: 0.1.1.$Revision: 1 $(alpha) diff --git a/nipype/interfaces/slicer/diffusion/gtract.py b/nipype/interfaces/slicer/diffusion/gtract.py index f011fff9a1..9fe17e0b1c 100644 --- a/nipype/interfaces/slicer/diffusion/gtract.py +++ b/nipype/interfaces/slicer/diffusion/gtract.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -102,7 +102,7 @@ class gtractCostFastMarching(SlicerCommandLine): category: Diffusion.GTRACT -description: This program will use a fast marching fiber tracking algorithm to identify fiber tracts from a tensor image. This program is the first portion of the algorithm. The user must first run gtractFastMarchingTracking to generate the actual fiber tracts. This algorithm is roughly based on the work by G. Parker et al. from IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002. An additional feature of including anisotropy into the vcl_cost function calculation is included. +description: This program will use a fast marching fiber tracking algorithm to identify fiber tracts from a tensor image. This program is the first portion of the algorithm. The user must first run gtractFastMarchingTracking to generate the actual fiber tracts. This algorithm is roughly based on the work by G. Parker et al. from IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002. An additional feature of including anisotropy into the vcl_cost function calculation is included. version: 4.0.0 @@ -201,7 +201,7 @@ class gtractTransformToDeformationField(SlicerCommandLine): license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt -contributor: This tool was developed by Vincent Magnotta, Madhura Ingalhalikar, and Greg Harris +contributor: This tool was developed by Vincent Magnotta, Madhura Ingalhalikar, and Greg Harris acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 diff --git a/nipype/interfaces/slicer/diffusion/utilities.py b/nipype/interfaces/slicer/diffusion/utilities.py index 28b67e5d1e..c98baa3500 100644 --- a/nipype/interfaces/slicer/diffusion/utilities.py +++ b/nipype/interfaces/slicer/diffusion/utilities.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -44,7 +44,7 @@ class ResampleDTI(SlicerCommandLine): category: Diffusion.Utilities -description: +description: Resampling an image is a very important task in image analysis. It is especially important in the frame of image registration. This module implements DT image resampling through the use of itk Transforms. The resampling is controlled by the Output Spacing. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions. @@ -54,7 +54,7 @@ class ResampleDTI(SlicerCommandLine): contributor: Francois Budin -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics @@ -81,19 +81,19 @@ class DiffusionTensorEstimationOutputSpec(TraitedSpec): class DiffusionTensorEstimation(SlicerCommandLine): - """title: + """title: Diffusion Tensor Estimation - -category: + +category: Diffusion.Utilities - -description: - Performs a tensor model estimation from diffusion weighted images. + +description: + Performs a tensor model estimation from diffusion weighted images. There are three estimation methods available: least squares, weigthed least squares and non-linear estimation. The first method is the traditional method for tensor estimation and the fastest one. Weighted least squares takes into account the noise characteristics of the MRI images to weight the DWI samples used in the estimation based on its intensity magnitude. The last method is the more complex. - + version: 0.1.0.$Revision: 1892 $(alpha) @@ -103,7 +103,7 @@ class DiffusionTensorEstimation(SlicerCommandLine): contributor: Raul San Jose -acknowledgements: This command module is based on the estimation functionality provided by the Teem library. This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. +acknowledgements: This command module is based on the estimation functionality provided by the Teem library. This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. """ @@ -127,13 +127,13 @@ class DiffusionWeightedMaskingOutputSpec(TraitedSpec): class DiffusionWeightedMasking(SlicerCommandLine): - """title: + """title: Mask from Diffusion Weighted Images - -category: + +category: Diffusion.Utilities - + description:
Performs a mask calculation from a diffusion weighted (DW) image.
Starting from a dw image, this module computes the baseline image averaging all the images without diffusion weighting and then applies the otsu segmentation algorithm in order to produce a mask. this mask can then be used when estimating the diffusion tensor (dt) image, not to estimate tensors all over the volume.
@@ -164,17 +164,17 @@ class DiffusionTensorMathematicsOutputSpec(TraitedSpec): class DiffusionTensorMathematics(SlicerCommandLine): - """title: + """title: Diffusion Tensor Scalar Measurements - -category: + +category: Diffusion.Utilities - -description: + +description: Compute a set of different scalar measurements from a tensor field, specially oriented for Diffusion Tensors where some rotationally invariant measurements, like Fractional Anisotropy, are highly used to describe the anistropic behaviour of the tensor. - + version: 0.1.0.$Revision: 1892 $(alpha) diff --git a/nipype/interfaces/slicer/filtering/arithmetic.py b/nipype/interfaces/slicer/filtering/arithmetic.py index 4bd48759c2..1b80ee48ed 100644 --- a/nipype/interfaces/slicer/filtering/arithmetic.py +++ b/nipype/interfaces/slicer/filtering/arithmetic.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -21,7 +21,7 @@ class Cast(SlicerCommandLine): category: Filtering.Arithmetic -description: +description: Cast a volume to a given data type. Use at your own risk when casting an input volume into a lower precision type! Allows casting to the same type as the input volume. @@ -32,7 +32,7 @@ class Cast(SlicerCommandLine): contributor: Nicole Aucoin, BWH (Ron Kikinis, BWH) -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. @@ -60,7 +60,7 @@ class Add(SlicerCommandLine): category: Filtering.Arithmetic -description: +description: Adds two images. Although all image types are supported on input, only signed types are produced. The two images do not have to have the same dimensions. @@ -70,7 +70,7 @@ class Add(SlicerCommandLine): contributor: Bill Lorensen -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. diff --git a/nipype/interfaces/slicer/filtering/checkerboard.py b/nipype/interfaces/slicer/filtering/checkerboard.py index f7c1aae402..3cc9663329 100644 --- a/nipype/interfaces/slicer/filtering/checkerboard.py +++ b/nipype/interfaces/slicer/filtering/checkerboard.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -18,17 +18,17 @@ class CheckerBoardOutputSpec(TraitedSpec): class CheckerBoard(SlicerCommandLine): - """title: + """title: CheckerBoard Filter - -category: + +category: Filtering - -description: + +description: Create a checkerboard volume of two volumes. The output volume will show the two inputs alternating according to the user supplied checkerPattern. This filter is often used to compare the results of image registration. Note that the second input is resampled to the same origin, spacing and direction before it is composed with the first input. The scalar type of the output volume will be the same as the input image scalar type. - + version: 0.1.0.$Revision: 18864 $(alpha) @@ -36,7 +36,7 @@ class CheckerBoard(SlicerCommandLine): contributor: Bill Lorensen -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. diff --git a/nipype/interfaces/slicer/filtering/denoising.py b/nipype/interfaces/slicer/filtering/denoising.py index 00075693ae..5f727f14d2 100644 --- a/nipype/interfaces/slicer/filtering/denoising.py +++ b/nipype/interfaces/slicer/filtering/denoising.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -23,10 +23,10 @@ class CurvatureAnisotropicDiffusion(SlicerCommandLine): category: Filtering.Denoising -description: +description: Performs anisotropic diffusion on an image using a modified curvature diffusion equation (MCDE). -MCDE does not exhibit the edge enhancing properties of classic anisotropic diffusion, which can under certain conditions undergo a 'negative' diffusion, which enhances the contrast of edges. Equations of the form of MCDE always undergo positive diffusion, with the conductance term only varying the strength of that diffusion. +MCDE does not exhibit the edge enhancing properties of classic anisotropic diffusion, which can under certain conditions undergo a 'negative' diffusion, which enhances the contrast of edges. Equations of the form of MCDE always undergo positive diffusion, with the conductance term only varying the strength of that diffusion. Qualitatively, MCDE compares well with other non-linear diffusion techniques. It is less sensitive to contrast than classic Perona-Malik style diffusion, and preserves finer detailed structures in images. There is a potential speed trade-off for using this function in place of Gradient Anisotropic Diffusion. Each iteration of the solution takes roughly twice as long. Fewer iterations, however, may be required to reach an acceptable solution. diff --git a/nipype/interfaces/slicer/generate_classes.py b/nipype/interfaces/slicer/generate_classes.py index bc53c387ea..39bc01185f 100644 --- a/nipype/interfaces/slicer/generate_classes.py +++ b/nipype/interfaces/slicer/generate_classes.py @@ -13,7 +13,7 @@ def add_class_to_package(class_codes, class_names, module_name, package_dir): module_python_filename = os.path.join(package_dir, "%s.py" % module_name) f_m = open(module_python_filename, 'w') f_i = open(os.path.join(package_dir, "__init__.py"), 'a+') - f_m.write("""\"\"\"Autogenerated file - DO NOT EDIT + f_m.write("""\"\"\"Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.\"\"\"\n\n""") imports = """from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/legacy/diffusion/denoising.py b/nipype/interfaces/slicer/legacy/diffusion/denoising.py index 415a6b2dbf..26dbd41db2 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/denoising.py +++ b/nipype/interfaces/slicer/legacy/diffusion/denoising.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -25,20 +25,20 @@ class dwiUNLM(SlicerCommandLine): category: Legacy.Diffusion.Denoising -description: +description: This module reduces noise (or unwanted detail) on a set of diffusion weighted images. For this, it filters the images using a Unbiased Non Local Means for Rician noise algorithm. It exploits not only the spatial redundancy, but the redundancy in similar gradient directions as well; it takes into account the N closest gradient directions to the direction being processed (a maximum of 5 gradient directions is allowed to keep a reasonable computational load, since we do not use neither similarity maps nor block-wise implementation). The noise parameter is automatically estimated in the same way as in the jointLMMSE module. A complete description of the algorithm may be found in: Antonio Tristan-Vega and Santiago Aja-Fernandez, DWI filtering using joint information for DTI and HARDI, Medical Image Analysis, Volume 14, Issue 2, Pages 205-218. 2010. -Please, note that the execution of this filter is extremely slow, son only very conservative parameters (block size and search size as small as possible) should be used. Even so, its execution may take several hours. The advantage of this filter over joint LMMSE is its better preservation of edges and fine structures. - +Please, note that the execution of this filter is extremely slow, son only very conservative parameters (block size and search size as small as possible) should be used. Even so, its execution may take several hours. The advantage of this filter over joint LMMSE is its better preservation of edges and fine structures. + version: 0.0.1.$Revision: 1 $(alpha) documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.0/Modules/UnbiasedNonLocalMeansFilterForDWI contributor: Antonio Tristan Vega, Santiago Aja Fernandez. University of Valladolid (SPAIN). Partially founded by grant number TEC2007-67073/TCM from the Comision Interministerial de Ciencia y Tecnologia (Spain). - + """ diff --git a/nipype/interfaces/slicer/legacy/registration.py b/nipype/interfaces/slicer/legacy/registration.py index 26740763f7..f745efaf98 100644 --- a/nipype/interfaces/slicer/legacy/registration.py +++ b/nipype/interfaces/slicer/legacy/registration.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -41,7 +41,7 @@ class BSplineDeformableRegistration(SlicerCommandLine): contributor: Bill Lorensen -acknowledgements: +acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. @@ -89,7 +89,7 @@ class AffineRegistration(SlicerCommandLine): contributor: Daniel Blezek -acknowledgements: +acknowledgements: This module was developed by Daniel Blezek while at GE Research with contributions from Jim Miller. This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. diff --git a/nipype/interfaces/slicer/legacy/work.py b/nipype/interfaces/slicer/legacy/work.py index 7eaf77006a..e4788b0246 100644 --- a/nipype/interfaces/slicer/legacy/work.py +++ b/nipype/interfaces/slicer/legacy/work.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -16,17 +16,17 @@ class DiffusionTensorTestOutputSpec(TraitedSpec): class DiffusionTensorTest(SlicerCommandLine): - """title: + """title: Simple IO Test - -category: + +category: Legacy.Work in Progress.Diffusion Tensor.Test - -description: + +description: Simple test of tensor IO - + version: 0.1.0.$Revision: 18864 $(alpha) diff --git a/nipype/interfaces/slicer/quantification.py b/nipype/interfaces/slicer/quantification.py index f89dea81b9..4244614871 100644 --- a/nipype/interfaces/slicer/quantification.py +++ b/nipype/interfaces/slicer/quantification.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -28,7 +28,7 @@ class ComputeSUVBodyWeight(SlicerCommandLine): category: Quantification -description: +description: Computes the standardized uptake value based on body weight. Takes an input PET image in DICOM and NRRD format (DICOM header must contain Radiopharmaceutical parameters). Produces a CSV file that contains patientID, studyDate, dose, labelID, suvmin, suvmax, suvmean, labelName for each volume of interest. It also displays some of the information as output strings in the GUI, the CSV file is optional in that case. The CSV file is appended to on each execution of the CLI. version: 0.1.0.$Revision: 8595 $(alpha) @@ -37,7 +37,7 @@ class ComputeSUVBodyWeight(SlicerCommandLine): contributor: Wendy Plesniak, BWH (Nicole Aucoin, BWH, Ron Kikinis, BWH) -acknowledgements: +acknowledgements: This work is funded by the Harvard Catalyst, and the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. diff --git a/nipype/interfaces/slicer/registration.py b/nipype/interfaces/slicer/registration.py index 4a355f0b14..7116816090 100644 --- a/nipype/interfaces/slicer/registration.py +++ b/nipype/interfaces/slicer/registration.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -29,19 +29,19 @@ class BRAINSResample(SlicerCommandLine): category: Registration -description: +description: This program collects together three common image processing tasks that all involve resampling an image volume: Resampling to a new resolution and spacing, applying a transformation (using an ITK transform IO mechanisms) and Warping (using a vector image deformation field). Full documentation available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.0/Modules/BRAINSResample. - + version: 3.0.0 documentation-url: http://www.slicer.org/slicerWiki/index.php/Modules:BRAINSResample -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: This tool was developed by Vincent Magnotta, Greg Harris, and Hans Johnson. -acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. +acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. """ @@ -106,20 +106,20 @@ class VBRAINSDemonWarp(SlicerCommandLine): category: Registration -description: +description: This program finds a deformation field to warp a moving image onto a fixed image. The images must be of the same signal kind, and contain an image of the same kind of object. This program uses the Thirion Demons warp software in ITK, the Insight Toolkit. Additional information is available at: http://www.nitrc.org/projects/brainsdemonwarp. - + version: 3.0.0 documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSDemonWarp -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: This tool was developed by Hans J. Johnson and Greg Harris. -acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. +acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. """ @@ -214,7 +214,7 @@ class BRAINSFit(SlicerCommandLine): documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSFit -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu @@ -282,20 +282,20 @@ class BRAINSDemonWarp(SlicerCommandLine): category: Registration -description: +description: This program finds a deformation field to warp a moving image onto a fixed image. The images must be of the same signal kind, and contain an image of the same kind of object. This program uses the Thirion Demons warp software in ITK, the Insight Toolkit. Additional information is available at: http://www.nitrc.org/projects/brainsdemonwarp. - + version: 3.0.0 documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:BRAINSDemonWarp -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: This tool was developed by Hans J. Johnson and Greg Harris. -acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. +acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. """ diff --git a/nipype/interfaces/slicer/segmentation/confidenceconnected.py b/nipype/interfaces/slicer/segmentation/confidenceconnected.py index 5abf2e2b93..118ef00c9f 100644 --- a/nipype/interfaces/slicer/segmentation/confidenceconnected.py +++ b/nipype/interfaces/slicer/segmentation/confidenceconnected.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -23,17 +23,17 @@ class ConfidenceConnectedOutputSpec(TraitedSpec): class ConfidenceConnected(SlicerCommandLine): - """title: + """title: Simple region growing - -category: + +category: Segmentation - -description: + +description: A simple region growing segmentation algorithm based on intensity statistics. To create a list of fiducials (Seeds) for this algorithm, click on the tool bar icon of an arrow pointing to a starburst fiducial to enter the 'place a new object mode' and then use the fiducials module. This module uses the Slicer Command Line Interface (CLI) and the ITK filters CurvatureFlowImageFilter and ConfidenceConnectedImageFilter. - + version: 0.1.0.$Revision: 18864 $(alpha) diff --git a/nipype/interfaces/slicer/segmentation/specialized.py b/nipype/interfaces/slicer/segmentation/specialized.py index 3bc27d9921..1e26df5f7f 100644 --- a/nipype/interfaces/slicer/segmentation/specialized.py +++ b/nipype/interfaces/slicer/segmentation/specialized.py @@ -1,4 +1,4 @@ -"""Autogenerated file - DO NOT EDIT +"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath @@ -31,15 +31,15 @@ class BRAINSROIAuto(SlicerCommandLine): category: Segmentation.Specialized description: This program is used to create a mask over the most prominant forground region in an image. This is accomplished via a combination of otsu thresholding and a closing operation. More documentation is available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.0/Modules/ForegroundMasking. - + version: 2.4.1 -license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt +license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt contributor: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu -acknowledgements: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard) +acknowledgements: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard) """ diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 454e53b59a..ffa1fd59f8 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -102,7 +102,7 @@ def _list_outputs(self): run.append(fname_presuffix(inner_f, prefix=self.inputs.out_prefix)) else: - realigned_run = fname_presuffix(f, + realigned_run = fname_presuffix(f, prefix=self.inputs.out_prefix) outputs['timecorrected_files'].append(realigned_run) return outputs diff --git a/nipype/interfaces/spm/tests/test_utils.py b/nipype/interfaces/spm/tests/test_utils.py index 829fb3e934..f1246ffb62 100644 --- a/nipype/interfaces/spm/tests/test_utils.py +++ b/nipype/interfaces/spm/tests/test_utils.py @@ -1,7 +1,7 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os -from nipype.testing import (assert_equal, assert_false,assert_raises, +from nipype.testing import (assert_equal, assert_false,assert_raises, assert_true, skipif, example_data) from nipype.interfaces.spm import no_spm import nipype.interfaces.spm.utils as spmu @@ -16,11 +16,11 @@ def test_coreg(): coreg = spmu.CalcCoregAffine(matlab_cmd = 'mymatlab') coreg.inputs.target = target assert_equal(coreg.inputs.matlab_cmd, 'mymatlab') - coreg.inputs.moving = moving - assert_equal( isdefined(coreg.inputs.mat),False) + coreg.inputs.moving = moving + assert_equal( isdefined(coreg.inputs.mat),False) pth, mov, _ = split_filename(moving) _, tgt, _ = split_filename(target) - mat = os.path.join(pth, '%s_to_%s.mat'%(mov,tgt)) + mat = os.path.join(pth, '%s_to_%s.mat'%(mov,tgt)) invmat = fname_presuffix(mat, prefix = 'inverse_') scrpt = coreg._make_matlab_command(None) assert_equal(coreg.inputs.mat, mat) @@ -58,4 +58,4 @@ def test_reslice(): assert_equal(expected in script.replace(' ',''), True) expected_interp = 'flags.interp = 1;\n' assert_equal(expected_interp in script, True) - assert_equal('spm_reslice(invols, flags);' in script, True) + assert_equal('spm_reslice(invols, flags);' in script, True) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 919e0baa41..d80a58ba5e 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -2,7 +2,7 @@ # vi: set ft=python sts=4 ts=4 sw=4 et: from nipype.interfaces.spm.base import SPMCommandInputSpec, SPMCommand, Info from nipype.interfaces.matlab import MatlabCommand -from nipype.interfaces.base import (TraitedSpec, BaseInterface, +from nipype.interfaces.base import (TraitedSpec, BaseInterface, BaseInterfaceInputSpec, isdefined) from nipype.interfaces.base import File, traits from nipype.utils.filemanip import split_filename, fname_presuffix @@ -37,7 +37,7 @@ def _list_outputs(self): class CalcCoregAffineInputSpec(SPMCommandInputSpec): target = File( exists = True, mandatory = True, desc = 'target for generating affine transform') - moving = File( exists = True, mandatory = True, + moving = File( exists = True, mandatory = True, desc = 'volume transform can be applied to register with target') mat = File( desc = 'Filename used to store affine matrix') invmat = File( desc = 'Filename used to store inverse affine matrix') @@ -52,7 +52,7 @@ class CalcCoregAffine(SPMCommand): """ Uses SPM (spm_coreg) to calculate the transform mapping moving to target. Saves Transform in mat (matlab binary file) Also saves inverse transform - + Examples -------- @@ -64,34 +64,34 @@ class CalcCoregAffine(SPMCommand): >>> coreg.run() # doctest: +SKIP .. note:: - + * the output file mat is saves as a matlab binary file * calculating the transforms does NOT change either input image it does not **move** the moving image, only calculates the transform - that can be used to move it + that can be used to move it """ - + input_spec = CalcCoregAffineInputSpec output_spec = CalcCoregAffineOutputSpec def _make_inv_file(self): """ makes filename to hold inverse transform if not specified""" invmat = fname_presuffix(self.inputs.mat, prefix = 'inverse_') - return invmat - + return invmat + def _make_mat_file(self): """ makes name for matfile if doesn exist""" pth, mv, _ = split_filename(self.inputs.moving) _, tgt, _ = split_filename(self.inputs.target) mat = os.path.join(pth, '%s_to_%s.mat'%(mv,tgt)) - return mat + return mat def _make_matlab_command(self, _): """checks for SPM, generates script""" if not isdefined(self.inputs.mat): self.inputs.mat = self._make_mat_file() if not isdefined(self.inputs.invmat): - self.inputs.invmat = self._make_inv_file() + self.inputs.invmat = self._make_inv_file() script = """ target = '%s'; moving = '%s'; @@ -99,15 +99,15 @@ def _make_matlab_command(self, _): movingv = spm_vol(moving); x = spm_coreg(movingv, targetv); M = spm_matrix(x(:)'); - save('%s' , 'M' ); + save('%s' , 'M' ); M = inv(spm_matrix(x(:)')); - save('%s','M') - """%(self.inputs.target, + save('%s','M') + """%(self.inputs.target, self.inputs.moving, self.inputs.mat, self.inputs.invmat) - return script - + return script + def _list_outputs(self): outputs = self._outputs().get() outputs['mat'] = os.path.abspath(self.inputs.mat) @@ -127,7 +127,7 @@ class ApplyTransformOutputSpec(TraitedSpec): class ApplyTransform(SPMCommand): """ Uses spm to apply transform stored in a .mat file to given file - + Examples -------- @@ -138,7 +138,7 @@ class ApplyTransform(SPMCommand): >>> applymat.run() # doctest: +SKIP .. warning:: - + CHANGES YOUR INPUT FILE (applies transform by updating the header) except when used with nipype caching or workflow. """ @@ -170,11 +170,11 @@ class ResliceInputSpec(SPMCommandInputSpec): interp = traits.Range(low = 0, high = 7, usedefault = True, desc='degree of b-spline used for interpolation'\ '0 is nearest neighbor (default)') - + out_file = File(desc = 'Optional file to save resliced volume') -class ResliceOutputSpec(TraitedSpec): +class ResliceOutputSpec(TraitedSpec): out_file = File( exists = True, desc = 'resliced volume') class Reslice(SPMCommand): @@ -195,7 +195,7 @@ def _make_matlab_command(self, _): flags.interp = %d; infiles = strvcat(\'%s\', \'%s\'); invols = spm_vol(infiles); - spm_reslice(invols, flags); + spm_reslice(invols, flags); """%(self.inputs.interp, self.inputs.space_defining, self.inputs.in_file) diff --git a/nipype/pipeline/plugins/pbs.py b/nipype/pipeline/plugins/pbs.py index 36ed209e00..686f791263 100644 --- a/nipype/pipeline/plugins/pbs.py +++ b/nipype/pipeline/plugins/pbs.py @@ -40,7 +40,7 @@ def _is_pending(self, taskid): stdout=subprocess.PIPE, stderr=subprocess.PIPE) _, e = proc.communicate() - errmsg = 'Unknown Job Id' # %s' % taskid + errmsg = 'Unknown Job Id' # %s' % taskid return errmsg not in e def _submit_batchtask(self, scriptfile, node): diff --git a/nipype/pipeline/tests/test_utils.py b/nipype/pipeline/tests/test_utils.py index a673b4d2ca..5f3882af61 100644 --- a/nipype/pipeline/tests/test_utils.py +++ b/nipype/pipeline/tests/test_utils.py @@ -262,7 +262,7 @@ def pick_first(l): wf.name, n4.name, 'file1.txt')) == keep_inputs - + rmtree(out_dir) def fwhm(fwhm):