[Insight-users] Allocation memory error with dft_c2r_2d & FFTW_PRESERVE_INPUT

Antonio Gómez Barquero agb1 at alu.upct.es
Wed Oct 19 05:51:07 EDT 2011


 

 

Hello all,

 

This is not exactly ITK problem, but I suppose that the use of the fftw
library can be used for normal medical image processing, if this question
does not fit here, I apologize in advanced.

 

I want to do a ‘complex_to_real’ transformation, it means, the IFFT. I
realised that I need to preserve the inputs of the transformation for a
later use, so I add to the plan of the ‘dft’ the flag : “PRESERVE_INPUT”. 

 

After adding this flag I become with a problem in compilation time , it goes
to ‘dbgmalloc.c’, that means that it should be a allocation memory problem,
but I didn’t change anything, and without the new flag it worked properly.

 

Can you give me some hints?

 

 

            // IFFT ( U1,U2 --> u1,u2)

            //----IFFT-----

            double *u1 = (double*) malloc(sizeof(double)*N_fft); 

            double *u2 = (double*) malloc(sizeof(double)*N_fft);

            fftw_plan p3;

            fftw_plan p4;

            

            p3 = fftw_plan_dft_c2r_2d(alto, ancho, U1, u1,
FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);

            p4 = fftw_plan_dft_c2r_2d(alto, ancho, U2, u2,
FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);

            fftw_execute(p3);

            fftw_execute(p4); 

            fftw_destroy_plan(p3); 

            fftw_destroy_plan(p4); 

 

 

Regards

 

Antonio Gómez Barquero

 

Ingeniero de Telecomunicaciones -Becario Investigador asociado a Actividades
de I+D+I 

GTTS ( Grupo de Tratamiento y Teoría de la Señal)[  <http://gtts.upct.es/>
http://gtts.upct.es/]

UPCT (Universidad Politécnica de Cartagena)[  <http://www.upct.es/>
http://www.upct.es/]

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111019/1462b66b/attachment.htm>


More information about the Insight-users mailing list