Skip to content
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

Add "ExternalTransform" component and ElastixRegistrationMethod::SetExternalInitialTransform #944

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

N-Dekker
Copy link
Member

Adds a component that allows specifying an ITK transform by its address in memory. The transform is then not converted to the corresponding elastix AdvancedTransform. Instead, it is only "adapted", meaning that its TransformPoint is still called directly, when using the transform. This component is only meant to be used with the elastix/transformix library, not with the elastix/transformix executable. It only serves as input transform, so it is meant not to be adjusted during registration.

Adds a SetExternalInitialTransform member function to ElastixRegistrationMethod, allowing to specify any ITK transform (for example an itk::DisplacementFieldTransform) as initial transform. Aims to address the following issue:

N-Dekker added a commit to N-Dekker/ITKElastix that referenced this pull request Aug 10, 2023
Including pull request SuperElastix/elastix#944

Adds a `SetExternalInitialTransform` member function to `ElastixRegistrationMethod`,
allowing to specify any ITK transform as initial transform.
Added `ObjectPtrToString(const itk::Object *)` and `StringToValue(const std::string &, const itk::Object *&)` to `elx::Conversion`, allowing lossless conversion between `std::string` and `itk::Object` pointer.
Including GoogleTest unit tests, itkTransformixFilter.ExternalTransform and ElastixRegistrationMethod.SetExternalTransformAsInitialTransform.
@N-Dekker
Copy link
Member Author

The GitHub Actions CI failures appear unrelated to this PR:


ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
    SimpleITK from https://files.pythonhosted.org/packages/d4/e8/f37a48af6c4df67a8bbbbab6f21cb0a30ae024d383a3c2a4d76f90e29e46/SimpleITK-2.2.1-cp37-cp37m-win_amd64.whl (from -r D:\a\elastix\elastix/Elastix-source/Testing/PythonTests/requirements.txt (line 2)):
        Expected sha256 4878f5c032d638d7833901d8d3f79d4c6ed90d041d1fcc1b074dd6e4b7c9abc2
             Got        93b4fffc1582d3d799d0f808a5469576c963eeb8533bc35b0d4d3385182d0f27

@N-Dekker N-Dekker marked this pull request as ready for review August 16, 2023 18:25
@N-Dekker
Copy link
Member Author

Discussed with @mstaring and @stefanklein at the internal weekly elastix sprint of last Monday, 14 August.

@N-Dekker N-Dekker merged commit 2393728 into main Aug 16, 2023
2 of 8 checks passed
@N-Dekker N-Dekker deleted the ExternalTransform branch August 16, 2023 18:26
N-Dekker added a commit to N-Dekker/ITKElastix that referenced this pull request Aug 16, 2023
Including pull request SuperElastix/elastix#944

Adds a `SetExternalInitialTransform` member function to `ElastixRegistrationMethod`,
allowing to specify any ITK transform as initial transform.
@N-Dekker
Copy link
Member Author

@mstaring @stefanklein Now that we have ElastixRegistrationMethod::SetExternalInitialTransform, would it be useful to add a "SetExternalTransform" member function to TransformixFilter as well? TransformixFilter already has a SetTransform that accepts an ITK transform as input. But only if it can be converted to an existing elastix component (Translation, Affine, Euler, Similarity, Bspline). TransformixFilter::SetExternalTransform would support any arbitrary ITK transform.

@stefanklein
Copy link
Member

stefanklein commented Aug 17, 2023 via email

@mstaring
Copy link
Member

mstaring commented Aug 17, 2023 via email

@N-Dekker
Copy link
Member Author

Here it is, the TransformixFilter::SetExternalTransform pull request:

N-Dekker added a commit that referenced this pull request Jul 2, 2024
- The logging in `itkElastixRegistrationMethod.SetExternalTransformAsInitialTransform` was originally enabled with pull request #944 commit aa5cc03 "ENH: Add "ExternalTransform" component"
N-Dekker added a commit that referenced this pull request Jul 2, 2024
- The logging in `itkElastixRegistrationMethod.SetExternalTransformAsInitialTransform` was originally enabled with pull request #944 commit aa5cc03 "ENH: Add "ExternalTransform" component"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants