I am using the
hessian_recursive_gaussian_image_filter method from ITK wrapper in python. But I am facing 2 related problems:
- My IO pipeline is based on SITK and I am transforming SITK to ITK using this topic.
itk_image= itk.GetImageFromArray(sitk.GetArrayFromImage(sitk_image), is_vector = sitk_image.GetNumberOfComponentsPerPixel()>1) output.SetSpacing(sitk_image.GetSpacing()) output.SetOrigin(sitk_image.GetOrigin()) output.SetDirection(itk.GetMatrixFromArray(np.reshape(np.array(sitk_image.GetDirection()), [len(sitk_image.GetSize())]*2)))
- I am using
SymmetricEigenAnalysisImageFilterto extract the hessian matrix and the eigen values.
hessian_matrix = itk.hessian_recursive_gaussian_image_filter(get_itk_from_sitk(sitk_image), sigma=3, normalize_across_scale=True) eigen_filter = itk.SymmetricEigenAnalysisImageFilter[itk.D].New(hessian_matrix) eigen_filter.OrderEigenValuesBy() eigen_filter.SetDimension(3) eigen_filter.Update() eigen_values = eigen_filter.GetOutput()
The hessian_matrix is a vector with PixelID Double and dimension 6. Actually the eigen output error is :
itkTemplate.TemplateTypeError: itk.SymmetricEigenAnalysisImageFilter is not wrapped for input type 'itk.D'..
And the sitk_to_itk method output error also when I give the hessian vector as input:
itkTemplate.TemplateTypeError: itk.Image is not wrapped for input type 'itk.D, int'.
I have re-code all the filters in numpy and it is working (using the ArrayView from itk/sitk). But actually, I would like to try ITK filters. I should probably compile ITK with python wrapper ON. I have seen that environment variables must be added into CMAKE (ITK_WRAP_ and ITK_WRAP_IMAGE_DIMS) . But it is not clear which variable name to put in SITK. And resources needed to compile it?
thanks in advance for your help