analyzer_sparx.h
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef eman_analyzer_sparx_h__
00037 #define eman_analyzer_sparx_h__
00038
00039 #include "analyzer.h"
00040
00041 namespace EMAN
00042 {
00045 class PCAsmall : public Analyzer
00046 {
00047 public:
00048 PCAsmall() : mask(0), nvec(0) {}
00049
00050
00051
00052
00053
00054
00055 virtual int insert_image(EMData * image);
00056
00057 virtual vector<EMData*> analyze();
00058
00059 string get_name() const
00060 {
00061 return "pca";
00062 }
00063
00064 string get_desc() const
00065 {
00066 return "Principal component analysis";
00067 }
00068
00069 static Analyzer * NEW()
00070 {
00071 return new PCAsmall();
00072 }
00073
00074 void set_params(const Dict & new_params);
00075
00076
00077
00078
00079
00080
00081
00082
00083 TypeDict get_param_types() const
00084 {
00085 TypeDict d;
00086 d.put("mask", EMObject::EMDATA, "mask image");
00087 d.put("nvec", EMObject::INT, "number of desired principal components");
00088 return d;
00089 }
00090
00091 protected:
00092 EMData * mask;
00093 int nvec;
00094
00095 private:
00096 float *covmat;
00097 int ncov;
00098 int nimages;
00099 float *eigval;
00100 };
00101
00102
00103
00104 class PCAlarge : public Analyzer
00105 {
00106 public:
00107 PCAlarge() : mask(0), nvec(0) {}
00108
00109 virtual int insert_image(EMData * image);
00110
00111 virtual vector<EMData*> analyze();
00112
00113 string get_name() const
00114 {
00115 return "pca_large";
00116 }
00117
00118 string get_desc() const
00119 {
00120 return "Principal component analysis";
00121 }
00122
00123 static Analyzer * NEW()
00124 {
00125 return new PCAlarge();
00126 }
00127
00128 void set_params(const Dict & new_params);
00129
00130 int Lanczos(const string &maskedimages, int *kstep,
00131 float *diag, float *subdiag, float *V,
00132 float *beta);
00133
00134
00135 TypeDict get_param_types() const
00136 {
00137 TypeDict d;
00138 d.put("mask", EMObject::EMDATA, "mask image");
00139 d.put("nvec", EMObject::INT, "number of desired principal components");
00140 return d;
00141 }
00142
00143 protected:
00144 EMData * mask;
00145 int nvec;
00146
00147 private:
00148 int ncov;
00149 int nimages;
00150 float *eigval;
00151 };
00152
00153 class varimax : public Analyzer
00154 {
00155 public:
00156 varimax() : m_mask(NULL) {}
00157
00158 virtual int insert_image(EMData * image);
00159
00160 virtual vector<EMData*> analyze();
00161
00162 string get_name() const
00163 {
00164 return "varimax";
00165 }
00166
00167 string get_desc() const
00168 {
00169 return "varimax rotation of PCA results";
00170 }
00171
00172 static Analyzer * NEW()
00173 {
00174 return new varimax();
00175 }
00176
00177 virtual void set_params(const Dict & new_params);
00178
00179 TypeDict get_param_types() const
00180 {
00181 TypeDict d;
00182 d.put("mask", EMObject::EMDATA, "mask image");
00183 return d;
00184 }
00185
00186 private:
00187 int m_nlen;
00188 int m_nfac;
00189 EMData *m_mask;
00190 vector<float> m_data;
00191 };
00192 }
00193
00194 #endif //eman_analyzer_sparx_h__