<div>Sorry to ask again, I&nbsp;did not get any answers,&nbsp;did anyone have a solution for this problem? </div>
<div>&nbsp;</div>
<div>Thanks</div>
<div>Pascale<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/2/08, <b class="gmail_sendername">Pascale Beliveau</b> &lt;<a href="mailto:beliveaup@gmail.com">beliveaup@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi,</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp; I am having problems, applying FFT then RFFT to image. The image is created using dicom reader and there are no problems with the original data. But in the result of RFFT I get some intensities as -1.#QNAN00 over the image. I am trying to find out why that is&nbsp;but cannot find what could be wrong. Anyone had issues with this already?</div>

<div>&nbsp;</div>
<div>Thanks for helping, I&#39;ve been having this problem for while now and can&#39;t find the problem,</div>
<div>Pascale</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><br>Here is the code:</div>
<div><br>// cast to floating type, vtk fft only works with floats - was unsigned short before<br>vtkImageCast * ImCast1 = vtkImageCast::New();<br>ImCast1-&gt;SetInput(VtkImage);<br>ImCast1-&gt;SetOutputScalarTypeToFloat();<br>
ImCast1-&gt;Modified();<br>ImCast1-&gt;Update();<br>&nbsp;</div>
<div>// convert using FFT<br>vtkImageFFT * FFT = vtkImageFFT::New();<br>FFT-&gt;SetDimensionality(3);<br>FFT-&gt;SetInput(ImCast1-&gt;GetOutput());<br>FFT-&gt;Modified();<br>FFT-&gt;Update();<br><br>// come back to spatial domain<br>
vtkImageRFFT * RFFT = vtkImageRFFT::New();<br>RFFT-&gt;SetDimensionality(3);<br>RFFT-&gt;SetInputConnection(FFT-&gt;GetOutputPort());<br>RFFT-&gt;Modified();<br>RFFT-&gt;Update(); <br><br>vtkImageExtractComponents * RealComponents = vtkImageExtractComponents::New();<br>
RealComponents-&gt;SetInputConnection(RFFT-&gt;GetOutputPort());<br>RealComponents-&gt;SetComponents(0); // to fetch the real part of the image, the imaginary is in component 1<br>RealComponents-&gt;Update(); </div>
<div>&nbsp;</div>
<div>// Here: RealComponents contain -1.#QNAN00 </div>
<div><br>vtkImageCast * ImCast = vtkImageCast::New();<br>ImCast-&gt;SetInput(RealComponents-&gt;GetOutput());<br>ImCast-&gt;SetOutputScalarTypeToUnsignedShort();<br>ImCast-&gt;Modified();<br>ImCast-&gt;Update();<br><br>// vtk viewer<br>
vtkImageViewer * viewer = vtkImageViewer::New();<br>viewer-&gt;SetInput(ImCast-&gt;GetOutput());<br>viewer-&gt;SetColorWindow(256);<br>viewer-&gt;SetColorLevel(50);<br>vtkRenderWindowInteractor * viewInt = vtkRenderWindowInteractor::New();<br>
viewer-&gt;SetupInteractor(viewInt);<br>viewer-&gt;Render();</div>
<div>&nbsp;</div>
<div>&nbsp;</div></blockquote></div><br>