ncigt-fil
Functions
Artifact Suppression via UNFOLD

Functions

int filter_t_init (int n, int x, int y, int c, double *a, double *b, filter_t_obj *obj)
 
int filter_t_quit (filter_t_obj *obj)
 
int filter_t_step (filter_t_obj *obj, COMPLEX *dataI, COMPLEX *dataO)
 
void prep_unfold_dc (short Nx, short N_acq, short Nf, short ncoils, fil_fft_mngr *mngr, KCOORD *kline_o, KCOORD *kline_e, short fr1, COMPLEX *data, COMPLEX *buf_lg, COMPLEX *buf_sm, float *filter_dc, float *filter_dckept, short *near_dc, short filt_w, short Nf_proc, KCOORD *kline_c, COMPLEX *data_dc)
 
int set_nfproc (short Nf, short flag)
 
void setup_unfold (SCAN_INFO *hdr_ptr, int Nt, float *filter_dc, float *filter_ny, float *filter_dckept, float *filter_dcny, short *near_dc, short *filt_w_ptr)
 
void synth_frames (short ncoils, short Nf, short Nz, short Ny, short Nx, COMPLEX *data_in, short Nf_proc, COMPLEX *data_out)
 
void synth_frames_cine (short ncoils, short Nf_full, short fr1, short Nf, short N_acq, short Nx, short ky, KCOORD *kline_o, KCOORD *kline_e, COMPLEX *data_in, short Nf_proc, COMPLEX *data_out)
 
void transfer_dc (short dir, short ncoils, short Nf, short Nz, short Ny, short Nx, short filt_w, short *near_dc, float *filter, COMPLEX *lg_array, COMPLEX *sm_array)
 
void unfold_filter (short ncoils, short Nf, short Nz, short Ny, short Nx, float *filter, COMPLEX *data)
 
void unfold_recombine (short Nx, short Ny_proc, short Nz_proc, short Nf_proc, short *near_dc, short filt_w, COMPLEX *dc, COMPLEX *full)
 

Detailed Description

The UNFOLD approach employs temporal domain processing to suppress artifacts.

The method is described in "Unaliasing by Fourier-encoding the overlaps using the temporal dimension" (UNFOLD). Bruno Madore, Gary H. Glover, and Norbert J. Pelc. Magn Reson Med. 42(5):813-826, Nov 1999. [DOI]

Function Documentation

int filter_t_init ( int  n,
int  x,
int  y,
int  c,
double *  a,
double *  b,
filter_t_obj *  obj 
)

An implementation of a Direct Form II digital filter, for processing a temporal series of 2D images along the temporal domain.

The filter is initiallized by specifying the number of filter taps, and the set of filter coefficients "a" (feedback) and "b" (feedforward).

                     filter
   input             state              output
              a[0]            b[0]
     I   -+---------> w[0] --------->+--->  O
          |            |             |
          |   a[1]     v      b[1]   |
          +<--------- w[1] --------->+
          |            v             |
          .            .             .
          .            .             .
          .            .             .
          |            |             |
          |   a[n]     v      b[n]   |
          +<--------- w[n] --------->+

Notes:

  • at iniitalization, the feedback filter taps are normalized, so that a[0] == 1.0.
  • the implementation is threaded, for improved processing speed on multicore machines.
Parameters
nnumber of temporal filter taps
xsize of 1st dimension of input data, Nx
ysize of 2nd dimension of input data, Ny
csize of 3rd dimension of input data, Nc
afeedback coefficients
bfeedforward coefficients
objthe output filter object that is initiated by the function call
int filter_t_quit ( filter_t_obj *  obj)

release all memory associated the temporal-domain filter bank object.

int filter_t_step ( filter_t_obj *  obj,
COMPLEX *  dataI,
COMPLEX *  dataO 
)

cycle the temporal filter bank through one step.

Note: the filter bank object should be initialized using filter_t_init() prior to this call.

Parameters
objan FIL filter bank object.
dataIinput data
dataOoutput data
void prep_unfold_dc ( short  Nx,
short  N_acq,
short  Nf,
short  ncoils,
fil_fft_mngr *  mngr,
KCOORD *  kline_o,
KCOORD *  kline_e,
short  fr1,
COMPLEX *  data,
COMPLEX *  buf_lg,
COMPLEX *  buf_sm,
float *  filter_dc,
float *  filter_dckept,
short *  near_dc,
short  filt_w,
short  Nf_proc,
KCOORD *  kline_c,
COMPLEX *  data_dc 
)

Prepare UNFOLD filter memory arrays

Parameters
NxSize in x direction.
N_acqNumber of acquired ky-kz lines.
NfSize time direction.
ncoilsnumber of coils
kline_oSampling function, odd time frames.
kline_eSampling function, even time frames.
fr1Whether 1st frame is considered even (0) or odd (1).
buf_lgLarger buffer, for processing.
buf_smSmaller buffer, for processing.
filter_dcUNFOLD filter, DC region.
filter_dckeptUNFOLD filter (1-filter_dc)
near_dcFrequencies around DC.
filt_wWidth of DC region, in near_dc.
Nf_procnumber of temporal frames, including synthetic
int set_nfproc ( short  Nf,
short  flag 
)

