Hello,
I try to implement several filters in SITK for 3D images, but I do get an error with the Anisotropic diffusion image filter. (The Gaussian, median and curvature flow are working )
def calc_anisotropicdiff(img, iterations=5, step=0.125, conductance=3):
""" The Gradient Anisotropic diffusion image filter. """
blurFilter = sitk.GradientAnisotropicDiffusionImageFilter()
blurFilter.SetNumberOfIterations(iterations)
blurFilter.SetTimeStep(step)
blurFilter.SetConductanceParameter(conductance)
imgSmooth = blurFilter.Execute(img)
return imgSmooth
The error is:
RuntimeError: Exception thrown in SimpleITK GradientAnisotropicDiffusionImageFilter_Execute: d:\a\1\sitk\code\common\include\sitkMemberFunctionFactory.hxx:196:
sitk::ERROR: Pixel type: 8-bit unsigned integer is not supported in 3D byclass itk::simple::GradientAnisotropicDiffusionImageFilter
So I tried to change my pixeltypes from uint8 to sitk.sitkFloat64, but now my image is completely black (instead of grayscale image).
Is it possible to change the datatype from unit8 to float64?