BUG: Jacobian determinants incorrect for non-identity direction matrices#1887
Merged
BUG: Jacobian determinants incorrect for non-identity direction matrices#1887
Conversation
From cross-referencing with itkDisplacementFieldTransform, I believe the following issues were causing problems: 1. The displacement vectors were transformed by the direction matrix, but they are already in physical space 2. The jacobian matrix was transposed 3. A rotation was done to the final matrix to rebase to physical space, but I don't think that's right, ITK does a transform of the partial derivatives My tests for all this is can integration over the jacobians in the fixed space accurately predict the expansion / contraction of a label image, across multiple configurations of the image direction matrix. The "geometric" option for CreateJacobianDeterminantImage consistently has slightly larger prediction errors, but didn't have any of the massive discrepencies with non-identity direction matrices.
Removed some features because only one set of options are used in CreateJacobianDeterminantImage, and I don't have time to validate them all
Member
Author
|
Tested on brain data https://upenn.box.com/s/xj5u142w1n634aob831o4f3pbi71yuds I'm convinced now that this fix is necessary for correct determinants on non-axial data. |
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.
Discussed in #1884
I added more examples with synthetic data at
https://github.com/cookpa/antsJacobianExample
I think the Jacobian matrix as well as the determinant were not properly computed in physical space. For some cases, these errors could cancel out leading to results that appear correct.
I've simplified the ANTs Jacobian filter to behave more like the itkDisplacementFieldTransform method, which works consistently well across different image orientations.
I would really like some validation on external real data, but don't have time to pursue that for a couple of weeks at least. Opening a draft PR for feedback