Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

analyze.c File Reference

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include "include/swap.h"
#include "include/analyze.h"

Functions

int anaExists (char *dbname)
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 ()

Function Documentation

int anaExists char *  dbname  ) 
 

Check if Analyze files exist. Returns 0, if they do not, 1 if .img and .hdr do exist, and 2, if also .sif exists.

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)

int anaPrintHeader ANALYZE_DSR h,
FILE *  fp
 

Print the contents of Analyze header to specified file pointer.

Returns:
Returns 0 if ok.

int anaReadHeader char *  filename,
ANALYZE_DSR h
 

Read analyze header contents. Returns 0, if ok.

Parameters:
filename  Name of file to read (including path and extension)
h  Pointer to previously allocated header structure

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!

Parameters:
fp  File opened previously in binary mode
h  Header read previously
frame  Frame number to read
data  Pointer to image float data allocated previously

int anaWriteHeader char *  filename,
ANALYZE_DSR h
 

Write analyze header contents. header field 'little' is used to determine the required byte order. Returns 0, if ok.

Parameters:
filename  Name of file to read (including path and extension)
h  Pointer to Analyze header structure


Generated on Fri Jan 21 16:17:40 2005 for libPET by  doxygen 1.4.1