-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile with different pixel types? #137
Comments
@NHPatterson Thanks for your question, Heath. Do you build the elastix binary yourself? If so, you may need to adjust ELASTIX_IMAGE_2D_PIXELTYPES, ELASTIX_IMAGE_3D_PIXELTYPES, or ELASTIX_IMAGE_4D_PIXELTYPES during your CMake configuration. You may select a subset of:
|
@N-Dekker I haven't been compiling elastix locally, but have been using |
I agree that having |
If I recall correctly, the current limitation of xref: SuperElastix/elastix#322 Once we update to the latest Elastix development version, should we be able to enable wrapping for these other types? |
@thewtex Do I understand correctly that the effect of the wrapping below is to support both float and double as input pixel type (but no other types)? ITKElastix/wrapping/itkElastixRegistrationMethod.wrap Lines 1 to 2 in c36279f
ITKElastix/wrapping/itkElastixRegistrationMethod.wrap Lines 1 to 2 in c36279f
|
I know that float type is supported by default. I never tried double. Other types are not supported (UC, SS, etc). That seems like the relevant specification. I will let Matt answer. Meanwhile, you could try adding all scalar types there and build it locally. |
Yes, correct. However, this would also need to be addressed: #137 (comment) |
Can you please tell me, how is the
What does the postfix "IF2IF2" of |
Postfix "IF2IF2" means that it is instantiated with those template parameters, e.g. If you look at |
Thanks @dzenanz So does that mean that by definition, the Python |
There can be multiple instantiations, e.g. IF2IF2, IF3IF3, ISS2ISS2, ISS3ISS3, etc. While different pixel types and dimensions can be mixed, there is not much advantage to do it in this case. |
For a really complicated case, take a look at this PR KitwareMedical/ITKUltrasound#223 adding a bunch of weird wrappings to ITKUltrasound. |
Thanks. There must be some manual coding done to wrap a C++ class template into a Python function, right? I mean, SWIG cannot just guess that |
Yes, the tip of the iceberg of manual specification is https://github.com/InsightSoftwareConsortium/ITKElastix/blob/c36279f04ded427d90d45ac2731e8119647c6c23/wrapping/itkElastixRegistrationMethod.wrap. Even https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Registration/Common/wrapping/itkImageRegistrationMethod.wrap is quite simple, too. A bit more convoluted is https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageGrid/wrapping/itkResampleImageFilter.wrap. And the above mentioned file from ITKUltrasound is a monster. |
Thanks, but isn't |
ITK's general Pythonification functionality turns any class in CamelCaseStyle into a function camel_case_style, and transforms the code into a series of instantiation, method calls (SetInput, SetX, SetY), Update(), and GetOutput(). Also take a look at Wrapping section. |
OK, thanks, I think I finally starts to understand a little bit! So ITKElastix instantiates itkElastixRegistrationMethod for both ITKElastix/wrapping/itkElastixRegistrationMethod.wrap Lines 1 to 2 in c36279f
float;double as CMake variables ELASTIX_IMAGE_2D_PIXEL_TYPES, ELASTIX_IMAGE_3D_PIXEL_TYPES, and ELASTIX_IMAGE_4D_PIXEL_TYPES, when doing a CMake configure of elastix? Otherwise elastix still won't instantiate the components (C++ templates) for those pixel types.
|
I believe such options would go into https://github.com/InsightSoftwareConsortium/ITKElastix/blob/main/CMakeLists.txt. As I don't see them there, I assume they are on by default. |
Closed by #211. |
Is it possible to compile the wrapped elastix to support pixel types other than
float32
? I do a lot of registration with very large microscopy planes and having just an unsigned short pixel type would save a lot of memory. I'm happy to try things out on my end if anyone could point me to the relevant code..Thanks!
The text was updated successfully, but these errors were encountered: