00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MIVIEWVIEW_H
00019 #define MIVIEWVIEW_H
00020
00021 #include <odinqt/jdxwidget.h>
00022
00023
00024 #include <odinpara/odinpara.h>
00025 #include <odinpara/jdxnumbers.h>
00026 #include <odinpara/jdxarrays.h>
00027 #include <odinpara/jdxblock.h>
00028
00029
00030 #include "miview_fmri.h"
00031
00032
00033 class Protocol;
00034 struct FileData;
00035 struct SelectionData;
00036
00038
00039
00040 class MiViewComp {
00041 public:
00042 static const char* get_compName();
00043 };
00044
00046
00047 struct MiViewOpts : JcampDxBlock {
00048
00049 JDXbool color;
00050 JDXfloat contrast;
00051 JDXfloat brightness;
00052 JDXstring valfile;
00053 JDXstring recfile;
00054 JDXint blowup;
00055 JDXstring low;
00056 JDXstring upp;
00057 JDXstring dump;
00058 JDXstring mapfile;
00059 JDXfloat maplow;
00060 JDXfloat mapupp;
00061 JDXfloat maprect;
00062 JDXstring maplegendexport;
00063 JDXbool noscale;
00064
00065 MiViewOpts();
00066 };
00067
00069
00070 class MiViewView : public QWidget {
00071 Q_OBJECT
00072
00073 public:
00074 MiViewView(QWidget *parent);
00075 ~MiViewView();
00076
00077
00078 static void set_defaults(Protocol& prot);
00079 static void usage();
00080
00081 bool is_image_display() const {return (get_nx()*get_ny())>1;}
00082 bool has_timecourse() const {return get_nrep()>1;}
00083 bool has_fmri() const {return fmri.is_valid();}
00084 bool has_overlay() const {return has_olm;}
00085
00086 signals:
00087
00088 void setMessage(const char* text);
00089
00090
00091 public slots:
00092
00093 void writeImage();
00094 void writeROIs();
00095 void writeFmriClusters();
00096 void writeProfile();
00097 void writeTimecourse();
00098 void writeLegend();
00099
00100 void selectVoxel();
00101 void showProfile();
00102 void showTimecourse();
00103 void showProtocol();
00104
00105
00106 private slots:
00107
00108 void update();
00109
00110 void slotClicked(int x, int y, int z);
00111 void slotNewProfile(const float *data, int npts, bool horizontal, int position);
00112 void slotNewMask(const float *data, int slice);
00113
00114
00115 private:
00116
00117 int get_nx() const;
00118 int get_ny() const;
00119 int get_nz() const;
00120 int get_nrep() const;
00121
00122 void filedata2displaydata();
00123
00124 STD_string check_and_get_format(const STD_string& fname, const svector& possible_formats);
00125
00126 void exportLegend(const STD_string& filename);
00127
00128 void val2file(int rep, int z, int y, int x, float val) const;
00129
00130
00131 MiViewOpts mopts;
00132
00133 bool has_bounds;
00134 float lowbound;
00135 float uppbound;
00136
00137
00138 FileData* file;
00139
00140 JDXfloatArr displaydata;
00141 GuiProps guiprops_cache;
00142 JcampDxBlock settings;
00143 JDXint repetition;
00144 JDXfloatArr timecourse;
00145
00146 bool has_olm;
00147
00148
00149 SelectionData* selection;
00150
00151 GuiGridLayout* grid;
00152 JDXwidget* displaywidget;
00153 JDXwidget* settingswidget;
00154 JDXwidget* tcoursewidget;
00155 JDXwidget* fmriwidget;
00156
00157 STD_string image_fname_cache;
00158 STD_string rois_fname_cache;
00159 STD_string clusters_fname_cache;
00160 STD_string profile_fname_cache;
00161 STD_string tcourse_fname_cache;
00162
00163 JDXint pos_cache[n_directions];
00164
00165
00166
00167 MiViewFmri fmri;
00168
00169
00170 };
00171
00172
00173 #endif