[Insight-users] problem with writing a mini-pipeline
Renaud Isabelle
renauisa at yahoo.fr
Fri Nov 4 11:42:44 EST 2005
hi everyone,
Still trying to write my own filter ... :-)
Here is my main function of my filter CorrelationCoefficientsImageFilter:
template <class TInputImage, class TOutputImage>
void CorrelationCoefficientsImageFilter<TInputImage, TOutputImage>
::GenerateData()
{
this->AllocateOutputs();
//composite filters
typedef VnlFFTRealToComplexConjugateImageFilter<TInputImage::PixelType,InputImageDimension> FFTFilterType;
typedef FFTFilterType::OutputImageType ComplexImageType;
typedef MultiplyComplexImageFilter<FFTFilterType::OutputImageType, FFTFilterType::OutputImageType, FFTFilterType::OutputImageType> MultiplyComplexImageFilter;
typedef VnlFFTComplexConjugateToRealImageFilter< TInputImage::PixelType,InputImageDimension > IFFTFilterType;
typename FFTFilterType::Pointer fftFilter1 = FFTFilterType::New();
typename FFTFilterType::Pointer fftFilter2 = FFTFilterType::New();
typename MultiplyComplexImageFilter::Pointer multiplyFilter = MultiplyComplexImageFilter::New();
typename IFFTFilterType::Pointer ifftFilter = IFFTFilterType::New();
// get pointers to the inputs
Input1ImagePointer inputPtr1
= const_cast< TInputImage*>( this->GetInput(0) );
Input2ImagePointer inputPtr2
= const_cast< TInputImage*>( this->GetInput(1) );
fftFilter1->SetInput( inputPtr1);
fftFilter2->SetInput( inputPtr2);
multiplyFilter->SetInput1( fftFilter1->GetOutput() );
multiplyFilter->SetInput2( fftFilter2->GetOutput() );
ifftFilter->SetInput(multiplyFilter->GetOutput());
ifftFilter->GraftOutput(this->GetOutput());
ifftFilter->Update();
this->GraftOutput(ifftFilter->GetOutput());
// Set up the progress reporter
ProgressReporter progress(this, 0, this->GetOutput()->GetRequestedRegion().GetNumberOfPixels());
// iterator for output image
typedef ImageRegionConstIteratorType< TOutputImage > OutputConstIteratorType;
OutputConstIteratorType outputIt( this->GetOutput(), this->GetOutput()->GetRequestedRegion() );
outputIt.GoToBegin();
while( !outputIt.IsAtEnd() )
{
fprintf(fp, "%f\n", outputIt.Get());
++outputIt;
progress.CompletedPixel(); // potential exception thrown here
}
}
- However. when I build my project, there is a fatal error at calling of this filter. Here is how I call it:
typedef itk::CorrelationCoefficientsImageFilter<ImageType, ImageType>
CorrelationCoefficientsImageFilterType;
CorrelationCoefficientsImageFilterType::Pointer corrFilter = CorrelationCoefficientsImageFilterType::New();
corrFilter->SetInput1(image1);
corrFilter->SetInput2(image2);
corrFilter->Update();
And this is the error I get:
error C2955: 'MultiplyComplexImageFilter' : use of class template requires template argument list
itkMultiplyComplexImageFilter.h(69) : see declaration of 'MultiplyComplexImageFilter'
- that is so strange because, when I execute the same procedure outside a mini-pipeline,I got no error and everything works fine. Maybe, there is something wrong with the declaration of my types in my own filter, don't you think? Any idea to give me?
Isabelle
---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20051104/1d7885a9/attachment.htm
More information about the Insight-users
mailing list