<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=245002312-29112005><FONT face=Arial color=#0000ff size=2>Which
compiler are you using? What optimization level? ITK is very sensitive to
optimization. On Windows you should build RelWithDebInfo or Release. Debug
builds are very slow.</FONT></SPAN></DIV>
<DIV><SPAN class=245002312-29112005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=245002312-29112005><FONT face=Arial color=#0000ff
size=2>Bill</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
insight-users-bounces+lorensen=crd.ge.com@itk.org
[mailto:insight-users-bounces+lorensen=crd.ge.com@itk.org]<B>On Behalf Of
</B>Renaud Isabelle<BR><B>Sent:</B> Monday, November 28, 2005 5:04
PM<BR><B>To:</B> insight-users@itk.org<BR><B>Subject:</B> [Insight-users] my
ITK code is slow: what is wrong? <BR><BR></FONT></DIV>
<DIV id=RTEContent>Hi,</DIV>
<DIV> </DIV>
<DIV>I translate a matlab procedure into C++ with ITK to make things quicker.
Now, comparing both of them, I found that results are the same but my
<STRONG>C++ version with ITK is twice slower than matlab</STRONG>, whereas the
contrary was expected. Could someone tell me what is wrong with my code: is
there things that I can improve and time that I can save?</DIV>
<DIV> </DIV>
<DIV>Here is what I did:</DIV>
<DIV><FONT size=2>
<DIV> </DIV>
<DIV><STRONG><EM>constructeur()</EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->input =
NULL;</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->image1 =
NULL;</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->image2 =
NULL;</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->coeff =
NULL;</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->shiftx =
NULL;</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
this</EM></STRONG></FONT><FONT size=2><STRONG><EM>->shifty =
NULL;</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT color=#008000
size=2></FONT> </DIV>
<DIV><FONT color=#008000 size=2><STRONG><EM>
//filters</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM> extractSlice =
ExtractSliceFilter::New();</EM></STRONG></DIV>
<DIV><STRONG><EM> extractRegion =
ExtractRegionFilter::New();</EM></STRONG></DIV>
<DIV><STRONG><EM> fft1 = FFTFilterType::New();</EM></STRONG></DIV>
<DIV><STRONG><EM> fft2 = FFTFilterType! ::New(); </EM></STRONG></DIV>
<DIV><STRONG><EM> mult = MultiplyFilter::New(); </EM></STRONG></DIV>
<DIV><STRONG><EM> ifft = IFFTFilterType::New();</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT color=#008000
size=2></FONT> </DIV>
<DIV><FONT color=#008000 size=2><STRONG><EM> //release extra
data</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>
extractSlice->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>
extractRegion->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>
fft1->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>
fft2->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>
mult->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>
ifft->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM> </EM></STRONG></DIV>
<DIV><STRONG><EM> mult->SetInput1(fft1->GetOutput());</EM></STRONG></DIV>
<DIV><STRONG><EM>
mult->SetInput2(fft2->GetOutput());</EM></STRONG></DIV>
<DIV><STRONG><EM> ifft->SetInput(mult->GetOutput());
</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV></FONT><FONT color=#0000ff size=2>
<DIV><STRONG><EM>void</EM></STRONG></FONT><FONT size=2><STRONG><EM>
ComputeElastogram::SetInput( ImageType3D::ConstPointer
image)</EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>this</EM></STRONG></FONT><FONT
size=2><STRONG><EM>->input = image;</EM></STRONG></DIV>
<DIV><STRONG><EM>extractSlice->SetInput(</EM></STRONG></FONT><FONT
color=#0000ff size=2><STRONG><EM>this</EM></STRONG></FONT><FONT
size=2><STRONG><EM>->input);</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>this</EM></STRONG></FONT><FONT
size=2><STRONG><EM>->calcul_deplacements();}</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV></FONT><FONT color=#0000ff size=2>
<DIV><STRONG><EM>void</EM></STRONG></FONT><FONT size=2><STRONG><EM>
ComputeElastogram::calcul_deplacements() </EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>unsigned</FONT><FONT
size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>
k1,k2,n;</FONT></EM></STRONG></DIV>
<DIV><FONT size=2><STRONG><EM></EM></STRONG></FONT> </DIV><FONT size=2>
<DIV><FONT color=#008000 size=2><STRONG><EM>//Creation des matrices de
deplacement</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>ImageType::IndexType start;</EM></STRONG></DIV>
<DIV><STRONG><EM>start.Fill(0); </EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType::SizeType sz;</EM></STRONG></DIV>
<DIV><STRONG><EM>sz[0] = dim_s[0]; </EM></STRONG></DIV>
<DIV><STRONG><EM>sz[1] = dim_s[1];</EM></STRONG></DIV!>
<DIV><STRONG><EM>ImageType::RegionType region;</EM></STRONG></DIV>
<DIV><STRONG><EM>region.SetSize( sz );</EM></STRONG></DIV>
<DIV><STRONG><EM>region.SetIndex( start );</EM></STRONG></DIV>
<DIV><STRONG><EM>shifty = ImageType::New();</EM></STRONG></DIV>
<DIV><STRONG><EM>shifty->SetRegions( region );</EM></STRONG></DIV>
<DIV><STRONG><EM>shifty->Allocate();</EM></STRONG></DIV>
<DIV><STRONG><EM>shiftx = ImageType::New();</EM></STRONG></DIV>
<DIV><STRONG><EM>shiftx->SetRegions( region );</EM></STRONG></DIV>
<DIV><STRONG><EM>shiftx->Allocate();</EM></STRONG></DIV></FONT>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT size=2> </DIV>
<DIV><STRONG><EM>rowa = dim_fen[0]; cola = dim_fen[1];</EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000 size=2><STRONG><EM>/*--------Cropped
ROI-------------*/</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>ImageType3D::SizeType croppedSizee;</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedSize[0] = dim_img[0];</EM></STRONG></FONT><FONT
color=#008000 size=2><STRONG><EM>//dim_roi[0];</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV><STRONG><EM>croppedSize[1] = dim_img[1];</EM></STRONG></FONT><FONT
color=#008000 size=2><STRONG><EM>//dim_roi[1];</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV><STRONG><EM>croppedSize[2] = 0;</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType3D::IndexType croppedStart;</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedStart[0] = 0;</EM></STRONG></FONT><FONT color=#008000
size=2><STRONG><EM>//bords_c[0];</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>croppedStart[1] = 0;</EM></STRONG></FONT><FONT color=#008000
size=2><STRONG><EM>//bords_l[0];</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>croppedStart[2] = 0; </EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV>
<DIV><STRONG><EM>ImageType3D::RegionType croppedRegion;</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedRegion.SetSize(croppedSize);</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedRegion.SetIndex(croppedStart);</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV>
<DIV></FONT><FONT color=#008000
size=2><STRONG><EM>/*------------------------------------*/</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV></FONT><FONT color=#008000
size=2><STRONGG><EM>/*--------WINDOWS--------------------*/</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV><STRONG><EM>ImageType::SizeType extractedSize;</EM></STRONG></DIV>
<DIV><STRONG><EM>extractedSize[0] =80;</EM></STRONG></DIV>
<DIV><STRONG><EM>extractedSize[1] = 20;</EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType::IndexType extractedStart;</EM></STRONG></DIV>
<DIV><STRONG><EM>extractedStart.Fill(0); </EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType::RegionType desiredRegion;</EM></STRONG></DIV>
<DIV><STRONG><EM>desiredRegion.SetSize(extractedSize); </EM></STRONG></DIV>
<DIV><STRONG><EM>desiredRegion.SetIndex(extractedStart); </EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000
size=2><STRONG><EM>/*------------------------------------*/</EM></STRONG></FONT></DIV>
<DIV><EM><STRONG><FONT color=#008000
size=2> </DIV></FFONT></STRONG></EM><FONT size=2>
<DIV></FONT><FONT color=#008000 size=2><STRONG><EM>/*--------Hanning
Window--------------*/</EM></STRONG></FONT><FONT size=2><STRONG><EM>
</EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType::Pointer hanning =
ImageType::New();</EM></STRONG></DIV>
<DIV><STRONG><EM>hanning->SetRegions( desiredRegion );</EM></STRONG></DIV>
<DIV><STRONG><EM>hanning->Allocate();</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>float</FONT><FONT size=2>
**w = hanning_2D(dim_fen[1],dim_fen[0]);</FONT><FONT color=#008000
size=2>//taille de la fenetre 20lignes *
80colonnes</DIV></FONT></EM></STRONG><FONT size=2>
<DIV><STRONG><EM>ImageRegionIterator it(hanning, desiredRegion);
</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>for</FONT><FONT
size=2>(</FONT><FONT color=#0000ff size=2>int</FONT></EM></STRONG><FONT
size=2><STRONG><EM> i=0;i<dim_fen[1];i++)</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>for</FONT><FONT
size=2>(</FONT><FONT color=#0000ff size=2>int</FONT></EM></STRONG><FONT
size=2><STRONG><EM> j=0; j<dim_fen[0]; j++)</EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV><STRONG><EM> it.Set(w[i][j]);</EM></STRONG></DIV>
<DIV><STRONG><EM> ++it;</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV>
<DIV><STRONG><EM>free_fmatrix_2d(w);</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM>fhan = WindowFilter::New();</EM></STRONG></DIV>
<DIV><STRONG><EM>fhan->GetOutput()->ReleaseDataFlagOn();</EM></STRONG></DIV>
<DIV><STRONG><EM>fhan->SetInput1(hanning);</EM></STRONG></DIV>
<DIV><STRONG><EM>fhan->SetInput2(extractRegion->GetOutput());</EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000
size=2><STRONG><EM>/*------------------------------------*/</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV></FONT><FONT size=2><
<DIV><STRONG><EM>ImageRegionIterator it1(shifty,
shifty->GetLargestPossibleRegion()); </EM></STRONG></DIV>
<DIV><STRONG><EM>ImageRegionIterator it2(shiftx,
shiftx->GetLargestPossibleRegion());</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT color=#008000
size=2> </DIV></FONT><FONT size=2>
<DIV><STRONG><EM>croppedStart[2] = 0;</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedRegion.SetIndex(croppedStart); </EM></STRONG></DIV>
<DIV><STRONG><EM>extractSlice->SetExtractionRegion(croppedRegion);</EM></STRONG></DIV></FONT><FONT
size=2>
<DIV></FONT><FONT
size=2><STRONG><EM>extractSlice->Update();</EM></STRONG></FONT></DIV><DI!
v><FONT size=2><STRONG><EM>ImageType2D::Pointer im0 =
extractSlice->GetOutput();</EM></STRONG></DIV>
<DIV><STRONG><EM>im0->DisconnectPipeline(); </EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT color=#008000
size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG><EM>croppedStart[2] = 1;</EM></STRONG></DIV>
<DIV><STRONG><EM>croppedRegion.SetIndex(croppedStart); </EM></STRONG></DIV>
<DIV><STRONG><EM>extractSlice->SetExtractionRegion(croppedRegion);</EM></STRONG></DIV>
<DIV><STRONG><EM>extractSlice->Modified();</EM></STRONG></DIV>
<DIV></FONT><FONT
size=2><STRONG><EM>extractSlice->Update();</EM></STRONG></FONT></DIV>
<DIV><FONT size=2><STRONG><EM>ImageType2D::Pointer im1 =
extractSlice->GetOutput();</EM></STRONG></DIV>
<DIV><STRONG><EM>im1->DisconnectPipeline();</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000
size=2><STRONG><EM>//-------------------------------------------------------------------</EM></STRONG></FONT></DIV>
<DIV><EM><STRONG><FONT color=#008000
size=2> </DIV></FONT></STRONG></EM><FONT size=2>
<DIV><STRONG><EM>it1.GoToBegin();</EM></STRONG></DIV>
<DIV><STRONG><EM>it2.GoToBegin(); </EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG> </DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000 size=2><STRONG><EM>// Correlation
</EM></STRONG></FONT></DIV>
<DIV><FONT size=2></FONT><FONT color=#0000ff
size=2><STRONG><EM>for</EM></STRONG></FONT><FONT size=2><STRONG><EM>(k1 = 0;
k1 < dim_s[0]; k1++)</EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>for</EM></STRONG></FONT><FONT size=2><STRONG><EM>(k2 = 0;
k2 < dim_s[1]; k2++)</EM></STRONG></DIV>
<DIV><STRONG><EM>{ </EM></STRONG></DIV>
<DIV><STRONG><EM> extractedStart[0] = k1*pas_fen[0]+
bords_c[0];</EM></STRONG></D! iv>
<DIV><STRONG><EM> extractedStart[1] = k2*pas_fen[1]+
bords_l[0];</EM></STRONG></DIV>
<DIV><STRONG><EM> desiredRegion.SetIndex(extractedStart);
</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM> extractRegion->SetRegionOfInterest(desiredRegion);
</EM></STRONG></DIV>
<DIV><STRONG><EM> extractRegion->SetInput(im0); </EM></STRONG></DIV>
<DIV><STRONG><EM> fhan->Update();</EM></STRONG></DIV>
<DIV><STRONG><EM> image1 = fhan->GetOutput();</EM></STRONG></DIV>
<DIV><STRONG><EM> image1->DisconnectPipeline();</EM></STRONG></DIV>
<DIV><STRONG><EM> extractRegion->SetInput(im1); </EM></STRONG></DIV>
<DIV><STRONG><EM> fhan->Update();</EM></STRONG></DIV>
<DIV><STRONG><EM> image2 = fhan->GetOutput();</EM></STRONG></DIV>
<DIV><STRONG><EM> image2->DisconnectPipeline();</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
int</EM></STRONG></FONT><FONT size=2><STRONG><EM> *shft =
shift(image1,image2);</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM> it1.Set(shft[0]);</EM></STRONG></DIV>
<DIV><STRONG><EM> it2.Set(shft[1]);</EM></STRONG></DIV>
<DIV><STRONG><EM> ++it1;</EM></STRONG></DIV>
<DIV><STRONG><EM> ++it2;</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></FONT><FONT color=#008000
size=2><STRONG><EM>//k1</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>}</EM></STRONG></FONT><FONT color=#008000
size=2><STRONG><EM>//k2 </EM></STRONG></FONT></DIV>
<DIV><EM><STRONG><FONT color=#008000
size=2> </DIV></FONT></STRONG></EM><FONT size=2>
<DIV><STRONG><EM>timer.Stop();</EM></STRONG></DIV>
<DIV><STRONG><EM>fprintf(fp, "\n Elapsed time: %f\n",
timer.GetMeanTime());</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV></FONT><FONT size=2>
<DIV></FONT><FONT size=2><STRONG><EM>}</EM></STRONG></FONT></DIV>
<DIV><EM><STRONG><FONT size=2> </DIV></FONT></STRONG></EM><FONT
color=#0000ff size=2>
<DIV><STRONG><EM>int</EM></STRONG></FONT><FONT size=2><STRONG><EM>*
ComputeElastogram::shift( ImageType::Pointer image1, ImageType::Pointer
image2) </EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>int</FONT><FONT size=2>
*shft = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>int</FONT></EM></STRONG><FONT
size=2><STRONG><EM>[2];</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>this</EM></STRONG></FONT><FONT
size=2><STRONG><EM>->calcul_coef(image2,image1);</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></FONT><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG><EM>ImageType::IndexType index;</EM></STRONG></DIV>
<DIV><STRONG><EM>index[0] = 0; index[1] = 0;</EM></STRONG></DIV>
<DIV></FONT><STRONG><EM><FONT color=#0000ff size=2>unsigned</FONT><FONT
size=2> </FONT><FONT color=#0000ff size=2>int</FONT></EM></STRONG><FONT
size=2><STRONG><EM> row, col; </EM></STRONG></DIV>
<DIV><STRONG><EM>row=col=0;</EM></STRONG></DIV>
<DIV><STRONG><EM>ImageType::PixelType max = coeff->GetPixel(index);
</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM>ImageRegionIterator it(coeff,
coeff->GetLargestPossibleRegion()); </EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>while</EM></STRONG></FONT><FONT size=2><STRONG><EM>(
!it.IsAtEnd() )</EM></STRONG></DIV>
<DIV><STRONG><EM>{</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff size=2><STRONG><EM>
if</EM></STRONG></FONT><FONT
size=2><STRONG><EM>(it.Get()>max)</EM></STRONG></DIV>
<DIV><STRONG><EM> {</EM></STRONG></DIV>
<DIV><STRONG><EM> max = it.Get();</EM></STRONG></DIV>
<DIV><STRONG><EM> index=it.GetIndex();</EM></STRONG></DIV>
<DIV><STRONG><EM> row = index[0];</EM></STRONG></DIV>
<DIV><STRONG><EM> col = index[1];</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV>
<DIV><STRONG><EM>++it;</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV><STRONG><EM>shft[0] = - rowa * (row > (</EM></STRONG></FONT><FONT
color=#0000ff size=2><STRONG><EM>int</EM></STRONG></FONT><FONT
size=2><STRONG><EM>)(rowa/2) ) + row;</EM></STRONG></DIV>
<DIV><STRONG><EM>shft[1] = - cola * (col >
(</EM></STRONG></FONT><STRONG><EM><FONT color=#0000ff size=2>int</FONT><FONT
size=2>)(cola/2)) + col;</FONT></EM></STRONG><FONT
size=2><STRONG><EM>}</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>return</EM></STRONG></FONT><FONT size=2><STRONG><EM>
shft;</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV></FONT><FONT color=#0000ff size=2>
<DIV><STRONG><EM>void</EM></STRONG></FONT><FONT size=2><STRONG><EM>
ComputeElastogram::calcul_coef( ImageType::Pointer image1, ImageType::Pointer
image2) </EM></STRONG></DIV>
<DIV><STRONG><EM>{ </EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000 size=2><STRONG><EM>// Forward FFT
filter</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>fft1->SetInput( image1 );</EM></STRONG></DIV>
<DIV><STRONG><EM>fft2->SetInput( image2 );</EM></STRONG></DIV>
<DIV><STRONG><EM></EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>try</EM></STRONG></FONT><FONT size=2><STRONG><EM>{
ifft->Update(); }</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>catch</EM></STRONG></FONT><FONT
size=2><STRONG><EM>(itk::ExceptionObject &e){</EM></STRONG></DIV>
<DIV><STRONG><EM>CString msg;</EM></STRONG></DIV>
<DIV><STRONG><EM>msg.Format("Erreur %s in %s\n", e.GetDescription(),
e.GetLocation());</EM></STRONG></DIV>
<DIV></FONT><FONT color=#0000ff
size=2><STRONG><EM>return</EM></STRONG></FONT><FONT
size=2><STRONG><EM>;</EM></STRONG></DIV>
<DIV><STRONG><EM>}</EM></STRONG></DIV>
<DIV></FONT><FONT color=#008000 size=2><STRONG><EM>// Iterator which traverse
the image</EM></STRONG></DIV></FONT><FONT size=2>
<DIV><STRONG><EM>coeff = ifft->GetOutput();</EM></STRONG></DIV>
<DIV></FONT><FONT size=2><STRONG><EM>}</EM></STRONG></FONT></DIV>
<DIV><FONT size=2><STRONG><EM></EM></STRONG></FONT> </DIV>
<DIV><FONT size=2>Actually, I don't see what is wrong. I tried to release data
and so on, but it seems to make any difference. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Please help,</DIV>
<DIV> </DIV>
<DIV><FONT size=2>Isabelle</DIV></FONT></DIV>
<P>
<HR SIZE=1>
<B><FONT color=#ff0000>Appel audio GRATUIT</FONT> partout dans le monde</B>
avec le nouveau Yahoo! Messenger<BR><A
href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez
le ici !</A> </FONT></DIV></BLOCKQUOTE></BODY></HTML>