Calculate harmonic energy of displacement vector field (DVF)

After registration produces DVF, how to use 3Dslicer to calculate its jacobian and harmonic energy.Just like the evaluation framework in this article:A framework for deformable image registration validation in radiotherapy clinical applications.I can’t find this function?

Sliver has several modules for qualitative, quantitative, and clinical application specific evaluation of registration.

If there are any additional metrics described in “A framework for deformable image registration validation in radiotherapy clinical applications” paper that you cannot find in Slicer then please contact the authors and ask them how to access those methods and report back to us. We can then help in getting those methods available in current version of Slicer.

1 Like

thank you very much,I found the Jacobian but I can not found harmonic energy of DVF,

I’m not sure if harmonic energy has any clinically relevant meaning and it is not commonly used, so you not miss much by not computing it. If you want the value anyway then contact the authors of the paper that you referred to above.

Thank you very much for your suggestion. Maybe I can take advantage of other features of DVF and give up one to find a more clinically available feature.

Hi all,

I am now doing quantitative evaluation of registration and I plan to use three categories of metrics.

  1. Segment comparison: Hausdorff distance and Dice similarity coefficient
  2. Deformation vector field: Jacobian determinant
  3. Anatomical landmarks: Target registration error

I could’t find where to calculate TRE. I wonder if the Fiducial registration wizard module is similar to the TRE calculation.

Besides, is the Jacobian calculated within “RegistrationQA” module (Sorry but I couldn’t find it)? And the module can’t be installed using the latest Slicer preview version? (The log is shown below)

Hope for some suggestions. Thanks.

Error Log

Traceback (most recent call last):
File “”, line 1, in
File “D:\Slicer 4.11.0-2019-08-13\lib\Python\Lib\”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 674, in exec_module
File “”, line 781, in get_code
File “”, line 741, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “C:/Users/Administrator/AppData/Roaming/NA-MIC/Extensions-28438/RegistrationQA/lib/Slicer-4.11/qt-scripted-modules/”, line 294
except Exception, e:
SyntaxError: invalid syntax
loadSourceAsModule - Failed to load file “C:/Users/Administrator/AppData/Roaming/NA-MIC/Extensions-28438/RegistrationQA/lib/Slicer-4.11/qt-scripted-modules/” as module “CreateRegistrationHierarchy” !
Fail to instantiate module “CreateRegistrationHierarchy”
The following modules failed to be instantiated:


The module seem to use some Python2 syntax that is not compatible with Python3. It would be great if you could give it a go and make the changes (e.g., except Exception as e instead except Exception, e) and submit a pull request. If you have trouble fixing all the issues then let us know.

Fiducial registration wizard computes TRE (as RMS of the distance between fixed points and transformed moving points).

1 Like

Thanks for your reply. Sorry but I am not familiar with python programming. Could you explain more about how to do that? Thanks a lot!

Besides, I have downloaded an early version of slicer which is compatible with Python2 (Slicer-4.11.0-2019-02-27-win-amd64) and gave it a try. But I still failed to calculate the “Fiducial Distance, Contour Measures, Inverse Consistency” after assigning roles (the Log is shown below). What’s more, when I click the “Jacobian determinant”, the software crashed down (showing something wrong with the vtkSlicerRegistrationQAModuleLogic.dll)? Is there something wrong with the module? Hope for some advice. Your help is highly appreciated!


Reading RegistrationQA parameter node
Reading RegistrationQA parameter node
Volumes not set!

InverseConsist: Can’t calculate inverse consistency!

CalculateRegQAFrom: Can’t calculate inverse consistency!

CalculateContourStatistic: No transform or vector!

CreateTransormFromVector: Volumes not set!

CalculateFiducialsDistance: Invalid input parameters!

CalculateRegQAFrom: Cannot calculate Fiducal distance!



Finally I have fixed all the issues with the syntax and succeeded in calculating all the values. And I found that the reason why slicer crashed down and output nothing was the incorrect input (the dvf must be loaded as “volume” but not “transform”). Very useful extension! Thank you all for building and integrating it with slicer.


Great! I don’t see any pull requests with your changes here. Make sure you push all your changes to your fork and submit a pull request to the official repository to make RegistrationQA work for others, too (and to remove the burden of maintenance work from you). Thanks!

1 Like


I have submitted a pull request with my changes. I’m glad that I could ever make some contributions (never before).

Besides, I have a question relating to the evaluation of Jacobian determinant. I have registered two ct images which have different voxel intensities of ROI because of tumor resection and post-surgical changes. I wonder how to quantify the impact of intensity variation? Could the jacobian metric indicate something? (I am not sure about the interpretation of jacobian) Hope for some suggestions. Thank you!


Could you please post the link to the pull request (just to make sure it is merged)?

We are glad, too, congratulations! :champagne:

Usually when there is no correspondence between two images (instrument is visible in an intra-procedural image, tumor is not visible in post-procedural image, etc.) then you mask out that region in the images to make sure you don’t introduce any errors by trying to match unrelated things. These masked regions probably have to be excluded from further analysis, too.

Thanks for your extended help. I will focus more on the related things. Besides, here is the link pull request.


Thank you, I’ve found the updated file that you uploaded. It is not a “pull request” just an upload to your forked version of the repository, so the original author was not notified. I’ve created a pull request now (see here), so your changes will hopefully get into the official version soon.

Thank you for keep following. I have checked that the pull request is now merged. Sorry that I forgot to pull request in the original repository. Thanks again for all your efforts in building slicer! :slightly_smiling_face:


1 Like

Hi all,

I’m using Registration QA extension to calculate the Jacobian Determinant. I want to calculate it within specific segment (from Segmentation Module). The “Create ROI around segments” button could create a rectangular box around segment. However it’s not so conformal. How could I implement this? Where could I modify the source code?

Hope for some suggestions. Thanks a lot!