We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f0e16b commit e8f75f4Copy full SHA for e8f75f4
1 file changed
src/Filtering/Smoothing/SmoothImageWithDiscreteGaussianFilter/Code.py
@@ -0,0 +1,22 @@
1
+PixelType = itk.F
2
+
3
+# Read Image in float data type
4
+inputImage = itk.imread(inputFileName, PixelType)
5
6
+# Check some information from the inputImage
7
+print('Shape ', inputImage.shape)
8
+print('dtype is ', inputImage.dtype)
9
+print('type is ', type(inputImage))
10
11
+variance = 4.0
12
+filteredImage = itk.discrete_gaussian_image_filter(inputImage, variance=variance)
13
14
+# Check some information from the filteredImage
15
+print('Shape ', filteredImage.shape)
16
+print('dtype is ', filteredImage.dtype)
17
+print('type is ', type(filteredImage))
18
19
+# Visualize the result using matplotlib
20
+import matplotlib.pyplot as plt
21
+plt.imshow(filteredImage)
22
+plt.show()
0 commit comments