Find out how many frames should be used in the reconstruction. This must be an even number, and a smooth transition between 1st and last frame is desirable. To do so, temporary synthetic frames may have to be created. One has the option of a setting based on precision (larger Nf_proc, flag=0), or speed of recon- struction (smaller Nf_proc, flag=1).

Parameters
NfNumber of time frames.
flagswitch between speed vs. precision

With flag = 1, the return value is (int) 2.0*ceil( Nf/2 ). This setting provides increased recon speed and decreased memory usage, i.e., smaller Nf_proc (e.g., for 5 frames 1-2-3-4-5, the reconstruction is done with 6 frames 1-2-3-4-5-4, where the 4th is repeated to make Nf_proc even).

With flag = 0, the return value is 2*Nf - 2 This setting provides increased precision, by avoiding discontinuities between the first and last frame of the data to be processed (e.g., for 5 frames 1-2-3-4-5, the recon is done with 8 frames 1-2-3-4-5-4-3-2, where frames 2, 3 and 4 are repeated, the transisition between 1st frame and last frame (frame #2) being presumably smooth).

void setup_unfold ( SCAN_INFO *  hdr_ptr,
int  Nt,
float *  filter_dc,
float *  filter_ny,
float *  filter_dckept,
float *  filter_dcny,
short *  near_dc,
short *  filt_w_ptr 
)

Set-up parameters/filters specific to the UNFOLD algorithm.

Parameters
hdr_ptrStructure with scan info.
NtNumber of time points.
filter_dcUNFOLD filter, DC region.
filter_nyUNFOLD filter, Ny region.
filter_dckeptUNFOLD filter (1-filter_dc)
filter_dcnyUNFOLD filter (filter_dc*filter_ny)
near_dcFrequencies around DC.
filt_w_ptrWidth of DC region, in near_dc.
void synth_frames ( short  ncoils,
short  Nf,
short  Nz,
short  Ny,
short  Nx,
COMPLEX *  data_in,
short  Nf_proc,
COMPLEX *  data_out 
)

Generate extra, synthetic time frames. This has two purposes: to make the number of phases even to insure alternation between the two sampling schemes, and to make the change between last and first frames smoother.

Parameters
ncoilsNumber of receiver coils.
NfSize time direction.
NzSize in z direction.
NySize in y direction.
NxSize in x direction.
data_inData input, to be extended from Nf to Nf_proc frames.
Nf_procNew size along t, including synthetic frames.
data_outoutput data
void synth_frames_cine ( short  ncoils,
short  Nf_full,
short  fr1,
short  Nf,
short  N_acq,
short  Nx,
short  ky,
KCOORD *  kline_o,
KCOORD *  kline_e,
COMPLEX *  data_in,
short  Nf_proc,
COMPLEX *  data_out 
)

For a given ky line, generate extra (synthetic) time frames. This has two purposes: to make the number of phases even to insure alternation between the two sampling schemes, and to make the change between last and first frames smoother.

Parameters
ncoilsNumber of receiver coils.
Nf_fullArray size time direction.
NfData size, <= Nf_full.
N_acqNumber of k lines per frame.
NxSize in x direction.
kyky line being treated.
data_inData input, to be extended from Nf to Nf_proc frames.
Nf_procNew size along t, including synthetic frames.
data_outoutput data
void transfer_dc ( short  dir,
short  ncoils,
short  Nf,
short  Nz,
short  Ny,
short  Nx,
short  filt_w,
short *  near_dc,
float *  filter,
COMPLEX *  lg_array,
COMPLEX *  sm_array 
)

When DC and Nyquist frequencies are handled seperately in an application of UNFOLD parad, this function can be used to copy the mult-frame DC data to a processing buffer.

Parameters
dirDirectiion of transfer (-1 from large array to small, 1 from small to large).
ncoilsNumber of receiver coils.
NfSize time direction.
NzSize in z direction.
NySize in y direction.
NxSize in x direction.
filt_wNumber of entries in near_dc[]
near_dcLocation of those frequencies that correspond to near-DC frequencies.
filterWeight to give to data while transfering it (only for dir=1, from small to large).
lg_arrayArray containing all temporal frequencies (length Nf along frequency axis).
sm_arrayArray containing only temporal frequencies near DC (length filt_w along frequency axis).
void unfold_filter ( short  ncoils,
short  Nf,
short  Nz,
short  Ny,
short  Nx,
float *  filter,
COMPLEX *  data 
)

Apply the UNFOLD filters to the data

Parameters
ncoilsNumber of receiver coils. (dim 5)
NfSize time direction. (dim 4)
NzSize in z direction. (dim 3)
NySize in y direction. (dim 2)
NxSize in x direction. (dim 1)
filterUNFOLD filter, applied along dim 4.
dataData to filter (inplace operation: output overwrites input). size: Nx-Ny-Nz-Nf-ncoil
void unfold_recombine ( short  Nx,
short  Ny_proc,
short  Nz_proc,
short  Nf_proc,
short *  near_dc,
short  filt_w,
COMPLEX *  dc,
COMPLEX *  full 
)

Recombine the improved DC region in 'dc' (calculated with half the acceleration) to the rest of the bandwidth (calculated with full acceleration).

Parameters
NxSize in x direction.
Nf_procSize time direction, including synthetic frames
near_dcFrequencies around DC.
filt_wWidth of DC region, in near_dc.
dcContains improved version of DC region.
fullContains rest of bandwidth (DC removed). The output overwrites the input values in 'full'.