ncigt-fil
Functions
Utility Functions

Functions

void calc_samp_dens (KCOORD *kline_o, KCOORD *kline_e, short N_acq, short Nz_proc, int fill_fac, short Ny, float *samp_dens)
 
float eval_knoise (SCAN_INFO hdr, COMPLEX *kspace_data, KCOORD *kline_o, COMPLEX *bufspace)
 
void extract_ksubset (short ncoils, short nf, short nx, KCOORD *kline_full, KCOORD *kline_sub, short nl_full, short nl_sub, COMPLEX *fullmat, COMPLEX *submat)
 
void fil_version ()
 
int imnum_out (short next_im, short z_anat, short Nf, short ncoils, short dump_b1maps)
 
void kstretch (short Nx, short Ny, short Nz_proc, short N_acq, short fill_fac, short ifr, short fr1, KCOORD *kline_o, KCOORD *kline_e, COMPLEX *data, COMPLEX *data_str)
 
void select_kcenter (short firsty, short lasty, short Ny, short firstz, short lastz, short Nz, float *filt)
 
int slice_number (int z, int Nsl, int z_first, char *application)
 
void weigh_kykz (short ncoils, short nf, short nz, short ny, short nx, float *weight, COMPLEX *data)
 

Detailed Description

Function Documentation

void calc_samp_dens ( KCOORD *  kline_o,
KCOORD *  kline_e,
short  N_acq,
short  Nz_proc,
int  fill_fac,
short  Ny,
float *  samp_dens 
)

Calculate the sampling density.

Parameters
kline_oSampling function, odd time frames.
kline_eSampling function, even time frames.
N_acqNumber of acquired lines per frame, i.e., length of kline_o and _e.
Nz_procSize along z, in processing.
fill_facFactor to make ky lines integer.
NyMatrix size along y, actual dataset.
samp_densSampling density, size = Nz_proc*fill_fac*Ny.
float eval_knoise ( SCAN_INFO  hdr,
COMPLEX *  kspace_data,
KCOORD *  kline_o,
COMPLEX *  bufspace 
)

Evaluate the standard deviation of the noise on the k-space data. The returned value is used to set the regularization threshold in vdsense.

Get an estimate of the noise level. Look only at the corners of the kx-ky space (don't look at the central 20% part on both axes, which may contain a lot of signal). Subtract the time average to remove most of the remaining signal. Odd and even time frames are different, so use different time averages. The remaining data should be mostly noise. Find its standard deviation.

Parameters
hdrContains scan info.
kspace_datak-space data (size ncoils*Nf*N_acq*Nx)
kline_oSampling function, odd time frames.
bufspaceMemory space to work in. (size:ncoils*Nf*N_acq*Nx)
void extract_ksubset ( short  ncoils,
short  nf,
short  nx,
KCOORD *  kline_full,
KCOORD *  kline_sub,
short  nl_full,
short  nl_sub,
COMPLEX *  fullmat,
COMPLEX *  submat 
)

From a matrix with k-space lines listed in kline_full, generate a subset matrix featuring only the lines listed in kline_sub.

Parameters
ncoilsNumber of coils.
nfNumber of time frames.
nxSize along x or kx.
kline_fullList of ky/kz for lines in fullmat
kline_subList of ky/kz for lines in submat
nl_fullNumber of lines in kline_full.
nl_subNumber of lines in kline_sub.
fullmatFull matrix to subsample.
submatSubsampled matrix.
void fil_version ( )

Output the current version and compile time of the library.

int imnum_out ( short  next_im,
short  z_anat,
short  Nf,
short  ncoils,
short  dump_b1maps 
)

Calculates the image number for the next image to be written out.

Returns
if (dump_b1maps == 1),
next_im+z_anat*(Nf+ncoils);
else,
next_im+z_anat*Nf;
Parameters
next_im1st image number to use for output.
z_anatSlice number, in anatomical order.
NfNumber of time frames.
ncoilsnumber of receiver coils.
dump_b1mapsFlag to display the B1 maps.
void kstretch ( short  Nx,
short  Ny,
short  Nz_proc,
short  N_acq,
short  fill_fac,
short  ifr,
short  fr1,
KCOORD *  kline_o,
KCOORD *  kline_e,
COMPLEX *  data,
COMPLEX *  data_str 
)

zero-pads the k-space data set, placing sub-sampled data in the full-sized data matrix with zeros at unsampled locations.

Take the compact representation of k-space, with a list of N_acq lines, each one with Nx real and imaginary values, and 'stretch' it into its normal shape, a cube having Nx by (fill_fac*Ny) by Nz_proc complex elements. (Note that due to sparse sampling and filling, fill_fac*Ny*Nz_proc is typically much greater than N_acq).

Parameters
NxSize in kx direction.
NySize in ky direction.
Nz_procSize in kz direction.
N_acqNumber of acquired ky-kz lines.
fill_facFactor by which raw data must be stretched so that all the (fractional) ky lines become integers.
ifrTime frame under consideration.
fr1Whether 1st frame is considered even (0) or odd (1).
kline_oSampling function, odd time frames.
kline_eSampling function, even time frames.
dataData to uncompress.
data_strUncompressed version of data.
void select_kcenter ( short  firsty,
short  lasty,
short  Ny,
short  firstz,
short  lastz,
short  Nz,
float *  filt 
)

Generate a 2D Gaussian filter to extract a central region in the ky-kz plane.

Parameters
firsty1st ky line in selected region.
lastyLast ky line in selected region.
NySize of filter along ky.
firstz1st kz line in selected region.
lastzLast kz line in selected region.
NzSize of filter along kz.
filtCalculated filter.
int slice_number ( int  z,
int  Nsl,
int  z_first,
char *  application 
)

Convert the order in which slies are acquired into the anatomical order in which the output should be written.

Parameters
zSlice number, according to acquisition.
NslNumber of slices
applicationSpecific MR application under consideration.
void weigh_kykz ( short  ncoils,
short  nf,
short  nz,
short  ny,
short  nx,
float *  weight,
COMPLEX *  data 
)

Apply a correction in the ky-kz plane, e.g., to correct for sampling density.

data[kx][ky] = data[kx][ky] / weight[ky];

Parameters
ncoilsNumber of coils.
nfNumber of time frames.
nzSize along kz.
nySize along ky.
nxSize along x or kx.
weightCorrection to apply in ky-kz plane.
dataData to be corrected.