Enforce all transforms to be sf.Affine objects before call to SamsegLongitudinal class in the long cli - #35
Merged
Merged
Conversation
…he case that no lta files are passed. Ensures that downstream all transform objects are of type surfa.Affine, so the additional wrapper call to do this in the SamsegLongitudinal calls can be dropped
… cli entry point, and will be proper sf.Affine objects with the correct geometry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressing the issue raised in #34.
Cause is that the wrapper call to sf.Affine to ensure all transforms are Affine objects will discard all information about the volume's geometry when no LTA files are passed. This succeeds when the LTA files are passed as they are properly loaded via sf.load_affine, which will contain the correct metadata. Passing the geometry of the input images ensures that there is no mismatch in the grids in the case no LTAs are passed and the default np.eye(4) is used as the affine transform.
This introduces and additional, likely unecessary call to sf.load_volume, which could be handled in a future refactor of the longitudinal code. Alternatively, we could address this by adding functionality to sf.Affine that will extract the geometry information when an Affine object is passed as the matrix.