45 static void window_funct_init(
window_funct_plan* ths,
int m,
int n,
double sigma) {
59 double _Complex *f = (
double _Complex*) nfft_malloc(that->M_total*
sizeof(
double _Complex));
60 double _Complex *f_hat = (
double _Complex*) nfft_malloc(that->N_total*
sizeof(
double _Complex));
63 window_funct_init(ths,that->plan.m,that->N3,that->sigma3);
66 that->plan.f = that->f;
67 that->plan.f_hat = that->f_hat;
70 memset(f,0,that->M_total*
sizeof(
double _Complex));
71 for(j=0;j<that->N_total;j++)
73 f_hat[j]=that->f_hat[j];
76 for(l=-ths->n[0]/2;l<=ths->n[0]/2;l++) {
77 for(j=0;j<that->N_total;j++)
78 that->f_hat[j]*=cexp(-2*KPI*_Complex_I*that->w[j]*((
double)l))/PHI_HUT(ths->n[0], ths->n[0]*that->w[j],0);
79 nfft_trafo(&that->plan);
80 for(j=0;j<that->M_total;j++){
82 if(fabs(that->t[j]-((
double)l)/((
double)ths->n[0]))<that->plan.m/((
double)ths->n[0]))
84 double phi_val = PHI(ths->n[0],that->t[j]-((
double)l)/((
double)ths->n[0]),0);
85 f[j]+=that->f[j]*phi_val;
90 for(j=0;j<that->N_total;j++)
91 that->f_hat[j]=f_hat[j];
94 nfft_free(that->plan.f);
96 that->plan.f = that->f;
106 double _Complex *f = (
double _Complex*) nfft_malloc(that->M_total*
sizeof(
double _Complex));
107 double _Complex *f_hat = (
double _Complex*) nfft_malloc(that->N_total*
sizeof(
double _Complex));
110 window_funct_init(ths,that->plan.m,that->N3,that->sigma3);
112 memset(f_hat,0,that->N_total*
sizeof(
double _Complex));
115 that->plan.f = that->f;
116 that->plan.f_hat = that->f_hat;
118 for(j=0;j<that->M_total;j++)
125 for(l=-ths->n[0]/2;l<=ths->n[0]/2;l++) {
127 for(j=0;j<that->M_total;j++) {
129 if(fabs(that->t[j]-((
double)l)/((
double)ths->n[0]))<that->plan.m/((
double)ths->n[0]))
130 that->f[j]*=PHI(ths->n[0],that->t[j]-((
double)l)/((
double)ths->n[0]),0);
134 nfft_adjoint(&that->plan);
135 for(j=0;j<that->N_total;j++)
136 f_hat[j]+=that->f_hat[j]*cexp(2*KPI*_Complex_I*that->w[j]*((
double)l));
137 for(j=0;j<that->M_total;j++)
141 for(j=0;j<that->N_total;j++)
143 f_hat[j] /= PHI_HUT(ths->n[0],ths->n[0]*that->w[j],0);
146 nfft_free(that->plan.f_hat);
148 that->plan.f_hat = that->f_hat;
157 int m,
double sigma,
unsigned nfft_flags,
unsigned fftw_flags) {
159 nfft_init_guru(&ths->plan,2,N,M,n,m,nfft_flags,fftw_flags);
162 ths->N_total = ths->plan.N_total;
163 ths->M_total = ths->plan.M_total;
164 ths->f = ths->plan.f;
165 ths->f_hat = ths->plan.f_hat;
167 ths->t = (
double*) nfft_malloc(ths->M_total*
sizeof(
double));
168 ths->w = (
double*) nfft_malloc(ths->N_total*
sizeof(
double));
171 ths->mv_adjoint = (void (*) (
void* ))mri_inh_2d1d_adjoint;
179 ths->plan.f = ths->f;
180 ths->plan.f_hat = ths->f_hat;
182 nfft_finalize(&ths->plan);
192 window_funct_init(ths,that->plan.m,that->N3,that->sigma3);
195 that->plan.f =that->f ;
199 for(j=0;j<that->N_total;j++) {
200 for(l=-ths->n[0]/2;l<ths->n[0]/2;l++)
203 if(fabs(that->w[j]-((
double)l)/((
double)ths->n[0]))<ths->m/((
double)ths->n[0]))
204 that->plan.f_hat[j*ths->n[0]+(l+ths->n[0]/2)]= that->f_hat[j]*PHI(ths->n[0],that->w[j]-((
double)l)/((double)ths->n[0]),0);
206 that->plan.f_hat[j*ths->n[0]+(l+ths->n[0]/2)]=0.0;
210 nfft_trafo(&that->plan);
212 for(j=0;j<that->M_total;j++)
214 that->f[j] /= PHI_HUT(ths->n[0],ths->n[0]*that->plan.x[3*j+2],0);
224 window_funct_init(ths,that->plan.m,that->N3,that->sigma3);
227 that->plan.f =that->f ;
229 for(j=0;j<that->M_total;j++)
231 that->f[j] /= PHI_HUT(ths->n[0],ths->n[0]*that->plan.x[3*j+2],0);
234 nfft_adjoint(&that->plan);
236 for(j=0;j<that->N_total;j++) {
238 for(l=-ths->n[0]/2;l<ths->n[0]/2;l++)
241 if(fabs(that->w[j]-((
double)l)/((
double)ths->n[0]))<ths->m/((
double)ths->n[0]))
242 that->f_hat[j]+= that->plan.f_hat[j*ths->n[0]+(l+ths->n[0]/2)]*PHI(ths->n[0],that->w[j]-((
double)l)/((double)ths->n[0]),0);
252 int m,
double sigma,
unsigned nfft_flags,
unsigned fftw_flags) {
255 nfft_init_guru(&ths->plan,3,N,M,n,m,nfft_flags,fftw_flags);
256 ths->N_total = N[0]*N[1];
257 ths->M_total = ths->plan.M_total;
258 ths->f = ths->plan.f;
259 ths->f_hat = (
double _Complex*) nfft_malloc(ths->N_total*
sizeof(
double _Complex));
260 ths->w = (
double*) nfft_malloc(ths->N_total*
sizeof(
double));
268 nfft_free(ths->f_hat);
269 nfft_finalize(&ths->plan);
void mri_inh_3d_adjoint(mri_inh_3d_plan *that)
void mri_inh_3d_finalize(mri_inh_3d_plan *ths)
void mri_inh_3d_trafo(mri_inh_3d_plan *that)
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)
Internal header file for auxiliary definitions and functions.
Header file for the nfft3 library.
window_funct_plan is a plan to use the window functions independent of the nfft