0

我遇到的问题是我使用Qt从GUI打开一个图像(通过我创建的ImageFrame类,这个类定义了PixelType如下:

typedef double PixelType;
typedef itk::Image<PixelType,2> ImageType;

在提取图像后,我会撒谎做一个 FFT,输入是真实数据。错误说:不能将'itk::SmartPointer'的第三个参数转换为'double *'和ImageFrame类的对象(它已将像素类型定义为double)。

1>.\prueba_r01.cpp(126) : error C2664: 'fftw_plan_dft_r2c_2d' : no se puede convertir el parametro 3 de 'itk::SmartPointer' a 'double *'
1> with
1> [
1> TObjectType=itk:: Image
1> ]
1> No hay disponible ningún operador de conversión definido por el usuario que pueda realizar esta conversión, o bien no se puede llamar al operador

现在我不明白为什么如果像素是双格式,它就不能计算 fft。有谁可以告诉我如何解决这个问题?非常感谢大家!

4

2 回答 2

1

To get the pixel data (a double*), you need to use

image->GetBufferPointer();

This will return a double*, that can be passed into FFTW.

于 2011-09-22T21:03:56.933 回答
0

这是因为image.Pointer()它是一个智能指针对象,是指向数据的读取指针的包装器。你必须传递image.Pointer().GetPointer()给fftw。

于 2011-07-06T13:12:10.473 回答