[vtkusers] vtkImageRFFT...... help!!!
Sentil Balaji
profbalse at yahoo.co.in
Tue Jun 1 01:04:36 EDT 2004
Hey,
I am trying to compute the RFFT from its FFT.The
FFT part worked out well...I saved the real and
imaginary parts as two files....I have no idea on how
to combine the two inputs as an input for vtkImageRFFT
.I tried using vtkImageAppendComponents but things
dint work ....Here is the code[below]...Awaiting an
adept's solution...
-------------CODE----------------
#include<iostream.h>
#include<stdio.h>
#include<VTK4.4/vtkBMPReader.h>
#include<VTK4.4/vtkImageRFFT.h>
#include<VTK4.4/vtkImageExtractComponents.h>
#include<VTK4.4/vtkBMPWriter.h>
#include<VTK4.4/vtkImageCast.h>
#include<VTK4.4/vtkImageAppendComponents.h>
void main()
{
char A[30];
vtkBMPReader *pr=vtkBMPReader::New();
vtkImageRFFT *t=vtkImageRFFT::New();
vtkImageExtractComponents
*ex=vtkImageExtractComponents::New();
vtkBMPWriter *pw=vtkBMPWriter::New();
vtkImageCast *ic=vtkImageCast::New();
vtkImageAppendComponents
*app=vtkImageAppendComponents::New();
printf("\n\n\t\tENTER THE INPUT REAL IMAGE
FILENAME:");
gets(A);
pr->SetFileName(A);
pr->SetDataExtent(1,512,1,512,1,1);
app->SetInput(1,pr->GetOutput());
printf("\n\n\t\tENTER THE INPUT IMAGINARY IMAGE
FILENAME:");
gets(A);
pr->SetFileName(A);
pr->SetDataExtent(1,512,1,512,1,1);
app->SetInput(2,pr->GetOutput());
t->SetInput(app->GetOutput());
printf("\n\n\t\tENTER THE OUTPUT IMAGE
FILENAME:");
gets(A);
ex->SetInput(t->GetOutput());
ex->SetComponents(0);
pw->SetFileName(A);
ic->SetInput(ex->GetOutput());
ic->SetOutputScalarTypeToUnsignedChar();
pw->SetInput(ic->GetOutput());
pr->Delete();
pw->Delete();
ex->Delete();
t->Delete();
ic->Delete();
app->Delete();
}
________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/
More information about the vtkusers
mailing list