32 #define MAX(a,b) (((a)>(b))?(a):(b)) 49 double time,min_time,max_time,min_inh,max_inh;
51 FILE *fp,*fout,*fi,*finh,*ftime;
53 int flags = PRE_PHI_HUT| PRE_PSI |MALLOC_X| MALLOC_F_HAT|
54 MALLOC_F| FFTW_INIT| FFT_OUT_OF_PLACE|
55 FFTW_MEASURE| FFTW_DESTROY_INPUT;
63 ftime=fopen(
"readout_time.dat",
"r");
64 finh=fopen(
"inh.dat",
"r");
66 min_time=INT_MAX; max_time=INT_MIN;
69 fscanf(ftime,
"%le ",&time);
78 Ts=(min_time+max_time)/2.0;
80 min_inh=INT_MAX; max_inh=INT_MIN;
83 fscanf(finh,
"%le ",&w);
91 N3=ceil((MAX(fabs(min_inh),fabs(max_inh))*(max_time-min_time)/2.0+m/(2*sigma))*4*sigma);
93 W= MAX(fabs(min_inh),fabs(max_inh))/(0.5-((double)m)/N3);
95 my_N[0]=N; my_n[0]=ceil(N*sigma);
96 my_N[1]=N; my_n[1]=ceil(N*sigma);
97 my_N[2]=N3; my_n[2]=ceil(N3*sigma);
100 mri_inh_3d_init_guru(&my_plan, my_N, M, my_n, m, sigma, flags,
101 FFTW_MEASURE| FFTW_DESTROY_INPUT);
103 ftime=fopen(
"readout_time.dat",
"r");
104 fp=fopen(
"knots.dat",
"r");
108 fscanf(fp,
"%le %le",&my_plan.plan.
x[3*j+0],&my_plan.plan.
x[3*j+1]);
109 fscanf(ftime,
"%le ",&my_plan.plan.
x[3*j+2]);
110 my_plan.plan.
x[3*j+2] = (my_plan.plan.
x[3*j+2]-Ts)*W/N3;
115 finh=fopen(
"inh.dat",
"r");
118 fscanf(finh,
"%le ",&my_plan.w[j]);
124 fi=fopen(
"input_f.dat",
"r");
127 fscanf(fi,
"%le ",&real);
128 my_plan.
f_hat[j] = real*cexp(2.0*_Complex_I*M_PI*Ts*my_plan.w[j]*W);
131 if(my_plan.plan.
flags & PRE_PSI)
132 nfft_precompute_psi(&my_plan.plan);
134 mri_inh_3d_trafo(&my_plan);
136 fout=fopen(file,
"w");
140 fprintf(fout,
"%le %le %le %le\n",my_plan.plan.
x[3*j+0],my_plan.plan.
x[3*j+1],creal(my_plan.
f[j]),cimag(my_plan.
f[j]));
145 mri_inh_3d_finalize(&my_plan);
148 int main(
int argc,
char **argv)
151 printf(
"usage: ./construct_data_inh_3d FILENAME N M\n");
155 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
fftw_complex * f_hat
Fourier coefficients.
static void construct(char *file, int N, int M)
construct
NFFT_INT M_total
Total number of samples.
double * x
Nodes in time/spatial domain, size is doubles.
unsigned flags
Flags for precomputation, (de)allocation, and FFTW usage, default setting is PRE_PHI_HUT | PRE_PSI | ...