#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include <ctype.h>#include "libtpcmisc.h"#include "include/imgio.h"Go to the source code of this file.
Macros | |
| #define | LIB_NAME "libtpcimgio" |
| #define | ALLTESTS 0 |
| #define | IMG_IO 1 |
| #define | POLARMAP_IO 2 |
| #define | MODULE 100 |
| #define | MAXVAL 100000; |
| #define | TEST_WITH_FILENAME(filename, desired_length, error_value) |
| #define | TEST_WITH_FORMAT(filename, desired_format, error_value) |
Functions | |
| int | test_create_img (IMG *img, int dim_x, int dim_y, int dim_z, int dim_t) |
| int | test_polarmap () |
| int | test_create_polarmap (IMG *img, int num_rings, int *sectors_per_ring, float *ring_position, short int *ring_angle, short int start_angle) |
| int | test_img_io (IMG *img) |
| int | test_polarmap_io (IMG *img) |
| int | test_modules (IMG *img) |
| void | print_usage () |
| int | main (int argc, char *argv[]) |
Variables | |
| int | VERBOSE = 0 |
| #define ALLTESTS 0 |
Serial numbers for function names.
Definition at line 43 of file libtpcimgio.c.
Referenced by main().
| #define IMG_IO 1 |
Definition at line 44 of file libtpcimgio.c.
Referenced by main().
| #define LIB_NAME "libtpcimgio" |
| #define MAXVAL 100000; |
Definition at line 48 of file libtpcimgio.c.
| #define MODULE 100 |
Definition at line 46 of file libtpcimgio.c.
Referenced by main().
| #define POLARMAP_IO 2 |
Definition at line 45 of file libtpcimgio.c.
Referenced by main().
| #define TEST_WITH_FILENAME | ( | filename, | |
| desired_length, | |||
| error_value | |||
| ) |
Referenced by test_modules().
| #define TEST_WITH_FORMAT | ( | filename, | |
| desired_format, | |||
| error_value | |||
| ) |
Referenced by test_modules().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Main function. For retrieval of library information and for testing.
| argc | number of arguments |
| argv | array of pointers to string arguments |
Definition at line 80 of file libtpcimgio.c.
References ALLTESTS, IMG_IO, imgEmpty(), imgInit(), libtpcimgio_print_build(), libtpcimgio_print_dhistory(), libtpcimgio_print_dreadme(), libtpcimgio_print_history(), libtpcimgio_print_readme(), MODULE, POLARMAP_IO, print_usage(), test_create_img(), test_img_io(), test_modules(), test_polarmap(), and VERBOSE.
| void print_usage | ( | ) |
Function for printing the usage information of the test program.
Function for printing the usage information of the library test program.
Definition at line 582 of file libtpcimgio.c.
References LIB_NAME, and libtpcimgio_print_build().
Referenced by main().
| int test_create_img | ( | IMG * | img, |
| int | dim_x, | ||
| int | dim_y, | ||
| int | dim_z, | ||
| int | dim_t | ||
| ) |
Create IMG for testing purposis.
| img | Pointer to an initiated but not allocated IMG |
| dim_x | X dimension (nr of columns) |
| dim_y | Y dimension (nr of rows) |
| dim_z | Z dimension (nr of planes) |
| dim_t | time dimension (nr of time frames, or gates) |
Definition at line 184 of file libtpcimgio.c.
References IMG::decayCorrection, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_DC_CORRECTED, IMG_STATUS_INITIALIZED, IMG_TYPE_IMAGE, imgAllocate(), imgSetDecayCorrFactors(), IMGUNIT_KBQ_PER_ML, IMG::isotopeHalflife, IMG::m, IMG::mid, IMG::planeNumber, IMG::scanStart, IMG::start, IMG::status, IMG::type, and IMG::unit.
Referenced by main().
| int test_create_polarmap | ( | IMG * | img, |
| int | num_rings, | ||
| int * | sectors_per_ring, | ||
| float * | ring_position, | ||
| short int * | ring_angle, | ||
| short int | start_angle | ||
| ) |
Create POLARMAP IMG for testing purposis.
| img | Pointer to an initiated but not allocated IMG |
| num_rings | Number of polar map rings |
| sectors_per_ring | Sectors per ring |
| ring_position | Ring positions |
| ring_angle | Ring angles |
| start_angle | Polar map start angle for rings, as defined in ECAT 7 header |
Definition at line 234 of file libtpcimgio.c.
References IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_STATUS_INITIALIZED, IMG_TYPE_POLARMAP, imgAllocate(), IMGUNIT_KBQ_PER_ML, IMG::m, IMG::mid, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, IMG::start, IMG::status, IMG::type, and IMG::unit.
Referenced by test_polarmap().
| int test_img_io | ( | IMG * | img | ) |
Test bench for IO functions. Tests include:
ECAT7 image write and read
ECAT7 image values write and read
ECAT6 image volume write and read
Analyze image volume write and read
| img | related image stucture |
Definition at line 283 of file libtpcimgio.c.
References IMG::_dataType, IMG::_fileFormat, ECAT7_SUNI2, IMG_ANA, IMG_ANA_L, IMG_E63, IMG_E7, IMG_E7_2D, IMG_NIFTI_1D, IMG_NIFTI_1S, IMG_TYPE_IMAGE, imgEmpty(), imgFormatDetermine(), imgInfo(), imgInit(), imgMatch(), imgRead(), imgWrite(), niftiRemove(), IMG::scanner, SCANNER_ECAT931, SCANNER_UNKNOWN, IMG::type, IMG::unit, and VERBOSE.
Referenced by main().
| int test_modules | ( | IMG * | img | ) |
Testbench for module tests.
| img | img structure for testing |
Definition at line 483 of file libtpcimgio.c.
References IMG::_fileFormat, IMG_ANA, IMG_E63, IMG_E7, IMG_POLARMAP, imgGetEcat7MHeader(), ecat7_mainheader::scan_start_time, IMG::scanStart, TEST_WITH_FILENAME, and TEST_WITH_FORMAT.
Referenced by main().
| int test_polarmap | ( | ) |
Testbench for polar maps
Definition at line 424 of file libtpcimgio.c.
References imgEmpty(), imgInit(), test_create_polarmap(), and test_polarmap_io().
Referenced by main().
| int test_polarmap_io | ( | IMG * | img | ) |
Testbench for polar map images
| img | img structure for testing |
Definition at line 454 of file libtpcimgio.c.
References IMG::_fileFormat, IMG_POLARMAP, IMG_TYPE_POLARMAP, imgEmpty(), imgInit(), imgRead(), imgWrite(), and IMG::type.
Referenced by test_polarmap().
| int VERBOSE = 0 |
Definition at line 69 of file libtpcimgio.c.
Referenced by main(), and test_img_io().
1.8.3.1