Skip to content

Commit 6d7ba1d

Browse files
committed
run_black
1 parent aecdacd commit 6d7ba1d

File tree

1 file changed

+52
-31
lines changed

1 file changed

+52
-31
lines changed

nipype/interfaces/cat12/preprocess.py

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -608,67 +608,79 @@ class CAT12SANLMDenoisingInputSpec(SPMCommandInputSpec):
608608
0,
609609
2,
610610
512,
611-
field='spm_type',
611+
field="spm_type",
612612
usedefault=True,
613-
desc='Data type of the output images. 0 = same, 2 = uint8, 512 = uint16, 16 = single (32 bit)'
613+
desc="Data type of the output images. 0 = same, 2 = uint8, 512 = uint16, 16 = single (32 bit)",
614+
)
614615

616+
intlim = traits.Int(
617+
field="intlim",
618+
default_value=100,
619+
usedefault=True,
620+
desc="intensity limitation (default = 100)",
615621
)
616622

617623
filename_prefix = traits.Str(
618-
field='prefix',
619-
default_value='sanlm_',
624+
field="prefix",
625+
default_value="sanlm_",
620626
usedefault=True,
621-
desc='Filename prefix. Specify the string to be prepended to the filenames of the filtered image file(s).',
627+
desc="Filename prefix. Specify the string to be prepended to the filenames of the filtered image file(s).",
622628
)
623629

624630
filename_suffix = traits.Str(
625-
field='suffix',
626-
default_value='',
631+
field="suffix",
632+
default_value="",
627633
usedefault=True,
628-
desc='Filename suffix. Specify the string to be appended to the filenames of the filtered image file(s).'
634+
desc="Filename suffix. Specify the string to be appended to the filenames of the filtered image file(s).",
629635
)
630636

631637
addnoise = traits.Float(
632638
default_value=0.5,
633639
usedefault=True,
634-
field='addnoise',
635-
desc='Strength of additional noise in noise-free regions. Add minimal amount of noise in regions without any noise to avoid image segmentation problems. This parameter defines the strength of additional noise as percentage of the average signal intensity.')
640+
field="addnoise",
641+
desc="""Strength of additional noise in noise-free regions.
642+
Add minimal amount of noise in regions without any noise to avoid image segmentation problems.
643+
This parameter defines the strength of additional noise as percentage of the average signal intensity.""",
644+
)
636645

637646
rician = traits.Bool(
638647
True,
639-
field='rician',
648+
field="rician",
640649
usedefault=True,
641-
desc='''Rician noise
642-
MRIs can have Gaussian or Rician distributed noise with uniform or nonuniform variance across the image. If SNR is high enough
643-
(>3) noise can be well approximated by Gaussian noise in the foreground. However, for SENSE reconstruction or DTI data a Rician
644-
distribution is expected. Please note that the Rician noise estimation is sensitive for large signals in the neighbourhood and can lead to
645-
artefacts, e.g. cortex can be affected by very high values in the scalp or in blood vessels.''')
650+
desc="""Rician noise
651+
MRIs can have Gaussian or Rician distributed noise with uniform or nonuniform variance across the image.
652+
If SNR is high enough (>3) noise can be well approximated by Gaussian noise in the foreground. However, for
653+
SENSE reconstruction or DTI data a Rician distribution is expected. Please note that the Rician noise estimation
654+
is sensitive for large signals in the neighbourhood and can lead to artefacts, e.g. cortex can be affected by
655+
very high values in the scalp or in blood vessels.""",
656+
)
646657

647658
replace_nan_and_inf = traits.Bool(
648659
True,
649-
field='replaceNANandINF',
660+
field="replaceNANandINF",
650661
usedefault=True,
651-
desc='Replace NAN by 0, -INF by the minimum and INF by the maximum of the image.'
662+
desc="Replace NAN by 0, -INF by the minimum and INF by the maximum of the image.",
652663
)
653664

654665
noisecorr_strength = traits.Enum(
655-
'-Inf',
666+
"-Inf",
656667
2,
657668
4,
658-
field='nlmfilter.optimized.NCstr',
669+
field="nlmfilter.optimized.NCstr",
659670
usedefault=True,
660-
desc='''Strength of Noise Corrections
661-
Strength of the (sub-resolution) spatial adaptive non local means (SANLM) noise correction. Please note that the filter strength is
662-
automatically estimated. Change this parameter only for specific conditions. The "light" option applies half of the filter strength of the
663-
adaptive "medium" cases, whereas the "strong" option uses the full filter strength, force sub-resolution filtering and applies an
664-
additional iteration. Sub-resolution filtering is only used in case of high image resolution below 0.8 mm or in case of the "strong"
665-
option. light = 2, medium = -Inf, strong = 4'''
671+
desc="""Strength of Noise Corrections
672+
Strength of the (sub-resolution) spatial adaptive non local means (SANLM) noise correction. Please note
673+
that the filter strength is automatically estimated. Change this parameter only for specific conditions. The
674+
"light" option applies half of the filter strength of the adaptive "medium" cases, whereas the "strong"
675+
option uses the full filter strength, force sub-resolution filtering and applies an additional iteration.
676+
Sub-resolution filtering is only used in case of high image resolution below 0.8 mm or in case of the
677+
"strong" option. light = 2, medium = -Inf, strong = 4""",
666678
)
667679

668680

669681
class CAT12SANLMDenoisingOutputSpec(TraitedSpec):
670682

671-
out_file = File(desc='out file')
683+
out_file = File(desc="out file")
672684

673685

674686
class CAT12SANLMDenoising(SPMCommand):
@@ -682,6 +694,13 @@ class CAT12SANLMDenoising(SPMCommand):
682694
This filter is internally used in the segmentation procedure anyway. Thus, it is not
683695
necessary (and not recommended) to apply the filter before segmentation.
684696
697+
______________________________________________________________________
698+
Christian Gaser, Robert Dahnke
699+
Structural Brain Mapping Group (http://www.neuro.uni-jena.de)
700+
Departments of Neurology and Psychiatry
701+
Jena University Hospital
702+
______________________________________________________________________
703+
685704
686705
Examples
687706
--------
@@ -714,10 +733,12 @@ def _format_arg(self, opt, spec, val):
714733

715734
def _list_outputs(self):
716735
outputs = self._outputs().get()
717-
outputs['out_file'] = fname_presuffix(self.inputs.in_files[0],
718-
newpath=os.getcwd(),
719-
prefix=self.inputs.filename_prefix,
720-
suffix=self.inputs.filename_suffix)
736+
outputs["out_file"] = fname_presuffix(
737+
self.inputs.in_files[0],
738+
newpath=os.getcwd(),
739+
prefix=self.inputs.filename_prefix,
740+
suffix=self.inputs.filename_suffix,
741+
)
721742
return outputs
722743

723744

0 commit comments

Comments
 (0)