|  | 
| 1 | 1 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | 
| 2 | 2 | # vi: set ft=python sts=4 ts=4 sw=4 et: | 
| 3 |  | -"""The freesurfer module provides basic functions for interfacing with freesurfer tools. | 
|  | 3 | +"""The freesurfer module provides basic functions for interfacing with | 
|  | 4 | + freesurfer tools. | 
| 4 | 5 | 
 | 
| 5 | 6 |  Change directory to provide relative paths for doctests | 
| 6 | 7 |  >>> import os | 
| @@ -769,22 +770,36 @@ def _gen_filename(self, name): | 
| 769 | 770 |  return self._list_outputs()[name] | 
| 770 | 771 |  return None | 
| 771 | 772 | 
 | 
|  | 773 | + | 
| 772 | 774 | class MS_LDAInputSpec(FSTraitedSpec): | 
| 773 |  | - lda_labels = traits.List(traits.Int(), argstr='-lda %s', mandatory=True, minlen=2, maxlen=2, sep=' ', position=1, | 
|  | 775 | + lda_labels = traits.List(traits.Int(), argstr='-lda %s', mandatory=True, | 
|  | 776 | + minlen=2, maxlen=2, sep=' ', position=1, | 
| 774 | 777 |  desc='pair of class labels to optimize') | 
| 775 |  | - weight_file = traits.File(argstr='-weight %s', mandatory=True, position=2, desc='filename for the LDA weights (input or output)') | 
| 776 |  | - output_synth = traits.File(exists=False, argstr='-synth %s', mandatory=True, position=3, desc='filename for the synthesized output volume') | 
| 777 |  | - label_file = traits.File(exists=True, argstr='-label %s', position=4, desc='filename of the label volume') | 
| 778 |  | - mask_file = traits.File(exists=True, argstr='-mask %s', position=5, desc='filename of the brain mask volume') | 
| 779 |  | - shift = traits.Int(argstr='-shift %d', position=6, desc='shift all values equal to the given value to zero') | 
| 780 |  | - conform = traits.Bool(argstr='-conform', position=7, desc='Conform the input volumes (brain mask typically already conformed)') | 
| 781 |  | - use_weights = traits.Bool(argstr='-W', position=8, desc='Use the weights from a previously generated weight file') | 
| 782 |  | - images = InputMultiPath(File(exists=True), argstr='%s', mandatory=True, copyfile=False, desc='list of input FLASH images' ) | 
|  | 778 | + weight_file = traits.File(argstr='-weight %s', mandatory=True, | 
|  | 779 | + position=2, | 
|  | 780 | + desc='filename for the LDA weights (input or output)') | 
|  | 781 | + output_synth = traits.File(exists=False, argstr='-synth %s', | 
|  | 782 | + mandatory=True, position=3, | 
|  | 783 | + desc='filename for the synthesized output volume') | 
|  | 784 | + label_file = traits.File(exists=True, argstr='-label %s', position=4, | 
|  | 785 | + desc='filename of the label volume') | 
|  | 786 | + mask_file = traits.File(exists=True, argstr='-mask %s', position=5, | 
|  | 787 | + desc='filename of the brain mask volume') | 
|  | 788 | + shift = traits.Int(argstr='-shift %d', position=6, | 
|  | 789 | + desc='shift all values equal to the given value to zero') | 
|  | 790 | + conform = traits.Bool(argstr='-conform', position=7, | 
|  | 791 | + desc='Conform the input volumes (brain mask typically already conformed)') | 
|  | 792 | + use_weights = traits.Bool(argstr='-W', position=8, | 
|  | 793 | + desc='Use the weights from a previously generated weight file') | 
|  | 794 | + images = InputMultiPath(File(exists=True), argstr='%s', mandatory=True, | 
|  | 795 | + copyfile=False, desc='list of input FLASH images') | 
|  | 796 | + | 
| 783 | 797 | 
 | 
| 784 | 798 | class MS_LDAOutputSpec(TraitedSpec): | 
| 785 | 799 |  weight_file = File(exists=True, desc='') | 
| 786 | 800 |  vol_synth_file = File(exists=True, desc='') | 
| 787 | 801 | 
 | 
|  | 802 | + | 
| 788 | 803 | class MS_LDA(FSCommand): | 
| 789 | 804 |  """Perform LDA reduction on the intensity space of an arbitrary # of FLASH images | 
| 790 | 805 | 
 | 
| @@ -821,7 +836,8 @@ def _format_arg(self, name, spec, value): | 
| 821 | 836 |  if name is 'use_weights': | 
| 822 | 837 |  if self.inputs.use_weights is True: | 
| 823 | 838 |  self._verify_weights_file_exists() | 
| 824 |  | - else: return '' | 
|  | 839 | + else: | 
|  | 840 | + return '' | 
| 825 | 841 |  # TODO: Fix bug when boolean values are set explicitly to false | 
| 826 | 842 |  return super(MS_LDA, self)._format_arg(name, spec, value) | 
| 827 | 843 | 
 | 
|  | 
0 commit comments