|
TPCCLIB
|
Image transformation functions. More...
#include "libtpcimgp.h"Go to the source code of this file.
Functions | |
| int | img2cube (IMG *img1, int dim, IMG *img2) |
| void | imgScale (IMG *src, IMG *targ, float zoom, int method) |
| void | integerScale (int frame, float ***src, float **targ, int width, int height, int zoom) |
| int | imgSwell (IMG *img1, IMG *img2, int doz) |
| int | imgShrink (IMG *img1, IMG *img2, int doz) |
Image transformation functions.
Definition in file imgtransform.c.
Resample image to cubic image volume, where all three dimensions are the same, with cubic voxel sizes. Note that some smoothing occurs in the process, therefore the use of this function should be limited to illustrations of image data.
| img1 | Pointer to IMG to be resliced; this image is not modified. |
| dim | New dimension; enter 0 to use the largest dimension in image. |
| img2 | Pointer to initiated IMG where resliced data will be stored. |
Definition at line 16 of file imgtransform.c.
Image size scaling using the defined method.
| src | Source image to be scaled. |
| targ | Scaled image; must be allocated to the size of resulting image. |
| zoom | Scaling factor (integer); currently must be >=1. |
| method | Method code number (not used yet). |
Definition at line 123 of file imgtransform.c.
Shrink the image data matrix into half of the original size in each dimension.
Eight neighbouring pixels are averaged into one pixel, without any interpolation etc.
| img1 | Pointer to the original image; not changed. |
| img2 | Pointer to the shrunken image; must be initiated. If allocated for correct size, then only pixel values are set; if not, then any previous contents are deleted, memory is allocated, header information is set, and of course the pixel values are set. |
| doz | Shrink (1) the image in z dimension (over image planes), or shrink only in x and y dimensions (0). |
Definition at line 263 of file imgtransform.c.
Inflate the image data matrix into twice the original size in each dimension.
Each pixel is inflated into eight pixels, without any interpolation etc.
| img1 | Pointer to the original image; not changed. |
| img2 | Pointer to the swollen image; must be initiated. If allocated for correct size, then only pixel values are set; if not, then any previous contents are deleted, memory is allocated, header information is set, and of course the pixel values are set. |
| doz | Inflate (1) the image in z dimension (over image planes), or only in x,y dimensions (0). |
Definition at line 202 of file imgtransform.c.
| void integerScale | ( | int | frame, |
| float *** | src, | ||
| float ** | targ, | ||
| int | width, | ||
| int | height, | ||
| int | zoom ) |
Magnify one frame of dynamic 2D image by integer zoom factor. Pixel values are simply duplicated.
| frame | Index of the frame to be scaled. |
| src | Source data in dynamic 2D array: srcp[y][x][frame]. |
| targ | Pre-allocated target static 2D data matrix: targ[y][x]; actual matrix size is allowed to be larger than what is used here. |
| width | Width (x dim) of the source data matrix. |
| height | Height (y dim) of the source data matrix. |
| zoom | Zoom factor. If less than 2, then matrix is just copied. |
Definition at line 159 of file imgtransform.c.
Referenced by imgScale().