Hi Jian,<br><br>Well, as you can see, Elastix is a stand-alone program and not a library. I suspect it won&#39;t be easy for you to integrate it into your program on the source-code level. <br><br>What I actually do is run Elastix as a separate program when I need it, and then I parse its output file to get the final transform parameters. In my case, this was much easier than trying to get my classes to compile with it.<br>
<br>Regarding your speed problem, I think the largest factors really are the number of samples and the pyramid level. Consider skipping the last pyramid level, or limit the number of iterations. If you got a good registration on the second-to-last level, maybe that&#39;s enough?<br>
<br>BTW, to be clear, I&#39;m not an Elasitx developer.<br><br>Hope it helps.<br><br>- Aviv<br><br><br><div class="gmail_quote">On Thu, Jun 5, 2008 at 5:52 PM, Jian Yang &lt;<a href="mailto:yaland1977@gmail.com">yaland1977@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Aviv, I still have several questions about this issue:<br>
<br>
1. How to specify samples for the cross-correlation based<br>
registration? Could you please give me piece of sample code?<br>
<br>
I compiled the elastix program and I found it is very much<br>
powerful.The sampler methods developed in this package are exactly<br>
what I need, but I still don&#39;t know how to made the codes integrate<br>
into my program. Could you please give me some advises?<br>
<br>
<br>
2. I computed the metric gradient, but it does not seem to work well.<br>
I think probably because the image is too big for the computation.<br>
<br>
<br>
3. I used multiple resolution strategy &nbsp;for the images (pyramid<br>
strategy) and for the B-spline transform (multiple grid size), but<br>
when iterations &nbsp;reach higher level, it runs still very slow.<br>
<br>
<br>
So, I think probably the best way to speed up the cross-correlation<br>
based large data sets registration is firstly specify the computation<br>
samples (random sample, grid sample etc.), and then use multiple<br>
resolution strategies.<br>
<br>
<br>
Thank you very much for your reply. Any help would be greatly appreciated.<br>
<br>
<br>
Jian<br>
<br>
<br>
<br>
Hi Aviv, Thank you very much for your help.<br>
<br>
Jian<br>
<br>
<br>
Date: Mon, 2 Jun 2008 22:02:09 +0300<br>
From: &quot;Aviv Hurvitz&quot; &lt;aviv.hurvitz at <a href="http://gmail.com" target="_blank">gmail.com</a>&gt;<br>
<br>
Subject: Re: [Insight-users] Is there way to speed up<br>
 &nbsp; &nbsp; &nbsp; cross-correlation &nbsp; &nbsp; &nbsp; based deformable registration?<br>
To: insight-users at <a href="http://itk.org" target="_blank">itk.org</a><br>
Message-ID:<br>
<br>
 &nbsp; &nbsp; &nbsp; &lt;e25acca30806021202l50d68fa3j4a494ac5b4685b15 at <a href="http://mail.gmail.com" target="_blank">mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
See if you can use the elastix program (which is based on ITK code).<br>
<br>
<a href="http://elastix.isi.uu.nl/index.php" target="_blank">http://elastix.isi.uu.nl/index.php</a><br>
<br>
It has several speed improvements:<br>
1. You can specify samples.<br>
2. It utilizes the sparse Jacobian of the B-spline transform for faster<br>
<br>
computation of the metric gradient.<br>
3. You can use a multiple resolution strategy, both for the images and for<br>
the B-spline transform itself.<br>
<br>
- Aviv<br>
<br>
<br>
On Mon, Jun 2, 2008 at 9:20 PM, Jian Yang &lt;yaland1977 at <a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:<br>
<br>
<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I&#39;m currently working on deformable registration of CT images. I&#39;m using<br>
&gt; cross-correlation (DeformableRegistration6.cxx) and mutual information<br>
&gt; (DeformableRegistration15.cxx) metrics with a B-Spline Deformable<br>
<br>
Transform<br>
&gt; in a 300*208*241 3D image.<br>
&gt;<br>
&gt; It seems that the example DeformableRegistration15.cxx &nbsp;works much faster<br>
&gt; than example DeformableRegistration6.cxx. I guess example<br>
<br>
&gt; DeformableRegistration6.cxx &nbsp;is time consuming since it is performed on<br>
the<br>
&gt; whole image. And the Mattes Mutual Information metric works faster because<br>
&gt; it allows to take samples (SetNumberOfSpatialSamples) in the image instead<br>
<br>
&gt; of taking all voxels. So, I am wondering is there way to do the same thing<br>
&gt; in the cross-correlation metric to make it faster?<br>
&gt;<br>
&gt; Thank you very much for your reply.<br>
<br>
&gt;<br>
&gt;<br>
&gt; Best Regards,<br>
&gt;<br>
&gt;<br>
&gt; Jian<br>
</blockquote></div><br>