Routines to scale, interpolate, flip, and rotate images.
More...
|
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) |
|
Routines to scale, interpolate, flip, and rotate images.
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
-
slice | Number of the slice being treated (between 1 and N_sl). |
loc0 | Location of first slice. |
ras0 | Axis for value loc0. |
slthick | Slice thickness (mm). |
scanspacing | Spacing between slices (mm). |
locs_brth | Number of slices acquired per breathold duration. |
rot3 | Third line of rotation matrix, i.e. through slice direction. |
ctr | 3 element position vector for FOV center. |
tloc0 | Distance from isocenter, as expressed in the epic code in rsp_info[0].rsptloc, for the first slice. |
tloc1 | Distance from isocenter, in rsp_info[0].rsptloc, for the 2nd slice. |
loc_ptr | Location of current slice. |
ras_ptr | Axis 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
-
Nx | Size in x direction. |
Ny | Size in y direction. |
Ny_int | Interpolated size in y direction. |
N_out | Dimension of square output matrix (a power of 2). |
off_phdir | Offset with respect to isocenter in phase-encoding direction, as a fraction of the FOV. |
data | Data to interpolate, Nx by Ny. |
data_int | Interpolated 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
-
Nx | Size in x direction. |
Ny | Size in y direction. |
Ny_int | Interpolated size in y direction. |
N_out | Dimension of square output matrix (a power of 2). |
off_phdir | Offset with respect to isocenter in phase-encoding direction, as a fraction of the FOV. |
data | Data to interpolate, Nx by Ny. |
data_int | Interpolated 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_tl | Coordinates for top left corner |
x_tr | Coordinates for top right corner |
x_br | Coordinates for bottom right corner |
rot1 | First line of rotation matrix, i.e. frequency-encoding direction. |
rot2 | Second line pf rotation matrix, i.e. phase-encoding direction. |
p_pos | Patient position (1 for supine, 2 for prone, 4 for left decub, 8 for right decub). |
p_entry | Patient entry ('1' for head first, '2' for feet first). |
flip_h_ptr | Flag to flip horizontally. |
flip_v_ptr | Flag to flip vertically. |
rot_90_ptr | Flag 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_90 | Flag to rotate +90 (=+1) or -90 (=-1) degrees. |
flip_h | Flag to flip horizontally. |
flip_v | Flag to flip vertically. |
N_out | Dimension of square, output image. |
im_out | Magnitude 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_90 | Flag to rotate +90 (=+1) or -90 (=-1) degrees. |
flip_h | Flag to flip horizontally. |
flip_v | Flag to flip vertically. |
obj | image to rotate and/or flip. Image must be square, but can be any DATA_OBJ data type |