File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/Filtering/Smoothing/SmoothImageWithDiscreteGaussianFilter Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments