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);
88 N3=ceil((MAX(fabs(min_inh),fabs(max_inh))*(max_time-min_time)/2.0+m/(2*sigma))*4*sigma);
90 W= MAX(fabs(min_inh),fabs(max_inh))/(0.5-((double)m)/N3);
92 my_N[0]=N; my_n[0]=ceil(N*sigma);
93 my_N[1]=N; my_n[1]=ceil(N*sigma);
94 my_N[2]=N3; my_n[2]=ceil(N3*sigma);
97 mri_inh_3d_init_guru(&my_plan, my_N, M, my_n, m, sigma, flags,
98 FFTW_MEASURE| FFTW_DESTROY_INPUT);
100 ftime=fopen(
"readout_time.dat",
"r");
101 fp=fopen(
"knots.dat",
"r");
103 for(j=0;j<my_plan.M_total;j++)
105 fscanf(fp,
"%le %le",&my_plan.plan.x[3*j+0],&my_plan.plan.x[3*j+1]);
106 fscanf(ftime,
"%le ",&my_plan.plan.x[3*j+2]);
107 my_plan.plan.x[3*j+2] = (my_plan.plan.x[3*j+2]-Ts)*W/N3;
112 finh=fopen(
"inh.dat",
"r");
115 fscanf(finh,
"%le ",&my_plan.w[j]);
121 fi=fopen(
"input_f.dat",
"r");
124 fscanf(fi,
"%le ",&real);
125 my_plan.f_hat[j] = real*cexp(2.0*_Complex_I*M_PI*Ts*my_plan.w[j]*W);
128 if(my_plan.plan.flags &
PRE_PSI)
129 nfft_precompute_psi(&my_plan.plan);
133 fout=fopen(file,
"w");
135 for(j=0;j<my_plan.M_total;j++)
137 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 int main(
int argc,
char **argv)
148 printf(
"usage: ./construct_data_inh_3d FILENAME N M\n");
152 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
static void construct(char *file, int N, int M)
construct
void mri_inh_3d_finalize(mri_inh_3d_plan *ths)
void mri_inh_3d_trafo(mri_inh_3d_plan *that)
Header file for the nfft3 library.