<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> <BR> someone has to have used FFT in vtk. Why do I have unusual values in the result of my FFT? <BR>
<BR>
The original image's type 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 0?<BR>
<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>
<BR>
Thanks!<BR>
Pascale<BR> <BR><BR>
<DIV>
<BLOCKQUOTE class=EC_EC_gmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid">
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV> 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 but cannot find what could be wrong. Anyone had issues with this already?</DIV>
<DIV> </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> </DIV>
<DIV> </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->SetInput(VtkImage);<BR>ImCast1->SetOutputScalarTypeToFloat();<BR>ImCast1->Modified();<BR>ImCast1->Update();<BR> </DIV>
<DIV>// convert using FFT<BR>vtkImageFFT * FFT = vtkImageFFT::New();<BR>FFT->SetDimensionality(3);<BR>FFT->SetInput(ImCast1->GetOutput());<BR>FFT->Modified();<BR>FFT->Update();<BR><BR>// come back to spatial domain<BR>vtkImageRFFT * RFFT = vtkImageRFFT::New();<BR>RFFT->SetDimensionality(3);<BR>RFFT->SetInputConnection(FFT->GetOutputPort());<BR>RFFT->Modified();<BR>RFFT->Update(); <BR><BR>vtkImageExtractComponents * RealComponents = vtkImageExtractComponents::New();<BR>RealComponents->SetInputConnection(RFFT->GetOutputPort());<BR>RealComponents->SetComponents(0); // to fetch the real part of the image, the imaginary is in component 1<BR>RealComponents->Update(); </DIV>
<DIV> </DIV>
<DIV>// Here: RealComponents contain -1.#QNAN00 </DIV>
<DIV><BR>vtkImageCast * ImCast = vtkImageCast::New();<BR>ImCast->SetInput(RealComponents->GetOutput());<BR>ImCast->SetOutputScalarTypeToUnsignedShort();<BR>ImCast->Modified();<BR>ImCast->Update();<BR><BR>// vtk viewer<BR>vtkImageViewer * viewer = vtkImageViewer::New();<BR>viewer->SetInput(ImCast->GetOutput());<BR>viewer->SetColorWindow(256);<BR>viewer->SetColorLevel(50);<BR>vtkRenderWindowInteractor * viewInt = vtkRenderWindowInteractor::New();<BR>viewer->SetupInteractor(viewInt);<BR>viewer->Render();</DIV>
<DIV> </DIV>
<DIV> </DIV></BLOCKQUOTE></DIV><BR><BR>
<HR>
<A href="http:///" target=_blank></A><br /><hr /> <a href='' target='_new'></a></body>
</html>