<p class="MsoNormal">Hi All, </p>

<p class="MsoNormal">I recently started using the ITK after a lot of word of
mouth publicity from peer groups :)<br></p><p class="MsoNormal"></p>

<p class="MsoNormal">And I must say that im very impressed by it. </p>

<p class="MsoNormal">Have been going through all of the Software guide and
Message Archives since some time now.<br></p><p class="MsoNormal"></p>

<p class="MsoNormal">I have a bit of problem with the FFT / IFFT implementation. There
is some &quot;Access Violation&quot; that I&#39;m unable to fix since some time.<br></p><p class="MsoNormal"></p>

<p class="MsoNormal">Maybe I have used the Complex Image in a wrong ( read Silly)
way which I&#39;m unable to debug now. </p>

<p class="MsoNormal">It would be great if someone could help -&gt;<br></p><p class="MsoNormal"></p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">I need to convolve two images (one is the test image, and
other is my data image) </p>

<p class="MsoNormal">For this, I had thought of first doing the FFT, then
Multiplying both the images and taking the IFFT in the end. </p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Here is my pseudo code: </p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">read image 1 (im1) </p>

<p class="MsoNormal">Padd the image to nearest power of 2. </p>

<p class="MsoNormal">compute its FFT. (I&#39;m using <span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;mso-no-proof:yes">FFTRealToComplexConjugateImageFilter)</span></p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">read image 2. (im2) </p>

<p class="MsoNormal">Padd the image to the same power of 2. </p>

<p class="MsoNormal">compute its FFT. </p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Multiply both the images </p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">MultiplyImageFilter-&gt;SetInput1(<span style="color:green">fft_input);</span></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">MultiplyImageFilter-&gt;SetInput2(<span style="color:green">fft_weight);</span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">MultiplyImageFilter-&gt;Update();</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">&nbsp;</span></p>

<p class="MsoNormal">IT is here that this strange error occurs:</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Unhandled exception at 0x0046193a in ItkScatter.exe:
0xC0000005: Access violation reading location 0x61371000.</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">And the code breaks in at this place<span style="mso-spacerun:yes">&nbsp; </span>in file <span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:green;mso-no-proof:yes">itkDefaultPixelAccessorFunctor.h</span>:</p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">inline</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes"> <span style="color:blue">const</span> ExternalPixelType Get( <span style="color:blue">const</span>
InternalPixelType &amp; input ) <span style="color:blue">const</span></span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">{</span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes"><span style="mso-spacerun:yes">&nbsp;&nbsp; </span><span style="color:blue">return</span>
m_PixelAccessor.Get( input );</span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">}</span></p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal">Below is the relevant part of the code: </p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
itk::FFTRealToComplexConjugateImageFilter&lt;pixelTypeC, dim2D&gt;
FFTFilterType;<span style="mso-tab-count:1"> </span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;mso-no-proof:yes">
itk::FFTComplexConjugateToRealImageFilter&lt;pixelTypeC, dim2D&gt;
IFFTFilterType;</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;mso-no-proof:yes"> FFTFilterType::OutputImageType
ComplexImageType;</span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">
itk::MultiplyImageFilter&lt;ComplexImageType, ComplexImageType,
ComplexImageType&gt;MultiplyImageFilterType;<span style="color:green">//&gt;<span style="mso-spacerun:yes">&nbsp; </span></span></span></p>

<p class="MsoNormal">&nbsp;</p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">constPadImage-&gt;SetPadLowerBound(paddin);<span style="color:green">// specifying padding options</span></span></p>


<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">constPadImage-&gt;SetPadUpperBound(paddin);<span style="mso-tab-count:1">&nbsp; </span></span></p>


<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">constPadImage-&gt;SetInput(inputImage_C);
<span style="color:green">// set padding filter input. </span></span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">fftFilter-&gt;SetInput(constPadImage-&gt;GetOutput());
<span style="color:green">//set the fft. </span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">ComplexImageType::Pointer fft_input =
fftFilter-&gt;GetOutput(); <span style="color:green">// fft filter done on
image.</span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">fftFilter-&gt;Update();</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">&nbsp;</span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">constPadImage2-&gt;SetPadUpperBound(paddin_wt_upper);<span style="mso-tab-count:1">&nbsp;&nbsp;&nbsp; </span></span></p>


<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">constPadImage2-&gt;SetInput(inputImage2);
<span style="color:green">// set padding filter input. </span></span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">fft_wtFilter-&gt;SetInput(constPadImage2-&gt;GetOutput());
<span style="color:green">//set the fft. </span></span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">ComplexImageType::Pointer
fft_weight= fft_wtFilter-&gt;GetOutput();<span style="color:green">// fft
filter done on image. </span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">fft_wtFilter-&gt;Update();</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">&nbsp;</span></p>

<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;mso-no-proof:yes">MultiplyImageFilter-&gt;SetInput1(fft_input);</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">MultiplyImageFilter-&gt;SetInput2(fft_weight);<span style="color:green"></span></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">MultiplyImageFilter-&gt;Update() // Error occurs here.</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">ifftFilter-&gt;SetInput(MultiplyImageFilter-&gt;GetOutput());</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
mso-no-proof:yes">ifftFilter-&gt;Update();</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:green;mso-no-proof:yes">&nbsp;</span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:green;mso-no-proof:yes"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial; ">Hi,Many thanks&nbsp;</span></span></p><p class="MsoNormal">Saurabh<br></p><p class="MsoNormal">New ITKer..</p><p class="MsoNormal">
&nbsp;</p>

<p class="MsoNormal">&nbsp;</p>
<br><br><div class="gmail_quote">2008/11/21 chensiqi <span dir="ltr">&lt;<a href="mailto:pidanchen@hotmail.com">pidanchen@hotmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
&nbsp;<br>
Hi, ITKers,<br>
&nbsp;<br>
Does anybody know how to load sequence items&nbsp;using ITK? Such as &quot;ROI Contour Sequence&quot;.<br>
Or if you know how to do it in GDCM, and integrate into ITK, that will also be very helpful.<br>
&nbsp;<br>
Thanks<br>
Siqi<br>
<br><br><hr>更多热辣资讯尽在新版MSN首页! <a href="http://cn.msn.com/" target="_blank">立刻访问!</a></div>
<br>_______________________________________________<br>
Insight-users mailing list<br>
<a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>