No subject


Fri May 16 13:32:40 EDT 2008


the ImageToImageMetric, and adds some stuff, such as samplers. However,
this class also adds loads of other functionality, which you may not
need. For example, you may want to remove the Limiter support. The
AdvancedImageToImageMetric also depends on the CombinationTransform. If
you want this functionality you can simply copy it from Common,
otherwise substitute CombinationTransform with itk::Transform.
=20
It is easiest to just take it all. Usually you have the option of simply
not using some functionality.
=20
Regards,
=20
Marius
=20
PS: We are planning to make one or more Insight Journal contributions,
so hopefully parts of elastix can be found in a future version of the
ITK.
=20
=20
=20
________________________________

From: insight-users-bounces at itk.org
[mailto:insight-users-bounces at itk.org] On Behalf Of Aviv Hurvitz
Sent: Thursday, June 05, 2008 11:49 PM
To: Jian Yang; insight-users at itk.org
Subject: Re: [Insight-users] Is there way to speed up
cross-correlationbased deformable registration?



	Hi Jian,
=09
	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.=20
=09
	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.
=09
	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?
=09
	BTW, to be clear, I'm not an Elasitx developer.
=09
	Hope it helps.
=09
	- Aviv
=09
=09
=09
	On Thu, Jun 5, 2008 at 5:52 PM, Jian Yang <yaland1977 at gmail.com>
wrote:
=09

		Hi Aviv, I still have several questions about this
issue:
	=09
		1. How to specify samples for the cross-correlation
based
		registration? Could you please give me piece of sample
code?
	=09
		I compiled the elastix program and I found it is very
much
		powerful.The sampler methods developed in this package
are exactly
		what I need, but I still don't know how to made the
codes integrate
		into my program. Could you please give me some advises?
	=09
	=09
		2. I computed the metric gradient, but it does not seem
to work well.
		I think probably because the image is too big for the
computation.
	=09
	=09
		3. I used multiple resolution strategy  for the images
(pyramid
		strategy) and for the B-spline transform (multiple grid
size), but
		when iterations  reach higher level, it runs still very
slow.
	=09
	=09
		So, I think probably the best way to speed up the
cross-correlation
		based large data sets registration is firstly specify
the computation
		samples (random sample, grid sample etc.), and then use
multiple
		resolution strategies.
	=09
	=09
		Thank you very much for your reply. Any help would be
greatly appreciated.
	=09
	=09
		Jian
	=09
	=09
	=09
		Hi Aviv, Thank you very much for your help.
	=09
		Jian
	=09
	=09
		Date: Mon, 2 Jun 2008 22:02:09 +0300
		From: "Aviv Hurvitz" <aviv.hurvitz at gmail.com>
	=09
		Subject: Re: [Insight-users] Is there way to speed up
		      cross-correlation       based deformable
registration?
		To: insight-users at itk.org
		Message-ID:
	=09
		      <e25acca30806021202l50d68fa3j4a494ac5b4685b15 at
mail.gmail.com>
		Content-Type: text/plain; charset=3D"iso-8859-1"
	=09
		See if you can use the elastix program (which is based
on ITK code).
	=09
		http://elastix.isi.uu.nl/index.php
	=09
		It has several speed improvements:
		1. You can specify samples.
		2. It utilizes the sparse Jacobian of the B-spline
transform for faster
	=09
		computation of the metric gradient.
		3. You can use a multiple resolution strategy, both for
the images and for
		the B-spline transform itself.
	=09
		- Aviv
	=09
	=09
		On Mon, Jun 2, 2008 at 9:20 PM, Jian Yang <yaland1977 at
gmail.com> wrote:
	=09
	=09
		> Hi all,
		>
		> I'm currently working on deformable registration of CT
images. I'm using
		> cross-correlation (DeformableRegistration6.cxx) and
mutual information
		> (DeformableRegistration15.cxx) metrics with a B-Spline
Deformable
	=09
		Transform
		> in a 300*208*241 3D image.
		>
		> It seems that the example DeformableRegistration15.cxx
works much faster
		> than example DeformableRegistration6.cxx. I guess
example
	=09
		> DeformableRegistration6.cxx  is time consuming since
it is performed on
		the
		> whole image. And the Mattes Mutual Information metric
works faster because
		> it allows to take samples (SetNumberOfSpatialSamples)
in the image instead
	=09
		> of taking all voxels. So, I am wondering is there way
