As requested, here's the code i'm using:<br>
<br>
vtkDataSetReader *reader = vtkDataSetReader::New();<br>
reader->SetFileName(argv[1]);<br>
reader->Update();<br>
reader->GetOutput()->GetPointData()->CopyAllOff();<br>
reader->GetOutput()->GetPointData()->SetActiveScalars("Velocity");<br>
reader->GetOutput()->GetPointData()->CopyScalarsOn();<br>
printf("Done!\n");<br>
// PrintStatistics(reader->GetOutput());<br>
<br>
<br>
printf("Extracting Velocity X-Component...\n");<br>
vtkArrayCalculator *extract = vtkArrayCalculator::New();<br>
extract->SetInput(reader->GetOutput());<br>
extract->SetResultArrayName("result");<br>
extract->AddScalarVariable("x", "Velocity", 0);<br>
extract->SetFunction("x");<br>
extract->Update();<br>
PrintStatistics(extract->GetOutput());<br>
<br>
printf("Computing FFT...\n");<br>
vtkImageFFT *fft = vtkImageFFT::New();<br>
fft->SetInput(extract->GetOutput());<br>
fft->SetDimensionality(3);<br>
fft->Update();<br>
PrintStatistics(fft->GetOutput());<br>
<br>
<br>
printf("Computing Magnitude...\n");<br>
vtkArrayCalculator *mag = vtkArrayCalculator::New();<br>
mag->SetInput(fft->GetOutput());<br>
mag->SetResultArrayName("FFTMag");<br>
mag->AddScalarVariable("x", "result", 0);<br>
mag->AddScalarVariable("y", "result", 1);<br>
mag->SetFunction("(x*x) + (y*y)");<br>
mag->Update();<br>
PrintStatistics(mag->GetOutput());<br>
<br>
<br>
>From the "PrintStatistics" function, the "result" array before the FFT looks like this:<br>
<div style="margin-left: 40px;">p Array [4]: vtkDoubleArray "result", 2,097,152 points, 8 bytes per point<br>
p
Magnitude Range:
-0.07686 0.07686<br>
p
Component 0 Range:
-0.07686 0.07686<br>
</div>
And after the FFT:<br>
<div style="margin-left: 40px;">p Array [0]: vtkDoubleArray "result", 2,097,152 points, 8 bytes per point<br>
p
Magnitude Range:
3.485e+19 7.803e+22<br>
p
Component 0 Range:
-7.688e+22 7.688e+22<br>
p
Component 1 Range:
-6.814e+22 6.814e+22<br>
</div>
<br>
<br><br><div><span class="gmail_quote">On 9/7/05, <b class="gmail_sendername">Randall Hand</b> <<a href="mailto:randall.hand@gmail.com">randall.hand@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a 3D 128^3 volume of data, containing a velocity vector. I
use a vtkArrayCalculator to extract a single component of the velocity
(X in this case), and use the vtkImageFFT to compute a Fourier
Transform of the data.<br>
<br>
The original data is of the range -0.02 to 0.02, but computing the magnitude of the resulting FFT dataset yields a <span style="font-weight: bold;">minimum value</span>
of 6*10^20, and a Maximum of over *10^24. Can anyone explain what
might be happening here? Parseval's theorem states that the
resulting FFT should be of similar magnitude to the input data.<br style="font-weight: bold;" clear="all"><span class="sg"><br>-- <br>Randall Hand<br>Visualization Scientist<br>
ERDC-MSRC Vicksburg, MS<br>
</span></blockquote></div><br><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>