TPCCLIB
|
Basic tools for working with IMG data struct. More...
#include "libtpcimgio.h"
Go to the source code of this file.
Functions | |
void | imgInit (IMG *image) |
void | imgEmpty (IMG *image) |
int | imgAllocate (IMG *image, int planes, int rows, int columns, int frames) |
int | imgAllocateWithHeader (IMG *image, int planes, int rows, int columns, int frames, IMG *image_from) |
int | imgDup (IMG *img1, IMG *img2) |
char * | imgStatus (int status_index) |
void | imgSetStatus (IMG *img, int status_index) |
void | imgInfo (IMG *image) |
int | imgCopyhdr (IMG *image1, IMG *image2) |
int | imgExtractRange (IMG *img1, IMG_RANGE r, IMG *img2) |
int | imgExistentTimes (IMG *img) |
int | imgExistentCounts (IMG *img) |
unsigned long long | imgNaNs (IMG *img, int fix) |
Variables | |
int | IMG_TEST |
int imgAllocate | ( | IMG * | image, |
int | planes, | ||
int | rows, | ||
int | columns, | ||
int | frames ) |
Allocates memory for img data. Old contents are not saved.
image | Pointer to initialized image struct; old contents are deleted. |
planes | Nr of image planes (dim z) to allocate. |
rows | Nr of image rows (dim y) to allocate. |
columns | Nr of image columns (dim x) to allocate. |
frames | Nr of image time frames (dim t) to allocate. |
Definition at line 194 of file img.c.
Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), img2cube(), img_k1_using_ki(), imgAllocateWithHeader(), imgAUMC(), imgExtractRange(), imgFBP(), imgGetFrameDiff(), imgGetFrameDyn(), imgGetMaxFrame(), imgGetMaxTime(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgMRP(), imgMRT(), imgOutlierFilter(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadEcat63FirstFrame(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadFrame(), imgReadMicropetFirstFrame(), imgReadNifti(), imgReadNiftiFirstFrame(), imgReprojection(), imgStructuringElement(), imgThresholdingLowHigh(), and imgThresholdMaskCount().
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 279 of file img.c.
Referenced by img_logan(), img_patlak(), imgDup(), imgFlipAbove(), imgFlipRight(), imgFrameIntegral(), imgMeanZ(), imgNoiseTemplate(), imgPVCRRL(), imgPVCRVC(), imgsegmSimilar(), imgsegmThresholdMask(), imgShrink(), imgSwell(), and imgTimeIntegral().
Copy 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 471 of file img.c.
Referenced by img2cube(), img_k1_using_ki(), imgAllocateWithHeader(), imgAUMC(), imgExtractRange(), imgGetFrameDiff(), imgGetFrameDyn(), imgGetMaxFrame(), imgGetMaxTime(), imgMRT(), imgThresholdingLowHigh(), and imgThresholdMaskCount().
Duplicate IMG struct. Any existing contents in img2 will be deleted.
img1 | Pointer to IMG struct which will be duplicated |
img2 | Pointer to initiated IMG struct into which the duplicate will be made |
Definition at line 304 of file img.c.
Referenced by imgFlipAbove(), imgFlipRight(), imgMaskDilate(), imgMaskErode(), and imgMeanZ().
void imgEmpty | ( | IMG * | image | ) |
Free memory that is allocated for IMG.
image | Pointer to IMG struct |
Definition at line 121 of file img.c.
Referenced by ecat63ReadPlaneToImg(), img2cube(), img_k1_using_ki(), img_logan(), img_patlak(), imgAllocate(), imgAnalyzeToEcat(), imgAUMC(), imgDup(), imgExtractRange(), imgFBP(), imgFlipAbove(), imgFlipRight(), imgFormatDetermine(), imgFrameIntegral(), imgGetFrameDiff(), imgGetFrameDyn(), imgGetMaxFrame(), imgGetMaxTime(), imgMaskDilate(), imgMaskErode(), imgMaskRegionLabeling(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgMRP(), imgMRT(), imgNiftiToEcat(), imgOutlierFilter(), imgPVCRRL(), imgPVCRVC(), imgReadFrame(), imgReadMicropet(), imgReadMinMax(), imgReadModelingData(), imgReprojection(), imgsegmSimilar(), imgStructuringElement(), imgThresholding(), imgThresholdingLowHigh(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7Frame(), and imgWriteNiftiFrame().
int imgExistentCounts | ( | IMG * | img | ) |
Verify that IMG contains prompts and randoms.
img | Pointer to IMG struct |
Definition at line 630 of file img.c.
Referenced by img2sif().
int imgExistentTimes | ( | IMG * | img | ) |
Verify that IMG contains frame times.
img | Pointer to IMG struct. |
Definition at line 613 of file img.c.
Referenced by img2sif(), imgAUMC(), imgFrameIntegral(), imgMRT(), imgNoiseTemplate(), and imgReadModelingData().
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 548 of file img.c.
void imgInfo | ( | IMG * | image | ) |
Prints img information to stdout; mainly for testing purposes.
image | Pointer to IMG data. |
Definition at line 359 of file img.c.
Referenced by ecat63AddImg(), img_k1_using_ki(), img_logan(), img_patlak(), imgAnalyzeToEcat(), imgNiftiToEcat(), imgReadAnalyzeFirstFrame(), imgReadEcat63FirstFrame(), imgReadEcat7FirstFrame(), imgReadFrame(), imgReadMicropetFirstFrame(), imgReadNifti(), and imgReadNiftiFirstFrame().
void imgInit | ( | IMG * | image | ) |
Call this once before any use of IMG data.
image | Pointer to IMG struct. |
Definition at line 60 of file img.c.
Referenced by imgAnalyzeToEcat(), imgFlipAbove(), imgFlipRight(), imgFormatDetermine(), imgMaskDilate(), imgMaskErode(), imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), imgNiftiToEcat(), imgOutlierFilter(), imgPVCRRL(), imgPVCRVC(), imgReadFrame(), imgReadMinMax(), imgReadModelingData(), imgsegmSimilar(), imgThresholding(), imgThresholdingLowHigh(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7Frame(), and imgWriteNiftiFrame().
unsigned long long imgNaNs | ( | IMG * | img, |
int | fix ) |
Searches the image data for missing pixel values, optionally setting those to zero.
img | Pointer to IMG structure. |
fix | Set (1) or do not set (0) missing pixels to zero. |
Definition at line 658 of file img.c.
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 345 of file img.c.
Referenced by ecat63ReadAllToImg(), imgAllocate(), imgEmpty(), imgExtractRange(), imgGetAnalyzeHeader(), imgGetMicropetHeader(), imgGetNiftiHeader(), imgInit(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), imgReadEcat63FirstFrame(), imgReadEcat63Frame(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadEcat7Frame(), imgReadEcat7Header(), imgReadFrame(), imgReadHeader(), imgReadMicropet(), imgReadMicropetFirstFrame(), imgReadMicropetFrame(), imgReadMicropetHeader(), imgReadNifti(), imgReadNiftiFirstFrame(), imgReadNiftiFrame(), imgReadNiftiHeader(), imgSetAnalyzeHeader(), imgTimeIntegral(), imgWrite(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteEcat7(), imgWriteFrame(), imgWriteNifti(), imgWriteNiftiFrame(), 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 330 of file img.c.
Referenced by ecatFixMatrixlist(), imgRead(), and imgWriteNifti().
int IMG_TEST |
Verbose printing from IMG functions
Definition at line 6 of file img.c.
Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63WriteAllImg(), img2cube(), imgAllocate(), imgCopyhdr(), imgDecayCorrection(), imgDeleteFrameOverlap(), imgDeleteFrameOverlap_old(), imgEmpty(), imgExtractRange(), imgFormatFromFName(), imgGetAnalyzeHeader(), imgGetEcat63MHeader(), imgInfo(), imgInit(), imgRead(), imgReadAnalyze(), imgReadAnalyzeFirstFrame(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), imgReadEcat63FirstFrame(), imgReadEcat63Frame(), imgReadEcat63Header(), imgReadEcat7(), imgReadEcat7FirstFrame(), imgReadEcat7Frame(), imgReadEcat7Header(), imgReadFrame(), imgReadHeader(), imgReadMicropet(), imgReadMicropetFirstFrame(), imgReadMicropetFrame(), imgReadMicropetHeader(), imgReadMinMax(), imgSetAnalyzeHeader(), imgSetEcat63MHeader(), imgSmoothOverFrames(), imgWrite(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteAnalyzeFrame(), imgWriteEcat63Frame(), imgWriteEcat7(), imgWriteEcat7Frame(), imgWriteFrame(), and imgWritePolarmap().