My Project
|
#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 | IMG_IO 1 |
#define | POLARMAP_IO 2 |
#define | MODULE 3 |
#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_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 IMG_IO 1 |
Serial numbers for function names.
Definition at line 48 of file libtpcimgio.c.
#define LIB_NAME "libtpcimgio" |
Copyright (c) 2004-2008 by Turku PET Centre
File: libtpcimgio.c
Purpose: methods for testing functions in the library libtpcimgio, and for printing out libtpcimgio information, such as Readme, History and build information.
NOTICE! This program should always have the same version with the library.
Version:
2005-02-22 1.0.0 Jarkko Johansson 2005-04-26 1.1.0 Jarkko Johansson 2005-08-01 1.1.1 Jarkko Johansson 2005-11-21 1.1.3 Vesa Oikonen 2005-12-12 1.1.4 Vesa Oikonen 2006-10-31 1.1.5 Vesa Oikonen 2006-12-28 1.1.6 Vesa Oikonen 2007-02-02 1.2.0 Vesa Oikonen Added basic test functions for image i/o. 2007-02-11 1.2.1 VO 2007-02-27 1.2.2 VO 2007-03-13 1.2.3 VO 2007-03-14 1.2.4 VO 2007-03-25 1.2.5 VO 2007-04-03 1.3.0 VO Added test function for polar map img i/o. 2007-17-07 Harri Merisaari Modified for optional ANSi compatibility 2007-09-10 1.3.2 VO 2007-09-10 1.3.3 VO 2007-09-11 1.3.4 VO 2007-09-12 1.3.5 VO 2008-07-07 1.3.6 VO 2008-07-11 1.3.7 VO Later: see libtpcimgiov.c. Library name.
Definition at line 45 of file libtpcimgio.c.
#define MAXVAL 100000; |
Definition at line 64 of file libtpcimgio.c.
#define MODULE 3 |
Definition at line 50 of file libtpcimgio.c.
#define POLARMAP_IO 2 |
Definition at line 49 of file libtpcimgio.c.
#define TEST_WITH_FILENAME | ( | filename, | |
desired_length, | |||
error_value | |||
) |
#define TEST_WITH_FORMAT | ( | filename, | |
desired_format, | |||
error_value | |||
) |
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 85 of file libtpcimgio.c.
References 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_create_polarmap(), test_img_io(), test_modules(), test_polarmap_io(), and VERBOSE.
void print_usage | ( | ) |
Function for printing the usage information of the libtpcimgio test program.
Definition at line 513 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 206 of file libtpcimgio.c.
References IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_STATUS_INITIALIZED, IMG_TYPE_IMAGE, imgAllocate(), IMGUNIT_KBQ_PER_ML, IMG::m, IMG::mid, IMG::planeNumber, 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 252 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 main().
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 313 of file libtpcimgio.c.
References IMG::_fileFormat, IMG_ANA, IMG_ANA_L, IMG_E63, IMG_E7, IMG_E7_2D, IMG_TYPE_IMAGE, imgAbsMax(), imgEmpty(), imgFrameMinMax(), imgInit(), imgMax(), imgMinMax(), imgRead(), imgWrite(), and IMG::type.
Referenced by main().
int test_modules | ( | IMG * | img | ) |
Testbench for module tests.
img | img structure for testing |
Definition at line 415 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_io | ( | IMG * | img | ) |
Testbench for polar map images
img | img structure for testing |
Definition at line 387 of file libtpcimgio.c.
References IMG::_fileFormat, IMG_POLARMAP, IMG_TYPE_POLARMAP, imgEmpty(), imgInit(), imgRead(), imgWrite(), and IMG::type.
Referenced by main().
int VERBOSE = 0 |
Definition at line 76 of file libtpcimgio.c.
Referenced by main().