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;
53 FFTW_MEASURE| FFTW_DESTROY_INPUT;
61 ftime=fopen(
"readout_time.dat",
"r");
62 finh=fopen(
"inh.dat",
"r");
64 min_time=INT_MAX; max_time=INT_MIN;
67 fscanf(ftime,
"%le ",&time);
76 Ts=(min_time+max_time)/2.0;
78 min_inh=INT_MAX; max_inh=INT_MIN;
81 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);
91 W= MAX(fabs(min_inh),fabs(max_inh))/(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]=ceil(N3*sigma);
98 mri_inh_3d_init_guru(&my_plan, my_N, M, my_n, m, sigma, flags,
99 FFTW_MEASURE| FFTW_DESTROY_INPUT);
101 ftime=fopen(
"readout_time.dat",
"r");
102 fp=fopen(
"knots.dat",
"r");
106 fscanf(fp,
"%le %le",&my_plan.plan.
x[3*j+0],&my_plan.plan.
x[3*j+1]);
107 fscanf(ftime,
"%le ",&my_plan.plan.
x[3*j+2]);
108 my_plan.plan.
x[3*j+2] = (my_plan.plan.
x[3*j+2]-Ts)*W/N3;
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);
134 fout=fopen(file,
"w");
138 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]));
146 int main(
int argc,
char **argv)
149 printf(
"usage: ./construct_data_inh_3d FILENAME N M\n");
153 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
void mri_inh_3d_trafo(mri_inh_3d_plan *ths)
fftw_complex * f_hat
Fourier coefficients.
static void construct(char *file, int N, int M)
construct
void nfft_precompute_psi(nfft_plan *ths)
NFFT_INT M_total
Total number of samples.
Header file for the nfft3 library.
double * x
Nodes in time/spatial domain, size is doubles.
void mri_inh_3d_finalize(mri_inh_3d_plan *ths)
unsigned flags
Flags for precomputation, (de)allocation, and FFTW usage, default setting is PRE_PHI_HUT | PRE_PSI | ...