to do the same thing
		> in the cross-correlation metric to make it faster?
		>
		> Thank you very much for your reply.
	=09
		>
		>
		> Best Regards,
		>
		>
		> Jian
	=09


	No virus found in this incoming message.
	Checked by AVG.
	Version: 8.0.100 / Virus Database: 270.0.0/1486 - Release Date:
6/5/2008 6:29 PM
=09

=09


------_=_NextPart_001_01C8C7A8.EB836EB4
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3314" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>Hi Jian,</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>if you want to take parts of the elastix code =
you are=20
more than welcome. What you need to do is take</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>-&nbsp;some stuff from=20
elastix\src\Common</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>-&nbsp;everything from=20
elastix\src\Common\ImageSamplers</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>- and of course the metric implementation =
that takes=20
advantage of these things:=20
elastix\src\Components\Metrics\AdvancedNormalizedCorrelation</SPAN></FONT=
></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT><FONT face=3DArial =
color=3D#0000ff=20
size=3D2><SPAN class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>From Common you need the =
AdvancedImageToImageMetric=20
that inherits from the ImageToImageMetric, and adds some stuff, such as=20
samplers. However, this class also adds loads of other functionality, =
which you=20
may not need. For example, you may want to remove the Limiter support. =
The=20
AdvancedImageToImageMetric also depends on the CombinationTransform. If =
you want=20
this functionality you can simply copy it from Common, otherwise =
substitute=20
CombinationTransform with itk::Transform.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>It is easiest to just take it all. Usually =
you have the=20
option of simply not using some functionality.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>Regards,</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>Marius</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008>PS: We are planning to make one or more =
Insight=20
Journal&nbsp;contributions, so hopefully parts of elastix can be found =
in a=20
future version of the ITK.</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff =
size=3D2><SPAN=20
class=3D718032707-06062008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DTahoma size=3D2><B>From:</B>=20
insight-users-bounces at itk.org [mailto:insight-users-bounces at itk.org] =
<B>On=20
Behalf Of </B>Aviv Hurvitz<BR><B>Sent:</B> Thursday, June 05, 2008 11:49 =

PM<BR><B>To:</B> Jian Yang; insight-users at itk.org<BR><B>Subject:</B> Re: =

[Insight-users] Is there way to speed up cross-correlationbased =
deformable=20
registration?<BR></FONT><BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>Hi Jian,<BR><BR>Well, as you can see, Elastix is a =
stand-alone=20
  program and not a library. I suspect it won't be easy for you to =
integrate it=20
  into your program on the source-code level. <BR><BR>What I actually do =
is run=20
  Elastix as a separate program when I need it, and then I parse its =
output file=20
  to get the final transform parameters. In my case, this was much =
easier than=20
  trying to get my classes to compile with it.<BR><BR>Regarding your =
speed=20
  problem, I think the largest factors really are the number of samples =
and the=20
  pyramid level. Consider skipping the last pyramid level, or limit the =
number=20
  of iterations. If you got a good registration on the second-to-last =
level,=20
  maybe that's enough?<BR><BR>BTW, to be clear, I'm not an Elasitx=20
  developer.<BR><BR>Hope it helps.<BR><BR>- Aviv<BR><BR><BR>
  <DIV class=3Dgmail_quote>On Thu, Jun 5, 2008 at 5:52 PM, Jian Yang =
&lt;<A=20
  href=3D"mailto:yaland1977 at gmail.com">yaland1977 at gmail.com</A>&gt; =
wrote:<BR>
  <BLOCKQUOTE class=3Dgmail_quote=20
  style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">Hi=20
    Aviv, I still have several questions about this issue:<BR><BR>1. How =
to=20
    specify samples for the cross-correlation based<BR>registration? =
Could you=20
    please give me piece of sample code?<BR><BR>I compiled the elastix =
program=20
    and I found it is very much<BR>powerful.The sampler methods =
developed in=20
    this package are exactly<BR>what I need, but I still don't know how =
to made=20
    the codes integrate<BR>into my program. Could you please give me =
some=20
    advises?<BR><BR><BR>2. I computed the metric gradient, but it does =
not seem=20
    to work well.<BR>I think probably because the image is too big for =
the=20
    computation.<BR><BR><BR>3. I used multiple resolution strategy =
&nbsp;for the=20
    images (pyramid<BR>strategy) and for the B-spline transform =
(multiple grid=20
    size), but<BR>when iterations &nbsp;reach higher level, it runs =
