<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Hi everyone,<BR>&nbsp;<BR>&nbsp;&nbsp; someone has to have used FFT in vtk.&nbsp;Why do I have unusual values in the result of my FFT? <BR>
&nbsp;<BR>
The original image's type&nbsp;is unsigned short. I have tried to enlarge the image and pad with 0 but that doesn't help. Should I just replace those unusual values with&nbsp;0?<BR>
&nbsp;<BR>
I would really appreciate any help or hints! This keeps me from applying a high pass filter to MR images for preprocessing to test another algorithm.<BR>
&nbsp;<BR>
Thanks!<BR>
Pascale<BR>&nbsp;&nbsp;<BR><BR>
<DIV>
<BLOCKQUOTE class=EC_EC_gmail_quote style="PADDING-LEFT: 1ex; 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've been having this problem for while now and can'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><BR>
<HR>
<A href="http:///" target=_blank></A><br /><hr /> <a href='' target='_new'></a></body>
</html>