ncigt-fil
Functions
Image Manipulation Functions

Routines to scale, interpolate, flip, and rotate images. More...

Functions

void find_annotation (int slice, float loc0, char ras0, float slthick, float scanspacing, int locs_brth, int *rot3, float *ctr, float tloc0, float tloc1, float *loc_ptr, char *ras_ptr)
 
void interplin_ima (short Nx, short Ny, short Ny_int, short N_out, float off_phdir, COMPLEX *data, float *data_int)
 
void interpsinc_ima (short Nx, short Ny, short Ny_int, short N_out, float off_phdir, COMPLEX *data, float *data_int)
 
void orientation (float x_tl, float y_tl, float z_tl, float x_tr, float y_tr, float z_tr, float x_br, float y_br, float z_br, int *rot1, int *rot2, int p_pos, int p_entry, short *flip_h_ptr, short *flip_v_ptr, short *rot_90_ptr)
 
void rot_and_flip (short rot_90, short flip_h, short flip_v, short N_out, float *im_out)
 
short rot_and_flip_data_obj (short rot_90, short flip_h, short flip_v, DATA_OBJ *obj)
 

Detailed Description

Routines to scale, interpolate, flip, and rotate images.

Function Documentation

void find_annotation ( int  slice,
float  loc0,
char  ras0,
float  slthick,
float  scanspacing,
int  locs_brth,
int *  rot3,
float *  ctr,
float  tloc0,
float  tloc1,
float *  loc_ptr,
char *  ras_ptr 
)

Figure out the location and RAS (1 char for right vs anterior vs superior, for sagital-like, coronal-like or axial-like planes respectively). This is used for image annotation, e.g., I5.2 would be an axial-like plane 5.2 mm from isocenter, in the inferior direction.

Parameters
sliceNumber of the slice being treated (between 1 and N_sl).
loc0Location of first slice.
ras0Axis for value loc0.
slthickSlice thickness (mm).
scanspacingSpacing between slices (mm).
locs_brthNumber of slices acquired per breathold duration.
rot3Third line of rotation matrix, i.e. through slice direction.
ctr3 element position vector for FOV center.
tloc0Distance from isocenter, as expressed in the epic code in rsp_info[0].rsptloc, for the first slice.
tloc1Distance from isocenter, in rsp_info[0].rsptloc, for the 2nd slice.
loc_ptrLocation of current slice.
ras_ptrAxis for value loc.
void interplin_ima ( short  Nx,
short  Ny,
short  Ny_int,
short  N_out,
float  off_phdir,
COMPLEX *  data,
float *  data_int 
)

Interpolate (linearly) the reconstruction image to the image size expected by GE's Signa display tools, and shift by prescribed amount in phase-encoding direction.

(Note: phase information is discarded)

Parameters
NxSize in x direction.
NySize in y direction.
Ny_intInterpolated size in y direction.
N_outDimension of square output matrix (a power of 2).
off_phdirOffset with respect to isocenter in phase-encoding direction, as a fraction of the FOV.
dataData to interpolate, Nx by Ny.
data_intInterpolated data, N_out by N_out.
void interpsinc_ima ( short  Nx,
short  Ny,
short  Ny_int,
short  N_out,
float  off_phdir,
COMPLEX *  data,
float *  data_int 
)

Interpolate (using a sinc function) image to the image size expected by GE's Signa display tools, and shift by prescribed amount in phase-encoding direction.

(Note: phase information is discarded)

Parameters
NxSize in x direction.
NySize in y direction.
Ny_intInterpolated size in y direction.
N_outDimension of square output matrix (a power of 2).
off_phdirOffset with respect to isocenter in phase-encoding direction, as a fraction of the FOV.
dataData to interpolate, Nx by Ny.
data_intInterpolated data, N_out by N_out.
void orientation ( float  x_tl,
float  y_tl,
float  z_tl,
float  x_tr,
float  y_tr,
float  z_tr,
float  x_br,
float  y_br,
float  z_br,
int *  rot1,
int *  rot2,
int  p_pos,
int  p_entry,
short *  flip_h_ptr,
short *  flip_v_ptr,
short *  rot_90_ptr 
)

Determine if the output needs to be rotated and/or flipped.

Parameters
x_tlCoordinates for top left corner
x_trCoordinates for top right corner
x_brCoordinates for bottom right corner
rot1First line of rotation matrix, i.e. frequency-encoding direction.
rot2Second line pf rotation matrix, i.e. phase-encoding direction.
p_posPatient position (1 for supine, 2 for prone, 4 for left decub, 8 for right decub).
p_entryPatient entry ('1' for head first, '2' for feet first).
flip_h_ptrFlag to flip horizontally.
flip_v_ptrFlag to flip vertically.
rot_90_ptrFlag to rotate +90 (=+1) or -90 (=-1)
void rot_and_flip ( short  rot_90,
short  flip_h,
short  flip_v,
short  N_out,
float *  im_out 
)

Rotate and/or flip a square magnitude (i.e. not complex) image.

Parameters
rot_90Flag to rotate +90 (=+1) or -90 (=-1) degrees.
flip_hFlag to flip horizontally.
flip_vFlag to flip vertically.
N_outDimension of square, output image.
im_outMagnitude image to rotate and/or flip.
short rot_and_flip_data_obj ( short  rot_90,
short  flip_h,
short  flip_v,
DATA_OBJ *  obj 
)

Rotate and/or flip any data object.

Parameters
rot_90Flag to rotate +90 (=+1) or -90 (=-1) degrees.
flip_hFlag to flip horizontally.
flip_vFlag to flip vertically.
objimage to rotate and/or flip. Image must be square, but can be any DATA_OBJ data type