Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuFourier_IO.h

Go to the documentation of this file.
00001 #ifndef _VU_FOURIER_IO_H_
00002 #define _VU_FOURIER_IO_H_
00003 // set of functions to work on raw, pvp and fvr files
00004 // need to add some checks to see if things worked and handle white space better
00005 
00006 #include <iostream.h>
00007 #include <fstream.h>
00008 #include "vuSimpleTypes.h"
00009 
00010 #define MAGIC_NUM_LEN   128
00011 
00012 class vuFourier_IO
00013 {
00014  public:
00015   // read XSize x YSize x ZSize integers with d_size bytes from fin to vol
00016   // converts to floats and assumes vol is size X, Y, Z
00017   static  void read_raw(ifstream& fin, float* vol, dword X, dword Y, dword Z,
00018                         dword XSize, dword YSize, dword ZSize, dword d_size);
00019 
00020   // same as above, but read data members in raw
00021   static void read_raw_r(ifstream& fin, byte* vol, dword X, dword Y, dword Z,
00022                          dword XSize, dword YSize, dword ZSize, dword d_size);
00023 
00024   static void vuFourier_IO::read_raw_r_fast(ifstream& fin, byte* vol, dword X,
00025                                             dword Y, dword Z, dword XSize,
00026                                             dword YSize, dword ZSize,
00027                                             dword d_size);
00028 
00029   // read pvp or fvr header; return 0 on fail, 1 if pvp, 2 if fvr
00030   static int read_head(ifstream& in, dword& XSize, dword& YSize, dword& ZSize,
00031                        dword& b_size);
00032 
00033   static bool write_pvp_head(ofstream& fout, dword XSize, dword YSize,
00034                              dword ZSize, dword b_size);
00035 
00036   static bool write_fvr_head(ofstream& fout, dword XSize, dword YSize,
00037                              dword ZSize, dword b_size);
00038 
00039 
00040   // apply padding, but no wrapping!!!
00041   static void readSpatial(byte *in, float* out, dword X, dword Y, dword Z,
00042                           dword XSize, dword YSize, dword ZSize);
00043 
00044   // wrapping the fourier volume
00045  static void wrapFourier(float *in, float *out,dword X, dword Y, dword Z,
00046                          dword XSize, dword YSize, dword ZSize);
00047 
00048 
00049 
00050  static float* pad(float* v, dword n);
00051  static byte*  pad_r(byte* v, dword n);
00052  static dword  readNumber(ifstream& fin);
00053  static void   writeNumber(ofstream& fout, dword n);
00054 };
00055 
00056 #endif

Generated on Wed Dec 15 21:20:34 2004 for vuVolume by  doxygen 1.3.9.1