diff --git a/.gitignore b/.gitignore index 87136e97a2..4f259a3bbd 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ CMakeLists.txt.user # Python package meta info Python/DatasetUtilsPackage/DatasetUtils.egg-info Examples/Python/shapeworksPortalLogin.txt +*.egg-info __pycache__/ diff --git a/Studio/src/Analysis/AnalysisTool.cpp b/Studio/src/Analysis/AnalysisTool.cpp index c6839b63e1..b82a2630a0 100644 --- a/Studio/src/Analysis/AnalysisTool.cpp +++ b/Studio/src/Analysis/AnalysisTool.cpp @@ -33,7 +33,6 @@ const std::string AnalysisTool::MODE_PCA_C("pca"); const std::string AnalysisTool::MODE_MCA_C("mca"); const std::string AnalysisTool::MODE_SINGLE_SAMPLE_C("single sample"); const std::string AnalysisTool::MODE_REGRESSION_C("regression"); -const unsigned int AnalysisTool::MCA_TAB_INDEX(3); //--------------------------------------------------------------------------- AnalysisTool::AnalysisTool(Preferences& prefs) : preferences_(prefs) { @@ -67,11 +66,10 @@ AnalysisTool::AnalysisTool(Preferences& prefs) : preferences_(prefs) { connect(ui_->pcaAnimateCheckBox, SIGNAL(stateChanged(int)), this, SLOT(handle_pca_animate_state_changed())); connect(&pca_animate_timer_, SIGNAL(timeout()), this, SLOT(handle_pca_timer())); - //MLCA animation - connect(ui_->mcaAnimateCheckBox, SIGNAL(stateChanged(int)), this, SLOT(handle_mca_animate_state_changed())); + //MCA animation connect(ui_->mcaLevelBetweenButton, SIGNAL(clicked()), this, SLOT(mca_between_radio_toggled())); connect(ui_->mcaLevelWithinButton, SIGNAL(clicked()), this, SLOT(mca_within_radio_toggled())); - connect(&mca_animate_timer_, SIGNAL(timeout()), this, SLOT(handle_mca_timer())); + connect(ui_->vanillaPCAButton, SIGNAL(clicked()), this, SLOT(mca_vanilla_pca_radio_toggled())); // group animation connect(ui_->group_animate_checkbox, &QCheckBox::stateChanged, this, @@ -90,8 +88,7 @@ AnalysisTool::AnalysisTool(Preferences& prefs) : preferences_(prefs) { ui_->metrics_open_button->setChecked(false); /// TODO nothing there yet (regression tab) - // Tab 3 - now for MLCA - ui_->tabWidget->removeTab(MCA_TAB_INDEX+1); + ui_->tabWidget->removeTab(3); for (auto button : {ui_->distance_transfom_radio_button, ui_->mesh_warping_radio_button, ui_->legacy_radio_button}) { connect(button, &QRadioButton::clicked, this, &AnalysisTool::reconstruction_method_changed); @@ -123,14 +120,15 @@ std::string AnalysisTool::get_analysis_mode() { return AnalysisTool::MODE_SINGLE_SAMPLE_C; } } - if (ui_->tabWidget->currentWidget() == ui_->mean_tab) { return AnalysisTool::MODE_MEAN_C; } - if (ui_->tabWidget->currentWidget() == ui_->pca_tab) { + auto domain_names = session_->get_project()->get_domain_names(); + bool multiple_domains = domain_names.size() > 1; + if (ui_->tabWidget->currentWidget() == ui_->pca_tab && !multiple_domains) { return AnalysisTool::MODE_PCA_C; } - if (ui_->tabWidget->currentWidget() == ui_->mca_tab) { + if (ui_->tabWidget->currentWidget() == ui_->pca_tab && multiple_domains) { return AnalysisTool::MODE_MCA_C; } if (ui_->tabWidget->currentWidget() == ui_->regression_tab) { @@ -156,6 +154,11 @@ std::vector AnalysisTool::get_group_difference_vectors() { } return vecs; } +//--------------------------------------------------------------------------- +void AnalysisTool::mca_vanilla_pca_radio_toggled() +{ + Q_EMIT mca_update(); +} //--------------------------------------------------------------------------- void AnalysisTool::mca_between_radio_toggled() @@ -206,12 +209,6 @@ void AnalysisTool::on_reconstructionButton_clicked() { //--------------------------------------------------------------------------- int AnalysisTool::get_pca_mode() { return ui_->pcaModeSpinBox->value() - 1; } -//--------------------------------------------------------------------------- -int AnalysisTool::getMCAMode() -{ - return ui_->mcaModeSpinBox->value() - 1; -} - //--------------------------------------------------------------------------- double AnalysisTool::get_group_ratio() { double group_slider_value = ui_->group_slider->value(); @@ -222,12 +219,6 @@ double AnalysisTool::get_group_ratio() { //--------------------------------------------------------------------------- bool AnalysisTool::pca_animate() { return ui_->pcaAnimateCheckBox->isChecked(); } -//--------------------------------------------------------------------------- -bool AnalysisTool::mcaAnimate() -{ - return ui_->mcaAnimateCheckBox->isChecked(); -} - //--------------------------------------------------------------------------- void AnalysisTool::set_labels(QString which, QString value) { if (which == QString("pca")) { @@ -236,14 +227,6 @@ void AnalysisTool::set_labels(QString which, QString value) { ui_->pcaEigenValueLabel->setText(value); } else if (which == QString("lambda")) { ui_->pcaLambdaLabel->setText(value); - } else if (which == QString("mca")) { - ui_->mcaValueLabel->setText(value); - } - else if (which == QString("mcaeigen")) { - ui_->mcaEigenValueLabel->setText(value); - } - else if (which == QString("mcalambda")) { - ui_->mcaLambdaLabel->setText(value); } } @@ -326,16 +309,14 @@ void AnalysisTool::handle_analysis_options() { ui_->pcaSlider->setEnabled(true); ui_->pcaAnimateCheckBox->setEnabled(true); ui_->pcaModeSpinBox->setEnabled(true); - } else if (ui_->tabWidget->currentWidget() == ui_->mca_tab){ - // mca mode - ui_->sampleSpinBox->setEnabled(false); - ui_->medianButton->setEnabled(false); - ui_->mcaSlider->setEnabled(true); - ui_->mcaAnimateCheckBox->setEnabled(true); - ui_->mcaModeSpinBox->setEnabled(true); - ui_->mcaLevelWithinButton->setEnabled(true); - ui_->mcaLevelBetweenButton->setEnabled(true); - ui_->mcaLevelWithinButton->setChecked(true); + auto domain_names = session_->get_project()->get_domain_names(); + bool multiple_domains = domain_names.size() > 1; + if (multiple_domains) { + ui_->vanillaPCAButton->setEnabled(true); + ui_->mcaLevelWithinButton->setEnabled(true); + ui_->mcaLevelBetweenButton->setEnabled(true); + ui_->vanillaPCAButton->setChecked(true); + } } else { // regression mode ui_->sampleSpinBox->setEnabled(false); @@ -446,7 +427,6 @@ bool AnalysisTool::compute_stats() { compute_reconstructed_domain_transforms(); ui_->pcaModeSpinBox->setMaximum(std::max(1, session_->get_shapes().size() - 1)); - ui_->mcaModeSpinBox->setMaximum(std::max(1, session_->get_shapes().size() - 1)); std::vector points; std::vector group_ids; @@ -462,9 +442,6 @@ bool AnalysisTool::compute_stats() { auto domain_names = session_->get_project()->get_domain_names(); unsigned int dps = domain_names.size(); - if (dps == 1){ - ui_->tabWidget->setTabEnabled(MCA_TAB_INDEX, false); // disable multi level analysis tab if only one domain/object is present - } number_of_particles_ar.resize(dps); bool flag_get_num_part = false; for (auto& shape : session_->get_shapes()) { @@ -511,7 +488,7 @@ bool AnalysisTool::compute_stats() { } stats_.ImportPoints(points, group_ids); - // MLCA needs to know number of particles per domain/object + // MCA needs to know number of particles per domain/object stats_.SetNumberOfParticlesAr(number_of_particles_ar); if(dps > 1){ stats_.ComputeMultiLevelAnalysisStatistics(points, dps); } stats_.ComputeModes(); @@ -634,12 +611,12 @@ Particles AnalysisTool::get_multi_level_shape_points(int mode, double value, int { Eigen::MatrixXd eigenvectors; std::vector eigenvalues; - if(level == 1) + if(level == 2) { eigenvectors = stats_.EigenvectorsShapeDev(); eigenvalues = stats_.EigenvaluesShapeDev(); } - else if (level == 2) + else if (level == 3) { eigenvectors = stats_.EigenvectorsRelPose(); eigenvalues = stats_.EigenvaluesRelPose(); @@ -653,7 +630,7 @@ Particles AnalysisTool::get_multi_level_shape_points(int mode, double value, int unsigned int m = eigenvectors.cols() - (mode + 1); Eigen::VectorXd e = eigenvectors.col(m); double lambda = sqrt(eigenvalues[m]); - mca_labels_changed(QString::number(value, 'g', 2), QString::number(eigenvalues[m]), QString::number(value * lambda)); + pca_labels_changed(QString::number(value, 'g', 2), QString::number(eigenvalues[m]), QString::number(value * lambda)); std::vector vals; for (int i = eigenvalues.size() - 1; i > 0; i--) { vals.push_back(eigenvalues[i]); @@ -664,12 +641,12 @@ Particles AnalysisTool::get_multi_level_shape_points(int mode, double value, int cumulation += vals[i]; } if (sum > 0) { - ui_->mca_explained_variance->setText(QString::number(vals[mode] / sum * 100, 'f', 1) + "%"); - ui_->mca_cumulative_explained_variance->setText(QString::number(cumulation / sum * 100, 'f', 1) + "%"); + ui_->explained_variance->setText(QString::number(vals[mode] / sum * 100, 'f', 1) + "%"); + ui_->cumulative_explained_variance->setText(QString::number(cumulation / sum * 100, 'f', 1) + "%"); } else { - ui_->mca_explained_variance->setText(""); - ui_->mca_cumulative_explained_variance->setText(""); + ui_->explained_variance->setText(""); + ui_->cumulative_explained_variance->setText(""); } Eigen::VectorXd shape_dev_mean = stats_.MeanShapeDev(); // 3M Eigen::VectorXd rel_pose_mean_ = stats_.MeanRelPose(); // 3K @@ -690,12 +667,12 @@ Particles AnalysisTool::get_multi_level_shape_points(int mode, double value, int } Eigen::VectorXd new_mean = shape_dev_mean + e_rel_pose_mean_reshaped; - if(level == 1){ + if(level == 2){ // temp_shape_mca = stats_.Mean() + (e * (value * lambda)); temp_shape_mca = new_mean + (e * (value * lambda)); } - else if(level == 2){ + else if(level == 3){ Eigen::VectorXd e_between; e_between.resize(sz); for(unsigned int i = 0; i < D; i++){ @@ -752,7 +729,6 @@ void AnalysisTool::store_settings() { //--------------------------------------------------------------------------- void AnalysisTool::shutdown() { pca_animate_timer_.stop(); - mca_animate_timer_.stop(); } //--------------------------------------------------------------------------- @@ -836,17 +812,16 @@ void AnalysisTool::on_tabWidget_currentChanged() { update_analysis_mode(); } void AnalysisTool::on_pcaSlider_valueChanged() { // this will make the slider handle redraw making the UI appear more responsive QCoreApplication::processEvents(); - - Q_EMIT pca_update(); + auto domain_names = session_->get_project()->get_domain_names(); + bool multiple_domains = domain_names.size() > 1; + if (multiple_domains){ + Q_EMIT mca_update(); + } + else { + Q_EMIT pca_update(); + } } -//--------------------------------------------------------------------------- -void AnalysisTool::on_mcaSlider_valueChanged() -{ - QCoreApplication::processEvents(); - - Q_EMIT mca_update(); -} //--------------------------------------------------------------------------- void AnalysisTool::on_group_slider_valueChanged() { @@ -862,10 +837,17 @@ void AnalysisTool::on_group_slider_valueChanged() { } //--------------------------------------------------------------------------- -void AnalysisTool::on_pcaModeSpinBox_valueChanged(int i) { Q_EMIT pca_update(); } +void AnalysisTool::on_pcaModeSpinBox_valueChanged(int i) { + auto domain_names = session_->get_project()->get_domain_names(); + bool multiple_domains = domain_names.size() > 1; + if (multiple_domains){ + Q_EMIT mca_update(); + } + else { + Q_EMIT pca_update(); + } -//--------------------------------------------------------------------------- -void AnalysisTool::on_mcaModeSpinBox_valueChanged(int i) { Q_EMIT mca_update(); } +} //--------------------------------------------------------------------------- void AnalysisTool::handle_pca_animate_state_changed() { @@ -877,18 +859,6 @@ void AnalysisTool::handle_pca_animate_state_changed() { } } -//--------------------------------------------------------------------------- -void AnalysisTool::handle_mca_animate_state_changed() { - if(mcaAnimate()) - { - mca_animate_timer_.setInterval(10); - mca_animate_timer_.start(); - } - else{ - mca_animate_timer_.stop(); - } -} - //--------------------------------------------------------------------------- void AnalysisTool::handle_pca_timer() { if (!pca_animate()) { @@ -909,30 +879,6 @@ void AnalysisTool::handle_pca_timer() { ui_->pcaSlider->setValue(value); } -//--------------------------------------------------------------------------- -void AnalysisTool::handle_mca_timer() { - if(!mcaAnimate()) - { - return; - } - - int value = ui_->mcaSlider->value(); - if(mca_animate_direction_) - { - value += ui_->mcaSlider->singleStep(); - } - else{ - value -= ui_->mcaSlider->singleStep(); - } - - if(value >= ui_->mcaSlider->maximum() || value <= ui_->mcaSlider->minimum()) - { - mca_animate_direction_ = !mca_animate_direction_; - } - - ui_->mcaSlider->setValue(value); - -} //--------------------------------------------------------------------------- void AnalysisTool::handle_group_animate_state_changed() { @@ -944,26 +890,20 @@ void AnalysisTool::handle_group_animate_state_changed() { } } -//--------------------------------------------------------------------------- -double AnalysisTool::get_mca_value() { - int slider_value = ui_->mcaSlider->value(); - float range = preferences_.get_pca_range(); - int halfRange = ui_->mcaSlider->maximum(); - - double value = (double) slider_value / (double) halfRange * range; - return value; -} - //--------------------------------------------------------------------------- int AnalysisTool::get_mca_level() { + bool vanilla_pca = ui_->vanillaPCAButton->isChecked(); bool between = ui_->mcaLevelBetweenButton->isChecked(); bool within = ui_->mcaLevelWithinButton->isChecked(); - if(within){ + if (vanilla_pca){ return 1; } - if(between){ + else if(within){ return 2; } + else if(between){ + return 3; + } } //--------------------------------------------------------------------------- @@ -1000,14 +940,6 @@ void AnalysisTool::pca_labels_changed(QString value, QString eigen, QString lamb set_labels(QString("lambda"), lambda); } -//--------------------------------------------------------------------------- -void AnalysisTool::mca_labels_changed(QString value, QString eigen, QString lambda) -{ - set_labels(QString("mca"), value); - set_labels(QString("mcaeigen"), eigen); - set_labels(QString("mcalambda"), lambda); -} - //--------------------------------------------------------------------------- void AnalysisTool::update_slider() { auto steps = preferences_.get_pca_steps(); @@ -1015,15 +947,6 @@ void AnalysisTool::update_slider() { ui_->pcaSlider->setSingleStep(sliderRange / steps); } -//--------------------------------------------------------------------------- -void AnalysisTool::updateMcaSlider() -{ - auto steps = preferences_.get_pca_steps(); - auto sliderRange = ui_->mcaSlider->maximum() - ui_->mcaSlider->minimum(); - ui_->mcaSlider->setSingleStep(sliderRange / steps); - -} - //--------------------------------------------------------------------------- void AnalysisTool::reset_stats() { ui_->tabWidget->setCurrentWidget(ui_->mean_tab); @@ -1036,13 +959,15 @@ void AnalysisTool::reset_stats() { ui_->pcaModeSpinBox->setEnabled(false); ui_->pcaAnimateCheckBox->setChecked(false); // MLCA - ui_->mcaSlider->setEnabled(false); - ui_->mcaAnimateCheckBox->setEnabled(false); - ui_->mcaModeSpinBox->setEnabled(false); - ui_->mcaAnimateCheckBox->setChecked(false); - ui_->mcaLevelWithinButton->setChecked(true); - ui_->mcaLevelWithinButton->setEnabled(false); - ui_->mcaLevelBetweenButton->setEnabled(false); + auto domain_names = session_->get_project()->get_domain_names(); + bool multiple_domains = domain_names.size() > 1; + if (multiple_domains) { + ui_->vanillaPCAButton->setChecked(true); + ui_->mcaLevelWithinButton->setEnabled(false); + ui_->mcaLevelWithinButton->setEnabled(false); + ui_->mcaLevelBetweenButton->setEnabled(false); + } + stats_ready_ = false; evals_ready_ = false; stats_ = ParticleShapeStatistics(); @@ -1087,9 +1012,11 @@ void AnalysisTool::set_analysis_mode(std::string mode) { ui_->tabWidget->setCurrentWidget(ui_->pca_tab); } else if (mode == "regression") { ui_->tabWidget->setCurrentWidget(ui_->regression_tab); - } else if (mode == "mca"){ - ui_->tabWidget->setCurrentWidget(ui_->mca_tab); - ui_->mcaLevelWithinButton->setChecked(true); + } + else if (mode == "mca"){ + ui_->tabWidget->setCurrentWidget(ui_->pca_tab); + ui_->vanillaPCAButton->setChecked(true); + ui_->mcaLevelWithinButton->setChecked(false); ui_->mcaLevelBetweenButton->setChecked(false); } } @@ -1256,6 +1183,7 @@ void AnalysisTool::update_domain_alignment_box() { bool multiple_domains = domain_names.size() > 1; ui_->reference_domain_widget->setVisible(multiple_domains); + ui_->mca_groupBox->setVisible(multiple_domains); ui_->reference_domain->clear(); if (multiple_domains) { ui_->reference_domain->addItem("Global Alignment"); @@ -1583,8 +1511,6 @@ void AnalysisTool::set_active(bool active) { if (!active) { ui_->pcaAnimateCheckBox->setChecked(false); pca_animate_timer_.stop(); - ui_->mcaAnimateCheckBox->setChecked(false); - mca_animate_timer_.stop(); } active_ = active; update_interface(); diff --git a/Studio/src/Analysis/AnalysisTool.h b/Studio/src/Analysis/AnalysisTool.h index 6367b0a79c..b24493729b 100644 --- a/Studio/src/Analysis/AnalysisTool.h +++ b/Studio/src/Analysis/AnalysisTool.h @@ -66,23 +66,19 @@ class AnalysisTool : public QWidget { void set_labels(QString which, QString value); int get_pca_mode(); - int getMCAMode(); double get_group_ratio(); double get_pca_value(); - double get_mca_value(); bool pca_animate(); int get_mca_level(); - bool mcaAnimate(); int get_sample_number(); bool compute_stats(); void update_slider(); - void updateMcaSlider(); void reset_stats(); void enable_actions(bool newly_enabled = false); @@ -111,7 +107,6 @@ class AnalysisTool : public QWidget { static const std::string MODE_MCA_C; static const std::string MODE_SINGLE_SAMPLE_C; static const std::string MODE_REGRESSION_C; - static const unsigned int MCA_TAB_INDEX; public Q_SLOTS: @@ -143,11 +138,8 @@ class AnalysisTool : public QWidget { void on_reconstructionButton_clicked(); - //MLCA - void on_mcaSlider_valueChanged(); - void on_mcaModeSpinBox_valueChanged(int i); - void handle_mca_animate_state_changed(); - void handle_mca_timer(); + //MCA + void mca_vanilla_pca_radio_toggled(); void mca_between_radio_toggled(); void mca_within_radio_toggled(); @@ -205,7 +197,6 @@ class AnalysisTool : public QWidget { bool active_ = false; void pca_labels_changed(QString value, QString eigen, QString lambda); - void mca_labels_changed(QString value, QString eigen, QString lambda); void compute_mca_mode_shape(); void compute_mode_shape(); void update_analysis_mode(); @@ -251,9 +242,6 @@ class AnalysisTool : public QWidget { bool pca_animate_direction_ = true; QTimer pca_animate_timer_; - bool mca_animate_direction_ = true; - QTimer mca_animate_timer_; - bool group_animate_direction_ = true; QTimer group_animate_timer_; diff --git a/Studio/src/Analysis/AnalysisTool.ui b/Studio/src/Analysis/AnalysisTool.ui index 397ec297a2..49f460fabb 100644 --- a/Studio/src/Analysis/AnalysisTool.ui +++ b/Studio/src/Analysis/AnalysisTool.ui @@ -1117,7 +1117,67 @@ QWidget#particles_panel { 6 - + + + + Mode of Variation + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Shared Space Variation + + + true + + + + + + + Shape Variation + + + true + + + false + + + + + + + Relative Pose Variation + + + true + + + false + + + + + + + @@ -1130,7 +1190,7 @@ QWidget#particles_panel { - + false @@ -1146,14 +1206,14 @@ QWidget#particles_panel { - + - + @@ -1166,7 +1226,7 @@ QWidget#particles_panel { - + @@ -1179,7 +1239,7 @@ QWidget#particles_panel { - + @@ -1192,7 +1252,7 @@ QWidget#particles_panel { - + @@ -1205,21 +1265,21 @@ QWidget#particles_panel { - + - + - + @@ -1233,346 +1293,6 @@ QWidget#particles_panel { - - - - Multi-Level Analysis - - - - 3 - - - 3 - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - false - - - - 100 - 0 - - - - Standard deviation slider - - - -20 - - - 20 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 10 - - - - - - - Std.Dev. - - - - - - - - 35 - 0 - - - - - - - - - - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - - 0 - 0 - - - - Standard deviation animation - - - Animate - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 6 - - - - - - 0 - 24 - - - - Eigenvalue - - - - - - - - - - - - - - Mode of Variation - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Shape Variation - - - true - - - - - - - Relative Pose Variation - - - true - - - false - - - - - - - - - - - 0 - 24 - - - - Lambda - - - - - - - - - - - - - - false - - - Mode - - - 1 - - - 500 - - - - - - - - 0 - 24 - - - - Mode - - - - - - - - - 0 - 24 - - - - Explained Variance - - - - - - - - - - - - - - - 0 - 24 - - - - Cumulative Variance - - - - - - - - - - - - - - - - - - Regression diff --git a/Studio/src/Interface/ShapeWorksStudioApp.cpp b/Studio/src/Interface/ShapeWorksStudioApp.cpp index 6cbb2a934b..55a794a0a7 100644 --- a/Studio/src/Interface/ShapeWorksStudioApp.cpp +++ b/Studio/src/Interface/ShapeWorksStudioApp.cpp @@ -632,12 +632,6 @@ void ShapeWorksStudioApp::handle_mca_changed() compute_mca_mode_shape(); } -//--------------------------------------------------------------------------- -void ShapeWorksStudioApp::handle_mca_slider_update() -{ - analysis_tool_->updateMcaSlider(); -} - //--------------------------------------------------------------------------- void ShapeWorksStudioApp::handle_pca_update() { if (analysis_tool_->get_active() && analysis_tool_->get_analysis_mode() == AnalysisTool::MODE_PCA_C) { @@ -850,6 +844,7 @@ void ShapeWorksStudioApp::handle_new_mesh() { //--------------------------------------------------------------------------- void ShapeWorksStudioApp::handle_clear_cache() { handle_pca_changed(); + handle_mca_changed(); if (session_) { session_->handle_clear_cache(); } @@ -1194,7 +1189,6 @@ void ShapeWorksStudioApp::handle_display_setting_changed() { if (analysis_tool_->pca_animate()) { return; } - if (analysis_tool_->mcaAnimate()) { return; } update_display(true); } @@ -1734,10 +1728,16 @@ void ShapeWorksStudioApp::compute_mode_shape() { //--------------------------------------------------------------------------- void ShapeWorksStudioApp::compute_mca_mode_shape() { - int mca_mode = analysis_tool_->getMCAMode(); - double mca_value = analysis_tool_->get_mca_value(); + int pca_mode = analysis_tool_->get_pca_mode(); + double pca_value = analysis_tool_->get_pca_value(); int mca_level = analysis_tool_->get_mca_level(); - visualizer_->display_shape(analysis_tool_->get_mca_mode_shape(mca_mode, mca_value, mca_level)); + if (mca_level == 1) { + visualizer_->display_shape(analysis_tool_->get_mode_shape(pca_mode, pca_value)); + } + else { + visualizer_->display_shape(analysis_tool_->get_mca_mode_shape(pca_mode, pca_value, mca_level)); + } + } //--------------------------------------------------------------------------- @@ -2100,7 +2100,7 @@ void ShapeWorksStudioApp::update_view_combo() { if (analysis_mode) { mode = analysis_tool_->get_analysis_mode(); } - if (mode == AnalysisTool::MODE_MEAN_C || mode == AnalysisTool::MODE_PCA_C) { + if (mode == AnalysisTool::MODE_MEAN_C || mode == AnalysisTool::MODE_PCA_C || mode == AnalysisTool::MODE_MCA_C) { set_view_combo_item_enabled(DisplayMode::Original, false); set_view_combo_item_enabled(DisplayMode::Groomed, false); } diff --git a/Studio/src/Interface/ShapeWorksStudioApp.h b/Studio/src/Interface/ShapeWorksStudioApp.h index 5476e129b2..02617cdfa7 100644 --- a/Studio/src/Interface/ShapeWorksStudioApp.h +++ b/Studio/src/Interface/ShapeWorksStudioApp.h @@ -100,7 +100,6 @@ class ShapeWorksStudioApp : public QMainWindow { void handle_slider_update(); void handle_mca_changed(); - void handle_mca_slider_update(); void handle_project_changed(); void handle_points_changed();