00001 #ifndef _Volume_Regular_Unimodal_SimpleFVR_vuFourierVolume_IO_H_
00002 #define _Volume_Regular_Unimodal_SimpleFVR_vuFourierVolume_IO_H_
00003
00004 #include "../intensity.h"
00005 #include "General/vuFourier/vuFourierVolume.h"
00006
00007 template <int S>
00008 class vuFourierVolume_IO : public vuFourierVolume<S>
00009 {
00010 protected:
00011 using vuFourierVolume<S>::m_Volume;
00012 using vuFourierVolume<S>::m_XSize;
00013 using vuFourierVolume<S>::m_YSize;
00014 using vuFourierVolume<S>::m_ZSize;
00015 using vuFourierVolume<S>::m_Wrap;
00016 public:
00017 using vuFourierVolume<S>::computeDimensions;
00018 using vuFourierVolume<S>::setWrap;
00019 using vuFourierVolume<S>::wrapAndInitialize;
00020 public:
00021 virtual ~vuFourierVolume_IO() {};
00023 bool scaleAndWriteToFourierFile(const char *fileName, float scale);
00024
00027 bool preprocessSpatialInput(byte *data,
00028 dword XSize, dword YSize, dword ZSize,
00029 float s=1.0,
00030 float mult_pad=M_SQRT2,
00031 dword add_pad=0,
00032 bool doWrapAndInit=true);
00033
00034 void preprocess();
00035 static void transform3D(float* data, dword xx, dword yy, dword zz);
00036 static void inverseTransform3D(float* vol, dword xx, dword yy, dword zz);
00037 static void shift3D(float* data, dword XSize, dword YSize, dword ZSize);
00038 static float* pad(float* v, dword n);
00039
00040
00041
00042 static void readSpatial(byte *in, float* out,
00043 dword XX, dword YY, dword ZZ,
00044 dword XXsmall, dword YYsmall, dword ZZsmall);
00045
00046 static bool getSpatialDataFromVUF(byte *&volume, dword &XSize,
00047 dword &YSize, dword &ZSize,
00048 float scale, vuString fileName);
00049
00050
00051
00052 static void padFourier(float *in, float* out,
00053 dword XX, dword YY, dword ZZ,
00054 dword XXsmall, dword YYsmall, dword ZZsmall);
00055 };
00056
00057 template class vuFourierVolume_IO<1>;
00058 template class vuFourierVolume_IO<2>;
00059 template class vuFourierVolume_IO<3>;
00060
00061 #endif