00001 #include "vuSphVwFlt_Fourier.h"
00002 #include "vuFourier/vuFourierFilter/vuTorstensFourierFilter.h"
00003
00004 template <int S, class T>
00005 vuSphVwFlt_Fourier<S,T>::vuSphVwFlt_Fourier(const vuString& filterName)
00006 : vuSphericViewFilter<S,T>(filterName)
00007 {
00008 }
00009
00010 template <int S, class T>
00011 void vuSphVwFlt_Fourier<S,T>::preprocess(vuProgressHandler *handler)
00012 {
00013 if (m_NumberOfViews > 0) {
00014 m_Volume.preprocess(m_NumberOfViews, m_Views, handler);
00015 ensureImage(m_Volume.getImageWidth(), m_Volume.getImageHeight());
00016 }
00017 else {
00018 cerr << "WARNING: vuSphVwFlt_Fourier::preprocess: no views set." << endl;
00019 }
00020 }
00021
00022 template <int S, class T>
00023 void vuSphVwFlt_Fourier<S,T>::filter(vuCamera *camera)
00024 {
00025 if (m_Volume.isPreprocessed()) {
00026 m_Volume.setCamera(camera);
00027 m_Volume.computeSlice();
00028
00029 }
00030 }
00031
00032
00033
00034 template <int S, class T>
00035 void vuSphVwFlt_Fourier<S,T>::setFourierFilter(vuFourierFilter *filter)
00036 {
00037 m_Volume.setFilter(filter);
00038 }
00039
00040 template <int S, class T>
00041 void vuSphVwFlt_Fourier<S,T>::setSliceFilter(vuSliceFilter *filter)
00042 {
00043 m_Volume.setSliceFilter(filter);
00044 }
00045
00046 template <int S, class T>
00047 void vuSphVwFlt_Fourier<S,T>::computeUnscaledImage(vuCamera *camera,
00048 vuFixelMap<S,float>* &image,
00049 float &minVal,
00050 float &maxVal,
00051 word method)
00052 {
00053 m_Volume.setCamera(camera);
00054 m_Volume.computeUnscaledImage(image, minVal, maxVal, method);
00055 }
00056
00057 template <int S, class T>
00058 void vuSphVwFlt_Fourier<S,T>::computeUnscaledImage(vuCamera *camera,
00059 vuFixelMap<S,float>* &image,
00060 word method)
00061 {
00062 float minVal, maxVal;
00063 m_Volume.setCamera(camera);
00064 m_Volume.computeUnscaledImage(image, minVal, maxVal, method);
00065 }
00066
00067 template <int S, class T>
00068 bool vuSphVwFlt_Fourier<S,T>::isPreparedForInteractive()
00069 {
00070 return m_Volume.isPreparedForInteractive();
00071 }
00072
00073 template <int S, class T>
00074 void vuSphVwFlt_Fourier<S,T>::setNoInteractiveMode()
00075 {
00076 m_Volume.setNoInteractiveMode();
00077 }
00078
00079 template <int S, class T>
00080 bool vuSphVwFlt_Fourier<S,T>::writeFourierToFile(const char *fileName,
00081 vuProgressHandler *handler)
00082 {
00083 return m_Volume.writeFourierToFile(fileName, handler);
00084 }
00085
00086 template <int S, class T>
00087 bool vuSphVwFlt_Fourier<S,T>::writeSpatialVolume(const char *fileName,
00088 vuProgressHandler *handler)
00089 {
00090 return m_Volume.writeSpatialVolume(fileName, handler);
00091 }
00092
00093 template <int S, class T>
00094 void vuSphVwFlt_Fourier<S,T>::prepareForInteractive(dword width, dword height)
00095 {
00096 m_Volume.prepareForInteractive(width, height);
00097 }
00098
00099 template <int S, class T>
00100 void vuSphVwFlt_Fourier<S,T>::addViewWithIndexToVolume(dword idx)
00101 {
00102 #if 0
00103 vuSphericView1B *view = NULL;
00104
00105 cerr << "addViewWithIndex---- tralalalala" << endl;
00106 if (S == 1) {
00107 if (vuFixelType<T>::isByte()) view = (vuSphericView1B*)m_Views[idx];
00108 }
00109 else {
00110
00111 }
00112
00113 if (view != NULL) {
00114 for (int i=0; i<S; i++) m_Volume.addView(view);
00115 }
00116 else {
00117 cerr << "WARNING: vuSphVwFlt_Fourier::addViewWithIndexToVolume(): "
00118 << "case not implemented." << endl;
00119 }
00120 #endif
00121 }