Extracting The NCC for XRay2D3D

Hi Nyugen,
How can i extract the convergence value from the Python API.

73 evaluations in 0.21095 seconds, success
22.1387 -41.8056 250.542 -179.549 1.30052 89.4314 → 0.8731 (0.866556)

Hi Minhas,

We currently don’t have a dedicated Python binding function to get the similarity measure directly from the Xray2D3DRegistration algorithm. But you can try one of these workarounds:

  1. Capture the log output (suggested by one of our colleagues):
import io
from contextlib import redirect_stdout

buf = io.StringIO()
with redirect_stdout(buf):
    imf.execute_algorithm(...)

output = buf.getvalue()
print("Captured:", output)
  1. Alternately, you can get the registration matrix and geometry, and use them to simulate the DRRs and compute the similarity measure yourself.

The above mentioned approach is giving me an empty string. I shall try generating from the DRR for the same.
Imfusion Verion : 3.4.1.5