-
Notifications
You must be signed in to change notification settings - Fork 22
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
Jacobian determinant applied on the displacement field (u) or deformation field (\phi) #35
Comments
It is correct. Alternatively, you can use this version of the code to compute the Jacobian determinant. As you can see in https://github.com/MDL-UzL/L2R/blob/fc713f5baf107932a8f72ab55484bf7ac3210b57/evaluation/utils.py#L29, it also adds the identity to the field in order to compute the metric. |
Thank you @cwmok ! In the code from L2R, it seems that they add an expended diagonal matrix instead of the grid you are adding in your code. I wrote my own function and also adopted the ones from L2R and LapIRN. Would you like to run the testing script below for a quick check? Thank you for your help.
testing script:
|
Thanks, Vincent. Your code is very nice. The discrepancy is how you define the identity grid. I change the test code slightly and it passes all the test now.
|
or simpy change the indexing from 'ij' to 'xy' as below: |
Equivalent to using the parameter Elegant! Thank you @cwmok .
final testing script:
|
A summary of the question: Given the deformation field = displacement filed + grid, the Jacobian matrix of the deformation filed is
|
Hi,
Given the the deformation field is defined as \phi=u+grid, where u is the displacement filed and \phi is the deformation field used as one of the inputs of the
grid_sample
function in torch, the Jacobian determinant should be computed from the displacement field u.I was wondering why in the code, the Jacobian determinant of \phi was computed?
More information:
F_X_Y_norm
is the normalised displacement field uBest,
Vincent
The text was updated successfully, but these errors were encountered: