#include "studynr.h"
Go to the source code of this file.
#define IMG_ANA 11 |
Definition at line 89 of file img.h.
Referenced by imgFormatFromFName(), imgGetAnalyzeHeader(), imgReadAnalyze(), imgReadFrame(), imgWrite(), imgWriteAnalyzeFrame(), imgWriteFrame(), test_img_io(), and test_modules().
#define IMG_ANA_L 12 /* little endian variant */ |
Definition at line 90 of file img.h.
Referenced by imgGetAnalyzeHeader(), imgReadAnalyze(), imgReadFrame(), imgSetAnalyzeHeader(), imgWrite(), imgWriteAnalyze(), imgWriteAnalyzeFrame(), imgWriteFrame(), and test_img_io().
#define IMG_E63 1 |
Definition at line 85 of file img.h.
Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), imgFormatFromFName(), imgGetEcat63Fileformat(), imgReadFrame(), imgWrite(), imgWriteEcat63Frame(), imgWriteFrame(), test_img_io(), and test_modules().
#define IMG_E7 2 |
Definition at line 86 of file img.h.
Referenced by imgFormatFromFName(), imgGetEcat7Fileformat(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgReadEcat7(), imgReadFrame(), imgWriteEcat7Frame(), imgWriteFrame(), test_img_io(), and test_modules().
#define IMG_E7_2D 3 |
Definition at line 87 of file img.h.
Referenced by imgGetEcat7Fileformat(), imgReadEcat7(), imgReadEcat7Frame(), imgReadFrame(), imgSetEcat7MHeader(), imgSetEcat7SHeader(), imgWrite(), imgWriteEcat7Frame(), imgWriteFrame(), and test_img_io().
#define IMG_ERR_CALLING 1 |
#define IMG_ERR_OK 0 |
#define IMG_ERR_OOM 2 |
#define IMG_INTERFILE 21 |
#define IMG_MICROPET 41 |
#define IMG_NIFTI_1D 31 /* dual file format */ |
#define IMG_NIFTI_1S 32 /* single file format */ |
#define IMG_POLARMAP 9 |
Definition at line 88 of file img.h.
Referenced by imgFormatFromFName(), imgGetEcat7Fileformat(), imgReadEcat7(), imgReadFrame(), imgWrite(), imgWriteEcat7Frame(), imgWriteFrame(), test_modules(), and test_polarmap_io().
#define IMG_STATUS_ERROR 3 |
Definition at line 74 of file img.h.
Referenced by imgInfo(), svolInfo(), and volInfo().
#define IMG_STATUS_INITIALIZED 1 |
Definition at line 72 of file img.h.
Referenced by ecat63ReadAllToImg(), imgEmpty(), imgGetAnalyzeHeader(), imgInfo(), imgInit(), imgRead(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadAnalyzeHeader(), imgReadEcat63FirstFrame(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadEcat7Header(), imgReadFrame(), imgReadHeader(), imgSetAnalyzeHeader(), svolEmpty(), svolInfo(), svolInit(), test_create_img(), test_create_polarmap(), volEmpty(), volInfo(), and volInit().
#define IMG_STATUS_OCCUPIED 2 |
Definition at line 73 of file img.h.
Referenced by ecat63AddImg(), ecat63ReadPlaneToImg(), ecat63WriteAllImg(), img2svol(), img2vol(), imgAbsMax(), imgAllocate(), imgDecayCorrection(), imgEmpty(), imgExtractRange(), imgFrameMinMax(), imgGetAnalyzeHeader(), imgMax(), imgMinMax(), imgReadAnalyzeFrame(), imgReadEcat63Frame(), imgReadEcat7Frame(), imgReadFrame(), imgSetAnalyzeHeader(), imgSetDecayCorrFactors(), imgSmoothMax(), imgWrite(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7(), imgWriteEcat7Frame(), imgWriteFrame(), imgWritePolarmap(), svol2img(), svolAllocate(), svolEmpty(), vol2img(), volAllocate(), volAvg(), volContents(), volEmpty(), and volMax().
#define IMG_STATUS_UNINITIALIZED 0 |
Definitions for img status
Definition at line 71 of file img.h.
Referenced by ecat63ReadPlaneToImg(), img2svol(), img2vol(), imgAllocate(), imgExtractRange(), imgInfo(), svolAllocate(), svolInfo(), volAllocate(), and volInfo().
#define IMG_TYPE_IMAGE 1 |
Definitions for image type
Definition at line 80 of file img.h.
Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63WriteAllImg(), imgGetAnalyzeHeader(), imgGetEcat63MHeader(), imgGetEcat7MHeader(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgReadAnalyze(), imgReadEcat7(), imgReadEcat7Frame(), imgSetEcat63MHeader(), imgWrite(), imgWrite2DEcat7(), imgWriteEcat63Frame(), imgWriteEcat7(), test_create_img(), and test_img_io().
#define IMG_TYPE_POLARMAP 3 |
Definition at line 82 of file img.h.
Referenced by imgGetEcat7MHeader(), imgReadEcat7(), imgReadEcat7Frame(), imgSetEcat7MHeader(), imgSetEcat7SHeader(), imgWrite(), imgWritePolarmap(), test_create_polarmap(), and test_polarmap_io().
#define IMG_TYPE_RAW 2 |
Definition at line 81 of file img.h.
Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), imgGetEcat63MHeader(), imgGetEcat7MHeader(), imgReadEcat63Header(), imgReadEcat7(), imgSetEcat63SHeader(), imgSetEcat7MHeader(), imgSetEcat7SHeader(), imgWrite(), imgWrite2DEcat7(), imgWriteEcat63Frame(), imgWriteEcat7(), and imgWriteEcat7Frame().
#define IMG_UNKNOWN 0 |
Definitions for file format
Definition at line 84 of file img.h.
Referenced by imgFormatFromFName(), imgGetEcat63Fileformat(), imgGetEcat7Fileformat(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7Header(), and imgWrite().
#define MAX_POLARMAP_NUM_RINGS 32 |
Maximum nr of rings in polar map (based on ECAT 7 polar map header)
Definition at line 116 of file img.h.
Referenced by imgCopyhdr(), imgEmpty(), imgInit(), and imgReadEcat7Header().
#define SCANNER_ADVANCE 12096 |
#define SCANNER_ECAT931 12 |
#define SCANNER_FOCUS_120 2501 |
#define SCANNER_FOCUS_220 2500 |
#define SCANNER_HRPLUS 3 |
#define SCANNER_HRRT 4 |
#define SCANNER_INVEON_DEDICATED_PET 5000 |
#define SCANNER_INVEON_MM_PET 5500 |
#define SCANNER_MICROPET2 2002 |
#define SCANNER_MR_PET_HEAD_INSERT 6000 |
#define SCANNER_MRI 5 |
#define SCANNER_PRIMATE 2000 |
#define SCANNER_RODENT 2001 |
#define SCANNER_STEVCT_CT 7 |
#define SCANNER_STEVCT_PET 6 |
#define SCANNER_TUEBINGEN_PET_MR 8000 |
#define SCANNER_UNKNOWN 0 |
anonymous enum |
Definitions for img status message
int imgAllocate | ( | IMG * | image, |
int | planes, | ||
int | rows, | ||
int | columns, | ||
int | frames | ||
) |
Allocates memory for img data. Old contents are not saved.
image | initialized image |
planes | number of allcoated planes |
rows | number of allocated rows |
columns | number of allocated columns |
frames | number of allocated frames |
Definition at line 285 of file img.c.
References IMG::_col, IMG::_header, IMG::_pln, IMG::_pxl, IMG::_row, IMG::column, IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_STATUS_OCCUPIED, IMG_STATUS_UNINITIALIZED, IMG_TEST, imgEmpty(), imgSetStatus(), IMG::m, IMG::mid, IMG::pixel, IMG::plane, IMG::planeNumber, IMG::prompts, IMG::randoms, IMG::row, IMG::sd, IMG::start, IMG::status, STATUS_FAULT, STATUS_NOMEMORY, STATUS_OK, and IMG::weight.
Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), imgAllocateWithHeader(), imgExtractRange(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadEcat63FirstFrame(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadFrame(), test_create_img(), and test_create_polarmap().
int imgAllocateWithHeader | ( | IMG * | image, |
int | planes, | ||
int | rows, | ||
int | columns, | ||
int | frames, | ||
IMG * | image_from | ||
) |
This functions just combines imgAllocate() and imgCopyhdr().
image | Pointer to IMG struct which will be allocated here |
planes | Image matrix dimensions; z |
rows | Image matrix dimensions; y |
columns | Image matrix dimensions; x |
frames | Image matrix dimensions; t |
image_from | Pointer to IMG struct where header contents will be copied from |
Definition at line 357 of file img.c.
References imgAllocate(), and imgCopyhdr().
int imgCopyhdr | ( | IMG * | image1, |
IMG * | image2 | ||
) |
Copies the header fields from one image struct to another. Does not copy memory addresses or IMG sizes. Frame times, decay correction factors etc are copied, when possible. Plane numbers are copied, when possible.
Definition at line 501 of file img.c.
References IMG::_dataType, IMG::_fileFormat, IMG::axialFOV, IMG::decayCorrected, IMG::decayCorrFactor, IMG::dimt, IMG::dimz, IMG::end, IMG::gapx, IMG::gapy, IMG::gapz, IMG_TEST, IMG::isotopeHalflife, IMG::isWeight, MAX_POLARMAP_NUM_RINGS, IMG::mid, IMG::orientation, IMG::patientID, IMG::patientName, IMG::planeNumber, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, IMG::prompts, IMG::radiopharmaceutical, IMG::randoms, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::sampleDistance, IMG::scanner, IMG::scanStart, IMG::sd, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::studyDescription, IMG::studyNr, IMG::transaxialFOV, IMG::type, IMG::unit, IMG::userProcessCode, IMG::weight, and IMG::zoom.
Referenced by imgAllocateWithHeader(), and imgExtractRange().
Free memory that is allocated for IMG.
image | image structure that has allocated memory |
Definition at line 216 of file img.c.
References IMG::_col, IMG::_dataType, IMG::_fileFormat, IMG::_header, IMG::_pln, IMG::_pxl, IMG::_row, IMG::axialFOV, IMG::column, IMG::decayCorrected, IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG::errstatus, IMG::gapx, IMG::gapy, IMG::gapz, IMG_STATUS_INITIALIZED, IMG_STATUS_OCCUPIED, IMG_TEST, imgSetStatus(), IMG::isotopeHalflife, IMG::isWeight, IMG::m, MAX_POLARMAP_NUM_RINGS, IMG::mid, IMG::orientation, IMG::patientID, IMG::patientName, IMG::pixel, IMG::plane, IMG::planeNumber, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, IMG::radiopharmaceutical, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::row, IMG::sampleDistance, IMG::scanner, IMG::scanStart, IMG::sd, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_OK, IMG::studyDescription, IMG::studyNr, IMG::transaxialFOV, IMG::type, IMG::unit, IMG::userProcessCode, IMG::weight, and IMG::zoom.
Referenced by ecat63ReadPlaneToImg(), imgAllocate(), imgExtractRange(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgReadFrame(), imgReadMinMax(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7Frame(), main(), test_img_io(), and test_polarmap_io().
int imgExtractRange | ( | IMG * | img1, |
IMG_RANGE | r, | ||
IMG * | img2 | ||
) |
Extract a smaller 4D image from inside an IMG. Any existing data is overwritten.
img1 | source image structure, 'occupied' (has allocated data) |
r | image range structure |
img2 | target image structure 'initialized' (has not allocated data) |
Definition at line 570 of file img.c.
References IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_RANGE::f1, IMG_RANGE::f2, IMG_STATUS_OCCUPIED, IMG_STATUS_UNINITIALIZED, IMG_TEST, imgAllocate(), imgCopyhdr(), imgEmpty(), imgSetStatus(), IMG::m, IMG::mid, IMG::planeNumber, IMG::prompts, IMG::randoms, IMG::sd, IMG::start, IMG::status, STATUS_FAULT, STATUS_NOMEMORY, STATUS_OK, IMG::weight, IMG_RANGE::x1, IMG_RANGE::x2, IMG_RANGE::y1, IMG_RANGE::y2, IMG_RANGE::z1, and IMG_RANGE::z2.
Prints img information to stdout; mainly for testing purposes.
image | image structure |
Definition at line 414 of file img.c.
References IMG::_dataType, IMG::_fileFormat, IMG::axialFOV, IMG::decayCorrected, IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG_STATUS_ERROR, IMG_STATUS_INITIALIZED, IMG_STATUS_UNINITIALIZED, IMG_TEST, imgUnit(), IMG::isotopeHalflife, IMG::isWeight, IMG::mid, IMG::orientation, IMG::planeNumber, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, IMG::radiopharmaceutical, IMG::sampleDistance, IMG::scanner, IMG::scanStart, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::statmsg, IMG::status, IMG::studyNr, IMG::transaxialFOV, IMG::type, IMG::unit, and IMG::zoom.
Referenced by ecat63AddImg(), imgReadAnalyzeFirstFrame(), imgReadEcat63FirstFrame(), imgReadEcat7FirstFrame(), and imgReadFrame().
Call this once before any use of IMG data.
image | target image structure |
Definition at line 163 of file img.c.
References IMG::_dataType, IMG::_fileFormat, IMG::_header, IMG::axialFOV, IMG::column, IMG::decayCorrected, IMG::decayCorrFactor, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, IMG::errstatus, IMG::gapx, IMG::gapy, IMG::gapz, IMG_STATUS_INITIALIZED, IMG_TEST, imgSetStatus(), IMG::isotopeHalflife, IMG::isWeight, IMG::m, MAX_POLARMAP_NUM_RINGS, IMG::mid, IMG::orientation, IMG::patientName, IMG::pixel, IMG::plane, IMG::planeNumber, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, IMG::prompts, IMG::radiopharmaceutical, IMG::randoms, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::row, IMG::sampleDistance, IMG::scanner, IMG::scanStart, IMG::sd, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_OK, IMG::studyNr, IMG::transaxialFOV, IMG::type, IMG::unit, IMG::weight, and IMG::zoom.
Referenced by imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgReadFrame(), imgReadMinMax(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7Frame(), main(), test_img_io(), and test_polarmap_io().
void imgSetStatus | ( | IMG * | img, |
int | status_index | ||
) |
Set the IMG image error status message pointer (statmsg) and index
img | Pointer to IMG struct where statmsg will be set |
status_index | Index of img_status_string |
Definition at line 399 of file img.c.
References IMG::errstatus, imgmsg, IMG::statmsg, and STATUS_FAULT.
Referenced by ecat63ReadAllToImg(), imgAllocate(), imgEmpty(), imgExtractRange(), imgGetAnalyzeHeader(), imgInit(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), imgReadEcat63FirstFrame(), imgReadEcat63Frame(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadEcat7Frame(), imgReadEcat7Header(), imgReadFrame(), imgReadHeader(), imgSetAnalyzeHeader(), imgWrite(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteEcat7(), imgWriteFrame(), and imgWritePolarmap().
char* imgStatus | ( | int | status_index | ) |
Return pointer to string describing the image error status message
status_index | index of img_status_string |
Definition at line 384 of file img.c.
References imgmsg, and STATUS_FAULT.
Referenced by imgRead().
int IMG_TEST |
Definition at line 128 of file img.h.
Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63WriteAllImg(), imgAllocate(), imgCopyhdr(), imgDecayCorrection(), imgEmpty(), imgExtractRange(), imgGetAnalyzeHeader(), imgInfo(), imgInit(), imgRead(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), imgReadEcat63FirstFrame(), imgReadEcat63Frame(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadEcat7Frame(), imgReadEcat7Header(), imgReadFrame(), imgReadHeader(), imgReadMinMax(), imgSetAnalyzeHeader(), imgWrite(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7(), imgWriteEcat7Frame(), imgWriteFrame(), and imgWritePolarmap().