still very=20
    slow.<BR><BR><BR>So, I think probably the best way to speed up the=20
    cross-correlation<BR>based large data sets registration is firstly =
specify=20
    the computation<BR>samples (random sample, grid sample etc.), and =
then use=20
    multiple<BR>resolution strategies.<BR><BR><BR>Thank you very much =
for your=20
    reply. Any help would be greatly=20
    appreciated.<BR><BR><BR>Jian<BR><BR><BR><BR>Hi Aviv, Thank you very =
much for=20
    your help.<BR><BR>Jian<BR><BR><BR>Date: Mon, 2 Jun 2008 22:02:09=20
    +0300<BR>From: "Aviv Hurvitz" &lt;aviv.hurvitz at <A =
href=3D"http://gmail.com"=20
    target=3D_blank>gmail.com</A>&gt;<BR><BR>Subject: Re: =
[Insight-users] Is there=20
    way to speed up<BR>&nbsp; &nbsp; &nbsp; cross-correlation &nbsp; =
&nbsp;=20
    &nbsp; based deformable registration?<BR>To: insight-users at <A=20
    href=3D"http://itk.org" =
target=3D_blank>itk.org</A><BR>Message-ID:<BR><BR>&nbsp;=20
    &nbsp; &nbsp; &lt;e25acca30806021202l50d68fa3j4a494ac5b4685b15 at <A =

    href=3D"http://mail.gmail.com"=20
    target=3D_blank>mail.gmail.com</A>&gt;<BR>Content-Type: text/plain;=20
    charset=3D"iso-8859-1"<BR><BR>See if you can use the elastix program =
(which is=20
    based on ITK code).<BR><BR><A =
href=3D"http://elastix.isi.uu.nl/index.php"=20
    target=3D_blank>http://elastix.isi.uu.nl/index.php</A><BR><BR>It has =
several=20
    speed improvements:<BR>1. You can specify samples.<BR>2. It utilizes =
the=20
    sparse Jacobian of the B-spline transform for =
faster<BR><BR>computation of=20
    the metric gradient.<BR>3. You can use a multiple resolution =
strategy, both=20
    for the images and for<BR>the B-spline transform itself.<BR><BR>-=20
    Aviv<BR><BR><BR>On Mon, Jun 2, 2008 at 9:20 PM, Jian Yang =
&lt;yaland1977 at=20
    <A href=3D"http://gmail.com" target=3D_blank>gmail.com</A>&gt;=20
    wrote:<BR><BR><BR>&gt; Hi all,<BR>&gt;<BR>&gt; I'm currently working =
on=20
    deformable registration of CT images. I'm using<BR>&gt; =
cross-correlation=20
    (DeformableRegistration6.cxx) and mutual information<BR>&gt;=20
    (DeformableRegistration15.cxx) metrics with a B-Spline=20
    Deformable<BR><BR>Transform<BR>&gt; in a 300*208*241 3D=20
    image.<BR>&gt;<BR>&gt; It seems that the example=20
    DeformableRegistration15.cxx &nbsp;works much faster<BR>&gt; than =
example=20
    DeformableRegistration6.cxx. I guess example<BR><BR>&gt;=20
    DeformableRegistration6.cxx &nbsp;is time consuming since it is =
performed=20
    on<BR>the<BR>&gt; whole image. And the Mattes Mutual Information =
metric=20
    works faster because<BR>&gt; it allows to take samples=20
    (SetNumberOfSpatialSamples) in the image instead<BR><BR>&gt; of =
taking all=20
    voxels. So, I am wondering is there way to do the same thing<BR>&gt; =
in the=20
    cross-correlation metric to make it faster?<BR>&gt;<BR>&gt; Thank =
you very=20
    much for your reply.<BR><BR>&gt;<BR>&gt;<BR>&gt; Best=20
    Regards,<BR>&gt;<BR>&gt;<BR>&gt; Jian<BR></BLOCKQUOTE></DIV><BR>
  <P><FONT face=3DArial size=3D2>No virus found in this incoming =
message.<BR>Checked=20
  by AVG.<BR>Version: 8.0.100 / Virus Database: 270.0.0/1486 - Release =
Date:=20
  6/5/2008 6:29 PM<BR></FONT></P>
  <P><FONT face=3DArial size=3D2></FONT></P></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C8C7A8.EB836EB4--


More information about the Insight-users mailing list