9 #ifndef IMPCNMULTIFIT_CN_SYMM_AXIS_DETECTOR_H
10 #define IMPCNMULTIFIT_CN_SYMM_AXIS_DETECTOR_H
18 #include <IMP/cnmultifit/cnmultifit_config.h>
20 IMPCNMULTIFIT_BEGIN_NAMESPACE
22 class IMPCNMULTIFITEXPORT CnSymmAxisDetector {
24 CnSymmAxisDetector(
int symm_deg, em::DensityMap *dmap,
25 float density_threshold,
float top_p=0.8);
27 CnSymmAxisDetector(
int symm_deg,
const atom::Hierarchies &mhs);
29 algebra::PrincipalComponentAnalysis get_pca()
const {
return pca_;}
30 float calc_symm_score(
int symm_axis_ind)
const;
32 int get_symmetry_axis_index()
const;
33 int get_non_symmetry_axis_length()
const{
34 int symm_axis_ind=get_symmetry_axis_index();
36 if(symm_axis_ind == 0 || symm_axis_ind == 2) {
41 return std::sqrt(pca_.get_principal_value(non_ind));
43 void show(std::ostream& out=std::cout)
const {
44 out<<
"symm degree:"<<symm_deg_<<std::endl;
45 out<<
"symm axis:"<<get_symmetry_axis_index()<<std::endl;
52 OwnerPointer<em::DensityMap> dmap_;
53 algebra::PrincipalComponentAnalysis pca_;
55 algebra::Transformation3D to_native_,from_native_;
60 IMPCNMULTIFIT_END_NAMESPACE