<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 "Access Violation" that I'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'm unable to debug now. </p>
<p class="MsoNormal">It would be great if someone could help -><br></p><p class="MsoNormal"></p>
<p class="MsoNormal"> </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"> </p>
<p class="MsoNormal">Here is my pseudo code: </p>
<p class="MsoNormal"> </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'm using <span style="font-size:10.0pt;
font-family:"Courier New";mso-no-proof:yes">FFTRealToComplexConjugateImageFilter)</span></p>
<p class="MsoNormal"> </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"> </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:"Courier New";mso-no-proof:yes">MultiplyImageFilter->SetInput1(<span style="color:green">fft_input);</span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">MultiplyImageFilter->SetInput2(<span style="color:green">fft_weight);</span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">MultiplyImageFilter->Update();</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes"> </span></p>
<p class="MsoNormal">IT is here that this strange error occurs:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Unhandled exception at 0x0046193a in ItkScatter.exe:
0xC0000005: Access violation reading location 0x61371000.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">And the code breaks in at this place<span style="mso-spacerun:yes"> </span>in file <span style="font-size:10.0pt;
font-family:"Courier New";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:"Courier New";color:blue;mso-no-proof:yes">inline</span><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes"> <span style="color:blue">const</span> ExternalPixelType Get( <span style="color:blue">const</span>
InternalPixelType & 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:"Courier New";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:"Courier New";mso-no-proof:yes"><span style="mso-spacerun:yes"> </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:"Courier New";mso-no-proof:yes">}</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Below is the relevant part of the code: </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes">
itk::FFTRealToComplexConjugateImageFilter<pixelTypeC, dim2D>
FFTFilterType;<span style="mso-tab-count:1"> </span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;
font-family:"Courier New";mso-no-proof:yes">
itk::FFTComplexConjugateToRealImageFilter<pixelTypeC, dim2D>
IFFTFilterType;</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;
font-family:"Courier New";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:"Courier New";color:blue;mso-no-proof:yes">typedef</span><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes">
itk::MultiplyImageFilter<ComplexImageType, ComplexImageType,
ComplexImageType>MultiplyImageFilterType;<span style="color:green">//><span style="mso-spacerun:yes"> </span></span></span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes">constPadImage->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:"Courier New";mso-no-proof:yes">constPadImage->SetPadUpperBound(paddin);<span style="mso-tab-count:1"> </span></span></p>
<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes">constPadImage->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:"Courier New";mso-no-proof:yes">fftFilter->SetInput(constPadImage->GetOutput());
<span style="color:green">//set the fft. </span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">ComplexImageType::Pointer fft_input =
fftFilter->GetOutput(); <span style="color:green">// fft filter done on
image.</span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">fftFilter->Update();</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
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:"Courier New";mso-no-proof:yes">constPadImage2->SetPadUpperBound(paddin_wt_upper);<span style="mso-tab-count:1"> </span></span></p>
<p class="MsoNormal" style="mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";mso-no-proof:yes">constPadImage2->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:"Courier New";mso-no-proof:yes">fft_wtFilter->SetInput(constPadImage2->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:"Courier New";mso-no-proof:yes">ComplexImageType::Pointer
fft_weight= fft_wtFilter->GetOutput();<span style="color:green">// fft
filter done on image. </span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">fft_wtFilter->Update();</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
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:"Courier New";mso-no-proof:yes">MultiplyImageFilter->SetInput1(fft_input);</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">MultiplyImageFilter->SetInput2(fft_weight);<span style="color:green"></span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">MultiplyImageFilter->Update() // Error occurs here.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">ifftFilter->SetInput(MultiplyImageFilter->GetOutput());</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
mso-no-proof:yes">ifftFilter->Update();</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
color:green;mso-no-proof:yes"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";
color:green;mso-no-proof:yes"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial; ">Hi,Many thanks </span></span></p><p class="MsoNormal">Saurabh<br></p><p class="MsoNormal">New ITKer..</p><p class="MsoNormal">
</p>
<p class="MsoNormal"> </p>
<br><br><div class="gmail_quote">2008/11/21 chensiqi <span dir="ltr"><<a href="mailto:pidanchen@hotmail.com">pidanchen@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<br>
Hi, ITKers,<br>
<br>
Does anybody know how to load sequence items using ITK? Such as "ROI Contour Sequence".<br>
Or if you know how to do it in GDCM, and integrate into ITK, that will also be very helpful.<br>
<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>