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?
If you configure ITK or SimpleITK using CMake-GUI or ccmake, you will be able to see the complete list of options (assuming you turn on advanced variables). Here is a screenshot:
Regarding absence of wrapping for SymmetricEigenAnalysisImageFilter, maybe try instantiating with itk.F, or enable wrapping of double type (CMake option ITK_WRAP_double)?
Thanks @dzenanz
Yes I did that for SimpleITK + SimpleElastix and after some tricks it was working.
I have tested itk.F and that gives me the same error. I will try to compile with ITK_WRAP_DOUBLE.
And concerning WRAP_VECTOR_COMPONENTS, should I compile for 2;3;4;6 as I have 6 components for the hessian?
The itk.SymmetricEigenAnalysisImageFilter operates on images of symmetric second rank tensors (a hessian matrix is a symmetric second rank tensor). It is wrapped for this type instead of double’s. We can see this from:
thanks a lot Matt
Actually, I coded a generic data format to use easily multiple libraries (sitk, numpy+ scipy, skimage, itk, opencv) for image processing. I think that the bugs come from the transfer from one data format to the other one. I will refactor a little bit to handle this issue. thanks for your code