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);
92 N3=ceil((MAX(fabs(min_inh),fabs(max_inh))*(max_time-min_time)/2.0+m/(2*sigma))*4*sigma);
93 T=((max_time-min_time)/2.0)/(0.5-((double) m)/N3);
96 my_N[0]=N; my_n[0]=ceil(N*sigma);
97 my_N[1]=N; my_n[1]=ceil(N*sigma);
98 my_N[2]=N3; my_n[2]=N3;
101 mri_inh_2d1d_init_guru(&my_plan, my_N, M, my_n, m, sigma, flags,
102 FFTW_MEASURE| FFTW_DESTROY_INPUT);
104 ftime=fopen(
"readout_time.dat",
"r");
105 fp=fopen(
"knots.dat",
"r");
109 fscanf(fp,
"%le %le ",&my_plan.plan.
x[2*j+0],&my_plan.plan.
x[2*j+1]);
110 fscanf(ftime,
"%le ",&my_plan.t[j]);
111 my_plan.t[j] = (my_plan.t[j]-Ts)/T;
116 finh=fopen(
"inh.dat",
"r");
119 fscanf(finh,
"%le ",&my_plan.w[j]);
125 fi=fopen(
"input_f.dat",
"r");
128 fscanf(fi,
"%le ",&real);
129 my_plan.
f_hat[j] = real*cexp(2.0*_Complex_I*M_PI*Ts*my_plan.w[j]*W);
132 if(my_plan.plan.
flags & PRE_PSI)
133 nfft_precompute_psi(&my_plan.plan);
135 mri_inh_2d1d_trafo(&my_plan);
137 fout=fopen(file,
"w");
141 fprintf(fout,
"%le %le %le %le\n",my_plan.plan.
x[2*j+0],my_plan.plan.
x[2*j+1],creal(my_plan.
f[j]),cimag(my_plan.
f[j]));
146 mri_inh_2d1d_finalize(&my_plan);
149 int main(
int argc,
char **argv)
152 printf(
"usage: ./construct_data_inh_2d1d FILENAME N M\n");
156 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
fftw_complex * f_hat
Fourier coefficients.
NFFT_INT M_total
Total number of samples.
static void construct(char *file, int N, int M)
construct
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 | ...