|
TPCCLIB
|
IO for Analyze 7.5 image files. More...
#include "libtpcimgio.h"Go to the source code of this file.
Functions | |
| int | anaExists (const char *dbname) |
| int | anaExistsNew (const char *filename, char *hdrfile, char *imgfile, char *siffile) |
| int | anaReadHeader (char *filename, ANALYZE_DSR *h) |
| int | anaWriteHeader (char *filename, ANALYZE_DSR *h) |
| int | anaPrintHeader (ANALYZE_DSR *h, FILE *fp) |
| int | anaReadImagedata (FILE *fp, ANALYZE_DSR *h, int frame, float *data) |
| int | anaFlipping () |
| int | anaRemove (const char *dbname) |
| void | anaRemoveFNameExtension (char *fname) |
| int | anaDatabaseExists (const char *dbname, char *hdrfile, char *imgfile, char *siffile) |
| int | anaMakeSIFName (const char *dbname, char *siffile) |
| int | anaEditHeader (ANALYZE_DSR *h, char *field, char *value) |
Variables | |
| int | ANALYZE_TEST |
IO for Analyze 7.5 image files.
Procedures in this file are not dependent on IMG struct.
Definition in file analyze.c.
| int anaDatabaseExists | ( | const char * | dbname, |
| char * | hdrfile, | ||
| char * | imgfile, | ||
| char * | siffile ) |
Check if Analyze database files exist (*.hdr, *.img, and optionally *.sif).
| dbname | analyze database name that is tested. String may contain standard extensions .hdr, .img or .sif |
| hdrfile | pointer to an allocated string, where existing header filename is written. If not found, then set to "". NULL can be entered, if not needed. |
| imgfile | pointer to an allocated string, where existing image filename is written. If not found, then set to "". NULL can be entered, if not needed. |
| siffile | pointer to an allocated string, where existing sif filename is written. If not found, then set to "". NULL can be entered, if not needed. |
Definition at line 704 of file analyze.c.
Referenced by anaRemove(), imgFormatDetermine(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), and imgWriteAnalyzeFrame().
| int anaEditHeader | ( | ANALYZE_DSR * | h, |
| char * | field, | ||
| char * | value ) |
Edits Analyze 7.5 header.
| h | Pointer to Analyze header struct. |
| field | Header field name. |
| value | New value for the header field. |
Definition at line 783 of file analyze.c.
| int anaExists | ( | const char * | dbname | ) |
Check if Analyze files exist.
| dbname | basename of Analyze 7.5 file. |
Definition at line 20 of file analyze.c.
| int anaExistsNew | ( | const char * | filename, |
| char * | hdrfile, | ||
| char * | imgfile, | ||
| char * | siffile ) |
Check if specified filename is a Analyze file.
| filename | Filename, either header file, image file, or base name without extensions. this string is never modified. |
| hdrfile | If filename refers to a Analyze file, then header filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
| imgfile | If filename refers to a Analyze file, then image filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
| siffile | If filename refers to a Analyze file, and if SIF exists, then SIF filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
Definition at line 45 of file analyze.c.
Referenced by imgRead(), and imgReadAnalyze().
| int anaFlipping | ( | ) |
Check whether Analyze image is flipped in z-direction when it is read from/written to file (x,y-flipping is done always).
Definition at line 635 of file analyze.c.
Referenced by imgAnalyzeToEcat(), imgReadAnalyze(), imgReadAnalyzeFrame(), imgWriteAnalyze(), and imgWriteAnalyzeFrame().
| int anaMakeSIFName | ( | const char * | dbname, |
| char * | siffile ) |
Make SIF filename from Analyze 7.5 database name.
| dbname | Analyze 7.5 database name (including possible path but not extension. |
| siffile | Pointer to allocated space for SIF filename. |
Definition at line 763 of file analyze.c.
Referenced by anaDatabaseExists().
| int anaPrintHeader | ( | ANALYZE_DSR * | h, |
| FILE * | fp ) |
Print the contents of Analyze header to specified file pointer.
| h | Pointer to Analyze header structure. |
| fp | Output file pointer. |
Definition at line 380 of file analyze.c.
Referenced by imgReadAnalyze().
| int anaReadHeader | ( | char * | filename, |
| ANALYZE_DSR * | h ) |
Read analyze header contents.
| filename | Name of file to read (including path and extension). |
| h | Pointer to previously allocated header structure. |
Definition at line 131 of file analyze.c.
Referenced by anaExistsNew(), imgReadAnalyze(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), and imgWriteAnalyzeFrame().
| int anaReadImagedata | ( | FILE * | fp, |
| ANALYZE_DSR * | h, | ||
| int | frame, | ||
| float * | data ) |
Read Analyze 7.5 image data, convert byte order if necessary, and scale values to floats. Reads only one frame at a time!
| fp | File, opened previously in binary mode. |
| h | Analyze header, read previously. |
| frame | Frame number to read [1..number of frames]. |
| data | Pointer to image float data allocated previously. |
Definition at line 454 of file analyze.c.
Referenced by imgReadAnalyze(), and imgReadAnalyzeFrame().
| int anaRemove | ( | const char * | dbname | ) |
Remove header and data files belonging to specified Analyze 7.5 database. SIF is not deleted in any case.
| dbname | Analyze database name. |
Definition at line 666 of file analyze.c.
| void anaRemoveFNameExtension | ( | char * | fname | ) |
Check if Analyze 7.5 filename was given accidentally with extension. Remove the extension if necessary.
| fname | Full name of file. |
Definition at line 687 of file analyze.c.
Referenced by anaDatabaseExists(), and imgRead().
| int anaWriteHeader | ( | char * | filename, |
| ANALYZE_DSR * | h ) |
Write Analyze header contents. Header field 'little' is used to determine the required byte order.
| filename | Name of file to read (including path and extension) |
| h | Pointer to Analyze header structure |
Definition at line 282 of file analyze.c.
Referenced by imgWriteAnalyze(), and imgWriteAnalyzeFrame().
| int ANALYZE_TEST |
Verbose prints from Analyze functions
Definition at line 8 of file analyze.c.
Referenced by anaDatabaseExists(), anaExistsNew(), anaFlipping(), anaReadHeader(), anaReadImagedata(), anaRemove(), and anaWriteHeader().