30 #define MAX(a,b) (((a)>(b))?(a):(b))
47 double time,min_time,max_time,min_inh,max_inh;
49 FILE *fp,*fout,*fi,*finh,*ftime;
60 ftime=fopen(
"readout_time.dat",
"r");
61 finh=fopen(
"inh.dat",
"r");
63 min_time=INT_MAX; max_time=INT_MIN;
66 fscanf(ftime,
"%le ",&time);
75 Ts=(min_time+max_time)/2.0;
77 min_inh=INT_MAX; max_inh=INT_MIN;
80 fscanf(finh,
"%le ",&w);
89 N3=ceil((MAX(fabs(min_inh),fabs(max_inh))*(max_time-min_time)/2.0+m/(2*sigma))*4*sigma);
90 T=((max_time-min_time)/2.0)/(0.5-((double) m)/N3);
93 my_N[0]=N; my_n[0]=ceil(N*sigma);
94 my_N[1]=N; my_n[1]=ceil(N*sigma);
95 my_N[2]=N3; my_n[2]=N3;
99 FFTW_MEASURE| FFTW_DESTROY_INPUT);
101 ftime=fopen(
"readout_time.dat",
"r");
102 fp=fopen(
"knots.dat",
"r");
104 for(j=0;j<my_plan.M_total;j++)
106 fscanf(fp,
"%le %le ",&my_plan.plan.x[2*j+0],&my_plan.plan.x[2*j+1]);
107 fscanf(ftime,
"%le ",&my_plan.t[j]);
108 my_plan.t[j] = (my_plan.t[j]-Ts)/T;
113 finh=fopen(
"inh.dat",
"r");
116 fscanf(finh,
"%le ",&my_plan.w[j]);
122 fi=fopen(
"input_f.dat",
"r");
125 fscanf(fi,
"%le ",&real);
126 my_plan.f_hat[j] = real*cexp(2.0*_Complex_I*M_PI*Ts*my_plan.w[j]*W);
129 if(my_plan.plan.flags &
PRE_PSI)
130 nfft_precompute_psi(&my_plan.plan);
134 fout=fopen(file,
"w");
136 for(j=0;j<my_plan.M_total;j++)
138 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 int main(
int argc,
char **argv)
149 printf(
"usage: ./construct_data_inh_2d1d FILENAME N M\n");
153 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
static void construct(char *file, int N, int M)
construct
void mri_inh_2d1d_init_guru(mri_inh_2d1d_plan *ths, int *N, int M, int *n, int m, double sigma, unsigned nfft_flags, unsigned fftw_flags)
void mri_inh_2d1d_trafo(mri_inh_2d1d_plan *that)
void mri_inh_2d1d_finalize(mri_inh_2d1d_plan *ths)
Header file for the nfft3 library.