Hi Dan, <div><br></div><div>Many thanks for this info. </div><div>I had a brief look at this already. </div><div>Just that I have 3D images of average size 3000 * 1800 * 15, that convolution becomes almost a no show.</div>
<div><br></div><div>Regards</div><div><br></div><div>Saurabh</div><div><br></div><div><br><br><div class="gmail_quote">On Mon, Nov 24, 2008 at 12:54 PM, Dan Mueller <span dir="ltr"><<a href="mailto:dan.muel@gmail.com">dan.muel@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Saurabh,<br>
<br>
Welcome to ITK!<br>
<br>
I can't respond regarding your FFT issues/questions, however if your<br>
convolution kernels are small (or computation time is not an issue)<br>
then you may consider computing the convolution directly.<br>
<br>
Section 11.4 of the ITK Software Guide describes how to do this using<br>
neighborhood iterators. This part of the software guide is generated<br>
from:<br>
Examples\Iterators\NeighborhoodIterators4.cxx<br>
<br>
HTH<br>
<br>
Regards, Dan<br>
<br>
2008/11/24 Saurabh Sethi <<a href="mailto:sethi.saurabh@gmail.com">sethi.saurabh@gmail.com</a>>:<br>
<div><div></div><div class="Wj3C7c">> Hi All,<br>
><br>
> I recently started using the ITK after a lot of word of mouth publicity from<br>
> peer groups :)<br>
><br>
> And I must say that im very impressed by it.<br>
><br>
> Have been going through all of the Software guide and Message Archives since<br>
> some time now.<br>
><br>
> I have a bit of problem with the FFT / IFFT implementation. There is some<br>
> "Access Violation" that I'm unable to fix since some time.<br>
><br>
> Maybe I have used the Complex Image in a wrong ( read Silly) way which I'm<br>
> unable to debug now.<br>
><br>
> It would be great if someone could help -><br>
><br>
><br>
><br>
> I need to convolve two images (one is the test image, and other is my data<br>
> image)<br>
><br>
> For this, I had thought of first doing the FFT, then Multiplying both the<br>
> images and taking the IFFT in the end.<br>
><br>
><br>
><br>
> Here is my pseudo code:<br>
><br>
><br>
><br>
> read image 1 (im1)<br>
><br>
> Padd the image to nearest power of 2.<br>
><br>
> compute its FFT. (I'm using FFTRealToComplexConjugateImageFilter)<br>
><br>
><br>
><br>
> read image 2. (im2)<br>
><br>
> Padd the image to the same power of 2.<br>
><br>
> compute its FFT.<br>
><br>
><br>
><br>
> Multiply both the images<br>
><br>
> MultiplyImageFilter->SetInput1(fft_input);<br>
><br>
> MultiplyImageFilter->SetInput2(fft_weight);<br>
><br>
> MultiplyImageFilter->Update();<br>
><br>
><br>
><br>
> IT is here that this strange error occurs:<br>
><br>
><br>
><br>
> Unhandled exception at 0x0046193a in ItkScatter.exe: 0xC0000005: Access<br>
> violation reading location 0x61371000.<br>
><br>
><br>
><br>
> And the code breaks in at this place in file<br>
> itkDefaultPixelAccessorFunctor.h:<br>
><br>
> inline const ExternalPixelType Get( const InternalPixelType & input ) const<br>
><br>
> {<br>
><br>
> return m_PixelAccessor.Get( input );<br>
><br>
> }<br>
><br>
><br>
><br>
><br>
><br>
> Below is the relevant part of the code:<br>
><br>
><br>
><br>
> typedef itk::FFTRealToComplexConjugateImageFilter<pixelTypeC, dim2D><br>
> FFTFilterType;<br>
><br>
> typedef itk::FFTComplexConjugateToRealImageFilter<pixelTypeC, dim2D><br>
> IFFTFilterType;<br>
><br>
> typedef FFTFilterType::OutputImageType ComplexImageType;<br>
><br>
> typedef itk::MultiplyImageFilter<ComplexImageType, ComplexImageType,<br>
> ComplexImageType>MultiplyImageFilterType;//><br>
><br>
><br>
><br>
> constPadImage->SetPadLowerBound(paddin);// specifying padding options<br>
><br>
> constPadImage->SetPadUpperBound(paddin);<br>
><br>
> constPadImage->SetInput(inputImage_C); // set padding filter input.<br>
><br>
> fftFilter->SetInput(constPadImage->GetOutput()); //set the fft.<br>
><br>
> ComplexImageType::Pointer fft_input = fftFilter->GetOutput(); // fft filter<br>
> done on image.<br>
><br>
> fftFilter->Update();<br>
><br>
><br>
><br>
> constPadImage2->SetPadUpperBound(paddin_wt_upper);<br>
><br>
> constPadImage2->SetInput(inputImage2); // set padding filter input.<br>
><br>
> fft_wtFilter->SetInput(constPadImage2->GetOutput()); //set the fft.<br>
><br>
> ComplexImageType::Pointer fft_weight= fft_wtFilter->GetOutput();// fft<br>
> filter done on image.<br>
><br>
> fft_wtFilter->Update();<br>
><br>
><br>
><br>
> MultiplyImageFilter->SetInput1(fft_input);<br>
><br>
> MultiplyImageFilter->SetInput2(fft_weight);<br>
><br>
> MultiplyImageFilter->Update() // Error occurs here.<br>
><br>
> ifftFilter->SetInput(MultiplyImageFilter->GetOutput());<br>
><br>
> ifftFilter->Update();<br>
><br>
><br>
><br>
> Hi,Many thanks<br>
><br>
> Saurabh<br>
><br>
> New ITKer..<br>
><br>
><br>
><br>
><br>
><br>
> 2008/11/21 chensiqi <<a href="mailto:pidanchen@hotmail.com">pidanchen@hotmail.com</a>><br>
>><br>
>><br>
>> Hi, ITKers,<br>
>><br>
>> Does anybody know how to load sequence items using ITK? Such as "ROI<br>
>> Contour Sequence".<br>
>> Or if you know how to do it in GDCM, and integrate into ITK, that will<br>
>> also be very helpful.<br>
>><br>
>> Thanks<br>
>> Siqi<br>
>><br>
>><br>
>> ________________________________<br>
>> 更多热辣资讯尽在新版MSN首页! 立刻访问!<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>
><br>
><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>
><br>
</div></div></blockquote></div><br></div>