Skip to content

Conversation

@rijobro
Copy link
Contributor

@rijobro rijobro commented Jul 2, 2020

Supersedes #743.

@rijobro
Copy link
Contributor Author

rijobro commented Jul 2, 2020

@KrisThielemans Not adjoint unforunately:

ControlPointGridToDeformationConverter is not adjoint, with normalized error of 1.2098765463674779 (max: 0.0001)

I don't know if we expected it to be or what we can do if it isn't.

@KrisThielemans
Copy link
Member

I didn't see an error really. sigh. Might be worth checking if NiftyMomo moved on.

I am confused by the hierarchy. For me, NiftiImageData3DBSpline should be a data object, and then something else (the "converter") that implements the Model (which should be derived from Transformation), but it's more important that it works of course.

@KrisThielemans
Copy link
Member

KrisThielemans commented Jul 2, 2020

what about the following test to visualise this a bit more: construct the forward and backward matrices by hand, e.g.

mat=zeroes(cpg.num_elems(), dvf.num_elems())
cpg.fill(0)
for i in all_indices_in_cpg:
   cpg(i)=1
   dvf=converter.forward(cpg)
   for j in all_indices_in_dvf:
      mat(i,j)=dvf(j)
   cpg(i)=0 # reset to zero

and similar for backward. Then we compare it with the transpose in numpy. Not sure how easy this is to do.

(Note: all indices have to run over "linearised" vectors (reshaped to vectors in numpy).)

Raw matrix will be tough to look at, but can take a raw and convert to dvf, an ddisplay that for instance. should be very sparse of course.

@evgueni-ovtchinnikov evgueni-ovtchinnikov added this to the v4.0 milestone Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants