Skip to content

Commit 05bd86a

Browse files
committed
STYLE: Run black on all Python examples
1 parent 0175c88 commit 05bd86a

File tree

67 files changed

+474
-374
lines changed
  • src
    • Bridge/VtkGlue
      • ConvertAnRGBitkImageTovtkImageData
      • ConvertAnitkImageTovtkImageData
      • ConvertRGBvtkImageDataToAnitkImage
      • ConvertvtkImageDataToAnitkImage
    • Core
    • Filtering
      • AnisotropicSmoothing
        • ComputeCurvatureAnisotropicDiffusion
        • ComputeCurvatureFlow
        • ComputeGradientAnisotropicDiffusion
        • ComputePeronaMalikAnisotropicDiffusion
      • AntiAlias/SmoothBinaryImageBeforeSurfaceExtraction
      • BinaryMathematicalMorphology
      • Colormap/CreateACustomColormap
      • ImageFeature
      • ImageFilterBase/CastAnImageToAnotherType
      • ImageFusion/OverlayLabelMapOnTopOfAnImage
      • ImageGradient
        • ApplyGradientRecursiveGaussianWithVectorInput
        • ApplyGradientRecursiveGaussian
        • ComputeGradientMagnitudeRecursiveGaussian
      • ImageGrid
      • ImageIntensity
      • ImageStatistics/AdaptiveHistogramEqualizationImageFilter
      • MathematicalMorphology
      • Smoothing
        • BlurringAnImageUsingABinomialKernel
        • ComputesSmoothingWithGaussianKernel
      • Thresholding
    • IO
    • Nonunit/Review/SegmentBloodVesselsWithMultiScaleHessianBasedMeasure
    • Numerics
      • Optimizers/ExhaustiveOptimizer
      • Statistics/HistogramCreationAndBinAccess
    • Registration
      • Common/Perform2DTranslationRegistrationWithMeanSquares
      • Metricsv4/RegisterTwoPointSets

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+474
-374
lines changed

src/Bridge/VtkGlue/ConvertAnRGBitkImageTovtkImageData/Code.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
import itk
1919

2020
from distutils.version import StrictVersion as VS
21+
2122
if VS(itk.Version.GetITKVersion()) < VS("4.10.0"):
2223
print("ITK 4.10.0 is required.")
2324
sys.exit(1)
2425

2526
if len(sys.argv) != 2:
26-
print('Usage: ' + sys.argv[0] + ' <InputFileName>')
27+
print("Usage: " + sys.argv[0] + " <InputFileName>")
2728
sys.exit(1)
2829
imageFileName = sys.argv[1]
2930

src/Bridge/VtkGlue/ConvertAnitkImageTovtkImageData/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import itk
1919

2020
if len(sys.argv) != 2:
21-
print('Usage: ' + sys.argv[0] + ' <InputFileName>')
21+
print("Usage: " + sys.argv[0] + " <InputFileName>")
2222
sys.exit(1)
2323
imageFileName = sys.argv[1]
2424

src/Bridge/VtkGlue/ConvertRGBvtkImageDataToAnitkImage/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import vtk
2020

2121
if len(sys.argv) < 2:
22-
print('Usage: ' + sys.argv[0] + ' <InputFileName>')
22+
print("Usage: " + sys.argv[0] + " <InputFileName>")
2323
sys.exit(1)
2424
imageFileName = sys.argv[1]
2525

src/Bridge/VtkGlue/ConvertvtkImageDataToAnitkImage/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import vtk
2020

2121
if len(sys.argv) < 2:
22-
print('Usage: ' + sys.argv[0] + ' <InputFileName>')
22+
print("Usage: " + sys.argv[0] + " <InputFileName>")
2323
sys.exit(1)
2424
imageFileName = sys.argv[1]
2525

src/Core/Common/AddOffsetToIndex/Code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import itk
1919

2020
from distutils.version import StrictVersion as VS
21+
2122
if VS(itk.Version.GetITKVersion()) < VS("4.9.0"):
2223
print("ITK 4.9.0 is required.")
2324
sys.exit(1)

src/Core/Common/BoundingBoxOfAPointSet/Code.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
import platform
1919

2020
Dimension = 3
21-
CoordType = itk.ctype('float')
21+
CoordType = itk.ctype("float")
2222
# Windows requires unsigned long long for 64-bit identifiers
23-
if platform.system() == 'Windows':
24-
ElementIdentifierType = itk.ctype('unsigned long long')
23+
if platform.system() == "Windows":
24+
ElementIdentifierType = itk.ctype("unsigned long long")
2525
else:
26-
ElementIdentifierType = itk.ctype('unsigned long')
26+
ElementIdentifierType = itk.ctype("unsigned long")
2727

2828

2929
PointSetType = itk.PointSet[CoordType, Dimension]
@@ -50,10 +50,12 @@
5050
points.InsertElement(1, p1)
5151
points.InsertElement(2, p2)
5252

53-
VecContType = itk.VectorContainer[ElementIdentifierType,
54-
itk.Point[CoordType, Dimension]]
55-
BoundingBoxType = itk.BoundingBox[ElementIdentifierType,
56-
Dimension, CoordType, VecContType]
53+
VecContType = itk.VectorContainer[
54+
ElementIdentifierType, itk.Point[CoordType, Dimension]
55+
]
56+
BoundingBoxType = itk.BoundingBox[
57+
ElementIdentifierType, Dimension, CoordType, VecContType
58+
]
5759

5860
boundingBox = BoundingBoxType.New()
5961
boundingBox.SetPoints(points)

src/Core/Common/ComputeTimeBetweenPoints/Code.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ def LongFunction():
2323
for i in range(int(1e5)):
2424
a = 0.0 # noqa: F841
2525

26+
2627
clock = itk.TimeProbe()
2728

2829
clock.Start()
2930
LongFunction()
3031

3132
clock.Stop()
32-
print('Mean: ' + str(clock.GetMean()))
33-
print('Total: ' + str(clock.GetTotal()))
33+
print("Mean: " + str(clock.GetMean()))
34+
print("Total: " + str(clock.GetTotal()))
3435

3536
clock.Start()
3637
LongFunction()
3738

3839
clock.Stop()
39-
print('Mean: ' + str(clock.GetMean()))
40-
print('Total: ' + str(clock.GetTotal()))
40+
print("Mean: " + str(clock.GetMean()))
41+
print("Total: " + str(clock.GetTotal()))
4142

4243
clock.Report()

src/Core/Common/CreateAnImage/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import itk
1818

1919
Dimension = 3
20-
PixelType = itk.ctype('unsigned char')
20+
PixelType = itk.ctype("unsigned char")
2121
ImageType = itk.Image[PixelType, Dimension]
2222

2323
image = ImageType.New()

src/Core/Common/CreateAnImageOfVectors/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import itk
1818

1919
Dimension = 3
20-
ComponentType = itk.ctype('float')
20+
ComponentType = itk.ctype("float")
2121
PixelType = itk.Vector[ComponentType, Dimension]
2222
ImageType = itk.Image[PixelType, Dimension]
2323

src/Core/Common/CreateAnRGBImage/Code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
import itk
1818

1919
Dimension = 2
20-
RGBPixelType = itk.RGBPixel[itk.ctype('unsigned char')]
20+
RGBPixelType = itk.RGBPixel[itk.ctype("unsigned char")]
2121

2222
image = itk.Image[RGBPixelType, Dimension].New()

0 commit comments

Comments
 (0)