#include <analyzer_sparx.h>
Inheritance diagram for EMAN::varimax:
Public Member Functions | |
varimax () | |
virtual int | insert_image (EMData *image) |
insert a image to the list of input images | |
virtual vector< EMData * > | analyze () |
main function for Analyzer, analyze input images and create output images | |
string | get_name () const |
Get the Analyzer's name. | |
string | get_desc () const |
Get the Analyzer's description. | |
virtual void | set_params (const Dict &new_params) |
Set the Analyzer parameters using a key/value dictionary. | |
TypeDict | get_param_types () const |
Get Analyzer parameter information in a dictionary. | |
Static Public Member Functions | |
Analyzer * | NEW () |
Static Public Attributes | |
const string | NAME = "varimax" |
Private Attributes | |
int | m_nlen |
int | m_nfac |
EMData * | m_mask |
vector< float > | m_data |
|
Definition at line 160 of file analyzer_sparx.h. 00160 : m_mask(NULL) {}
|
|
main function for Analyzer, analyze input images and create output images
Implements EMAN::Analyzer. Definition at line 693 of file analyzer.cpp. References EMDeletePtr(), EMAN::EMData::get_data(), images, imgdata, IVARIMAX, m_data, m_mask, m_nfac, m_nlen, reconstitute_image_mask(), EMAN::EMData::set_size(), and varmx(). 00694 { 00695 int itmax = 10000; 00696 float eps = 1e-4f; 00697 int verbose = 1; 00698 float params[4]; 00699 params[0] = 1.0; 00700 varmx( &m_data[0], m_nlen, m_nfac, IVARIMAX, params, NULL, itmax, eps, verbose); 00701 00702 vector<EMData*> images; 00703 00704 EMData* img1d = new EMData(); 00705 img1d->set_size(m_nlen, 1, 1); 00706 for( int i=0; i < m_nfac; ++i ) 00707 { 00708 float* imgdata = img1d->get_data(); 00709 00710 int offset = i * m_nlen; 00711 for( int i=0; i < m_nlen; ++i ) 00712 { 00713 imgdata[i] = m_data[offset+i]; 00714 } 00715 00716 EMData* img = Util::reconstitute_image_mask(img1d,m_mask); 00717 images.push_back(img); 00718 } 00719 00720 EMDeletePtr(img1d); 00721 00722 return images; 00723 }
|
|
Get the Analyzer's description.
Implements EMAN::Analyzer. Definition at line 171 of file analyzer_sparx.h. 00172 { 00173 return "varimax rotation of PCA results"; 00174 }
|
|
Get the Analyzer's name. Each Analyzer is identified by a unique name.
Implements EMAN::Analyzer. Definition at line 166 of file analyzer_sparx.h. 00167 {
00168 return NAME;
00169 }
|
|
Get Analyzer parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Implements EMAN::Analyzer. Definition at line 183 of file analyzer_sparx.h. References EMAN::TypeDict::put(). 00184 { 00185 TypeDict d; 00186 d.put("mask", EMObject::EMDATA, "mask image"); 00187 return d; 00188 }
|
|
insert a image to the list of input images
Implements EMAN::Analyzer. Definition at line 677 of file analyzer.cpp. References Assert, compress_image_mask(), EMAN::EMData::get_data(), m_data, m_mask, m_nfac, and NullPointerException. 00678 { 00679 if(m_mask==0) 00680 throw NullPointerException("Null mask image pointer, set_params() first"); 00681 00682 EMData* img1d = Util::compress_image_mask(image,m_mask); 00683 00684 m_data.insert( m_data.end(), img1d->get_data(), img1d->get_data() + m_nlen ); 00685 00686 m_nfac++; 00687 00688 Assert( (int)m_data.size() == m_nfac*m_nlen); 00689 00690 return 0; 00691 }
|
|
Definition at line 176 of file analyzer_sparx.h. 00177 { 00178 return new varimax(); 00179 }
|
|
Set the Analyzer parameters using a key/value dictionary.
Reimplemented from EMAN::Analyzer. Definition at line 653 of file analyzer.cpp. References compress_image_mask(), EMDeletePtr(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), m_mask, m_nfac, m_nlen, nx, ny, and EMAN::EMData::set_size(). 00654 { 00655 params = new_params; 00656 m_mask = params["mask"]; 00657 00658 // count the number of pixels under the mask 00659 // (this is really ugly!!!) 00660 EMData *dummy = new EMData(); 00661 00662 int nx = m_mask->get_xsize(); 00663 int ny = m_mask->get_ysize(); 00664 int nz = m_mask->get_zsize(); 00665 00666 dummy->set_size(nx,ny,nz); 00667 00668 EMData *dummy1d = Util::compress_image_mask(dummy,m_mask); 00669 00670 m_nlen = dummy1d->get_xsize(); 00671 m_nfac = 0; 00672 00673 EMDeletePtr(dummy); 00674 EMDeletePtr(dummy1d); 00675 }
|
|
Definition at line 196 of file analyzer_sparx.h. Referenced by analyze(), and insert_image(). |
|
Definition at line 195 of file analyzer_sparx.h. Referenced by analyze(), insert_image(), and set_params(). |
|
Definition at line 194 of file analyzer_sparx.h. Referenced by analyze(), insert_image(), and set_params(). |
|
Definition at line 193 of file analyzer_sparx.h. Referenced by analyze(), and set_params(). |
|
Definition at line 53 of file analyzer.cpp. |