[vtkusers] Please I need help on vtkImageFFT and vtkImageRFFT

Stefan Huber Huber.Ste at gmx.at
Mon Jun 16 02:51:06 EDT 2008


Hi at all

I have one major problem with the vtkImageFFT and vtkImageRFFT.
I should make a mehode which uses vtkImageFFT to shift the image to the frequency space. After thr transformation, i should display the transformed image in an special software (nothing with vtk). Another mehtode should be generated, which takes the transformed picture and uses the vtkImageRFFT. This picture should also be displayed in the software.

When i o the FFT and display the image, i dont get a correct pictrue in the freuquency space. But when i do the RFFT on this picture i get the original image back. 
So I tried to generate the correct image after the FFT, but now nothing is correct. (FFT and RFFT)

Do you have an idea how i can do it right? This is my code of the FFT:

vtkImageFFT *ffft = vtkImageFFT::New();
ffft->SetDimensionality(2);
ffft->SetInput(img);
ffft->Update();

vtkImageFourierCenter *center = vtkImageFourierCenter::New();
vtkImageMagnitude *mag= vtkImageMagnitude::New();
vtkImageLogarithmicScale *log= vtkImageLogarithmicScale ::New();

mag->SetInputConnection(ffft->GetOutputPort());
mag->ReleaseDataFlagOff();

center->SetInputConnection(mag->GetOutputPort());
center->Update();

log->SetInputConnection(center->GetOutputPort());
log->SetConstant(5);
log->Update();

//now fill outputarray
for (i = 0; i< lenImg; i++){
  out[i] = log->GetOutput()->GetPointData()->GetComponent(id,0);
  id ++;
}


And thats my source for the RFFT:

vtkImageRFFT * rfft ) vtkImageRFFT::New();
rfft->SetDimensionality(2);
rfft->SetInput(img);
rfft->Update();
//prepare output
for (i = 0; i< sizeImg; i++){
  im = rfft->GetOutput()->GetPointData()->GetScalars()->getComponent(id,1);
  re = rfft->GetOutput()->GetPointData()->GetScalars()->getComponent(id,0);
  out[idx] = re;
  idx++; 
  out[idx] = im;
  id++;
  idx++;
}

please help me thanks
Stefan
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx



More information about the vtkusers mailing list