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);
90 N3=ceil((MAX(fabs(min_inh),fabs(max_inh))*(max_time-min_time)/2.0+m/(2*sigma))*4*sigma);
91 T=((max_time-min_time)/2.0)/(0.5-((double) m)/N3);
94 my_N[0]=N; my_n[0]=ceil(N*sigma);
95 my_N[1]=N; my_n[1]=ceil(N*sigma);
96 my_N[2]=N3; my_n[2]=N3;
100 FFTW_MEASURE| FFTW_DESTROY_INPUT);
102 ftime=fopen(
"readout_time.dat",
"r");
103 fp=fopen(
"knots.dat",
"r");
107 fscanf(fp,
"%le %le ",&my_plan.plan.
x[2*j+0],&my_plan.plan.
x[2*j+1]);
108 fscanf(ftime,
"%le ",&my_plan.t[j]);
109 my_plan.t[j] = (my_plan.t[j]-Ts)/T;
114 finh=fopen(
"inh.dat",
"r");
117 fscanf(finh,
"%le ",&my_plan.w[j]);
123 fi=fopen(
"input_f.dat",
"r");
126 fscanf(fi,
"%le ",&real);
127 my_plan.
f_hat[j] = real*cexp(2.0*_Complex_I*M_PI*Ts*my_plan.w[j]*W);
135 fout=fopen(file,
"w");
139 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]));
147 int main(
int argc,
char **argv)
150 printf(
"usage: ./construct_data_inh_2d1d FILENAME N M\n");
154 construct(argv[1],atoi(argv[2]),atoi(argv[3]));
fftw_complex * f_hat
Fourier coefficients.
void mri_inh_2d1d_finalize(mri_inh_2d1d_plan *ths)
void nfft_precompute_psi(nfft_plan *ths)
NFFT_INT M_total
Total number of samples.
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 *ths)
static void construct(char *file, int N, int M)
construct
Header file for the nfft3 library.
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 | ...