[vtkusers] need help on vtkImageFFT please

Stefan Huber Huber.Ste at gmx.at
Tue Apr 15 04:39:11 EDT 2008


Hi at all,

Can somebaody help me with vtkImageFFT?
I have an ImageDataObject like this:
   vtkImageData * img = vtkImageData::New()
   img->SetDimension(3,3,1);
   img->SetScalarTypeToFloat();
   img->AllocateScalar();

   float * ptr = (float *) img->GetScalarPointer();
   for  (int i = 0; i < 3; i++){
      for (int j = 0; j < 3; j++){
         *ptr++ = 1;
      }
   }

when i make some Queries on this Dataobject i get the information about the size and extent. 
   Extent is 0 2 0 2 0 0
   NumberofComponent = 1
   Size of Scalar = 9

Now i want to make a FFT of this image. But the result of the FFT is very strange and isn't correct. I don't know whats wrong. Please help me.
The code for my FFT is this.
   vtkImageFFT *fft = vtkImageFFT::New();
   fft->SetDimensionality(1);
   fft->SetInput(img);
   fft->Update();

   to print result of FFT:
   for (i = 0; i < fft->getOutput()->GetNumberofPoints(); i++)
     im->fft->GetOutput()->GetPointData->GetScalars()->GetComponent(id,1);
     re->fft->GetOutput()->GetPointData->GetScalars()->GetComponent(id,0);
     cout << .....
     id ++;
  }

Do you know whats wrong?
Thanks Stefan


-- 
 

Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser



More information about the vtkusers mailing list