Hi Jian,<br><br>Well, as you can see, Elastix is a stand-alone program and not a library. I suspect it won'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's enough?<br>
<br>BTW, to be clear, I'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 <<a href="mailto:yaland1977@gmail.com">yaland1977@gmail.com</a>> 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'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 for the images (pyramid<br>
strategy) and for the B-spline transform (multiple grid size), but<br>
when iterations 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: "Aviv Hurvitz" <aviv.hurvitz at <a href="http://gmail.com" target="_blank">gmail.com</a>><br>
<br>
Subject: Re: [Insight-users] Is there way to speed up<br>
cross-correlation based deformable registration?<br>
To: insight-users at <a href="http://itk.org" target="_blank">itk.org</a><br>
Message-ID:<br>
<br>
<e25acca30806021202l50d68fa3j4a494ac5b4685b15 at <a href="http://mail.gmail.com" target="_blank">mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<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 <yaland1977 at <a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
<br>
<br>
> Hi all,<br>
><br>
> I'm currently working on deformable registration of CT images. I'm using<br>
> cross-correlation (DeformableRegistration6.cxx) and mutual information<br>
> (DeformableRegistration15.cxx) metrics with a B-Spline Deformable<br>
<br>
Transform<br>
> in a 300*208*241 3D image.<br>
><br>
> It seems that the example DeformableRegistration15.cxx works much faster<br>
> than example DeformableRegistration6.cxx. I guess example<br>
<br>
> DeformableRegistration6.cxx is time consuming since it is performed on<br>
the<br>
> whole image. And the Mattes Mutual Information metric works faster because<br>
> it allows to take samples (SetNumberOfSpatialSamples) in the image instead<br>
<br>
> of taking all voxels. So, I am wondering is there way to do the same thing<br>
> in the cross-correlation metric to make it faster?<br>
><br>
> Thank you very much for your reply.<br>
<br>
><br>
><br>
> Best Regards,<br>
><br>
><br>
> Jian<br>
</blockquote></div><br>