-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Support Python dispatching on PrimaryInputName #4858
Comments
@thewtex I'm glad you are looking at this issue. Is the following supposed to work well? output_image = itk.median_image_filter(input=my_float_image) (It now says TypeError: Expecting argument of type itkImageSS2 or itkImageSourceISS2). Or should the keyword argument start with a capital,
And ITK/Wrapping/Generators/Python/itk/support/template_class.py Lines 711 to 716 in 15af3ae
Regarding ITKElastix issue InsightSoftwareConsortium/ITKElastix#212, obviously, "FixedImage" and "MovingImage" are not in |
The Process object maintains a lists of index inputs and named inputs. And a named input can be marked as primary. These named inputs are already coded input many filters e.g. The information in the Process object should likely be used. |
Thanks @blowekamp I see, PDEDeformableRegistrationFilter has inputs named "FixedImage" and "MovingImage": ITK/Modules/Registration/PDEDeformable/include/itkPDEDeformableRegistrationFilter.hxx Lines 42 to 46 in 15af3ae
So then, should something like the following work, for itk.pde_deformable_registration_filter(FixedImage=float_image1, MovingImage=float_image2) (It now says TypeError: Expecting argument of type itkImageSS2 or itkImageSourceISS2) |
In procedural interface, the parameters get converted to |
I would expect ProcessObject::GetPrimaryInputName to be useful. I am not too sure of these details in ITK Python. Specifically if the Process object's name inputs/outputs are used or if it's just mapping keyword arguments to methods. Also I think that PDE deformable registration class may be a base class for the deacons methods, and I have a harder guess of which is the primary input, and how the template parameters get mapped from it. |
The keyword here to be supported would be the snake_case version of |
Dispatch Python filter types based on the type of the first ProcessObject RequiredInputName, which is exposed in Python via GetRequiredInputName and which can be the ProcessObject PrimaryInputName. This helps to address uses cases such as `itk.elastix_registration_method`, where you still want to infer the filter type based on the input fixed image type, but it may be passed in as a keyword argument, such as `itk.elastix_registration_method(moving_image=moving_image, fixed_image=fixed_image)`. Re: InsightSoftwareConsortium#4858 InsightSoftwareConsortium/ITKElastix#212
Dispatch Python filter types based on the type of the first ProcessObject RequiredInputName, which is exposed in Python via GetRequiredInputName and which can be the ProcessObject PrimaryInputName. This helps to address uses cases such as `itk.elastix_registration_method`, where you still want to infer the filter type based on the input fixed image type, but it may be passed in as a keyword argument, such as `itk.elastix_registration_method(moving_image=moving_image, fixed_image=fixed_image)`. Re: InsightSoftwareConsortium#4858 InsightSoftwareConsortium/ITKElastix#212
Will be closed via #4921 |
Dispatch Python filter types based on the type of the first ProcessObject RequiredInputName, which is exposed in Python via GetRequiredInputName and which can be the ProcessObject PrimaryInputName. This helps to address uses cases such as `itk.elastix_registration_method`, where you still want to infer the filter type based on the input fixed image type, but it may be passed in as a keyword argument, such as `itk.elastix_registration_method(moving_image=moving_image, fixed_image=fixed_image)`. Re: InsightSoftwareConsortium#4858 InsightSoftwareConsortium/ITKElastix#212
Dispatch Python filter types based on the type of the first ProcessObject RequiredInputName, which is exposed in Python via GetRequiredInputName and which can be the ProcessObject PrimaryInputName. This helps to address uses cases such as `itk.elastix_registration_method`, where you still want to infer the filter type based on the input fixed image type, but it may be passed in as a keyword argument, such as `itk.elastix_registration_method(moving_image=moving_image, fixed_image=fixed_image)`. Re: #4858 InsightSoftwareConsortium/ITKElastix#212
We should dispatch on PrimaryInputName when it is passed as a keyword argument instead of a positional parameter.
xref:
CC: @N-Dekker @mstaring
The text was updated successfully, but these errors were encountered: