<div dir="ltr">Hi to you unknows reader,<div><br></div><div style>I believe that it is my first time using that kind of help. Most of the time, I only use answer that are already in the web. I will try my best to make my question/situation as clear as possible. </div>
<div style><br></div><div style>Also, I am sorry for my mild english. I do know that it is not my strenght, but I do try my best.</div><div style><br></div><div style><br></div><div style>The question in one line : </div>
<div style>Is there a class/function that produce the deformation matrix of an known BSpline deformation?</div><div style><br></div><div style><br></div><div style>The context : </div><div style>I use ITK to register an image G1 to an image G0. The registration parameter are the weight of an uniformly spaced BSpline. (Thus, my deformation is non-rigid.) The interpolation function is the basic one(linea interpolation).</div>
<div style><br></div><div style>What I want is the matrix W that wrap G0 to G1. In maths : G1 = W * G0   (Where G0 and G1 are column vector)</div><div style><br></div><div style>Why would I want to obtain its explicite form and not just use ITK to wrap G0? Well, I study in optimisation and I need to be able to evaluate the following : v * W (Where v is a line vector)</div>
<div style><br></div><div style>Which cannot, from my knowledge, be done directly by ITK. </div><div style><br></div><div style>The following are work around that I tried.</div><div style><br></div><div style><br></div><div style>
First attempt:</div><div style>A first work around was to create an image with one voxel setted has 1 and the other has 0. Wrap the image with ITK and extract the deformed image. Lets say that the voxel with a 1 is the i voxel. Thus, the deformed image give me the i column of W.</div>
<div style>W * e_i = ( W_1 | W_2 | ... | W_i | ... | W_N) * e_i = W_i         (Where e_i is a vector column of 0 except at i where it is equal to 1)</div><div style><br></div><div style>But this solution is sub sub sub optimal. Having to wrap the image N time is unthinkable in computing time.</div>
<div style><br></div><div style><br></div><div style>Second attempt : </div><div style>Use the function TransformPoint( ) of the transformation class to obtain the new position of the voxel and interpolate the W matrix from that.</div>
<div style><br></div><div style>The problem is I can&#39;t understand how the linear interpolation work.</div><div style>Example :</div><div style><div>Position of the non null value : [0, 0, 0]   (e_0)</div><div>Deformed position : [0.0231481, 0, 0]</div>
<div>Value of W * e_0 at [0, 0, 0] is 0.976852   (the rest is 0)</div><div style>Which blow my mind. The voxel [0, 0, 0] got nearer from the voxel [1, 0, 0] since he is now at [0.0231481, 0, 0], but its contribution to [1, 0, 0] is null.</div>
<div><br></div><div><br></div></div><div style>Well, I hope that my explanation was complete. I didn&#39;t post my code since I believe that it is, out of context, incomprehensible.</div><div style><br></div><div style>Thank you in advance for your help,</div>
<div style>One of the many users of ITK</div></div>