diff --git a/Libs/Optimize/OptimizeParameters.cpp b/Libs/Optimize/OptimizeParameters.cpp index fa6a904d64..41f9f1800d 100644 --- a/Libs/Optimize/OptimizeParameters.cpp +++ b/Libs/Optimize/OptimizeParameters.cpp @@ -53,6 +53,7 @@ const std::string use_geodesics_to_landmarks = "use_geodesics_to_landmarks"; const std::string geodesics_to_landmarks_weight = "geodesics_to_landmarks_weight"; const std::string particle_format = "particle_format"; const std::string geodesic_remesh_percent = "geodesic_remesh_percent"; +const std::string output_prefix = "output_prefix"; } // namespace Keys //--------------------------------------------------------------------------- @@ -96,7 +97,8 @@ OptimizeParameters::OptimizeParameters(ProjectHandle project) { Keys::use_linear_regression, Keys::time_points_per_subject, Keys::particle_format, - Keys::geodesic_remesh_percent}; + Keys::geodesic_remesh_percent, + Keys::output_prefix}; std::vector to_remove; @@ -884,3 +886,6 @@ double OptimizeParameters::get_geodesic_remesh_percent() { return params_.get(Ke void OptimizeParameters::set_geodesic_remesh_percent(double value) { params_.set(Keys::geodesic_remesh_percent, value); } + +//--------------------------------------------------------------------------- +void OptimizeParameters::set_output_prefix(std::string value) { params_.set(Keys::output_prefix, value); } diff --git a/Libs/Optimize/OptimizeParameters.h b/Libs/Optimize/OptimizeParameters.h index 1adc692b83..7c62f9299d 100644 --- a/Libs/Optimize/OptimizeParameters.h +++ b/Libs/Optimize/OptimizeParameters.h @@ -138,6 +138,7 @@ class OptimizeParameters { double get_geodesic_remesh_percent(); void set_geodesic_remesh_percent(double value); + void set_output_prefix(std::string value); private: std::string get_output_prefix(); diff --git a/Studio/Analysis/AnalysisTool.cpp b/Studio/Analysis/AnalysisTool.cpp index d760becda8..6a89fcfff4 100644 --- a/Studio/Analysis/AnalysisTool.cpp +++ b/Studio/Analysis/AnalysisTool.cpp @@ -138,7 +138,7 @@ AnalysisTool::AnalysisTool(Preferences& prefs) : preferences_(prefs) { ui_->metrics_open_button->setChecked(false); /// TODO nothing there yet (regression tab) - ui_->tabWidget->removeTab(3); + // ui_->tabWidget->removeTab(3); for (auto button : {ui_->distance_transform_radio_button, ui_->mesh_warping_radio_button, ui_->legacy_radio_button}) { connect(button, &QRadioButton::clicked, this, &AnalysisTool::reconstruction_method_changed); @@ -381,7 +381,7 @@ void AnalysisTool::handle_analysis_options() { ui_->mcaLevelBetweenButton->setEnabled(true); ui_->vanillaPCAButton->setChecked(true); } - } else { + } else if (ui_->tabWidget->currentWidget() == ui_->regression_tab){ // regression mode ui_->sampleSpinBox->setEnabled(false); ui_->medianButton->setEnabled(false); @@ -389,6 +389,14 @@ void AnalysisTool::handle_analysis_options() { ui_->pcaAnimateCheckBox->setEnabled(false); ui_->pcaModeSpinBox->setEnabled(false); pca_animate_timer_.stop(); + + } else { + ui_->sampleSpinBox->setEnabled(false); + ui_->medianButton->setEnabled(false); + ui_->pcaSlider->setEnabled(false); + ui_->pcaAnimateCheckBox->setEnabled(false); + ui_->pcaModeSpinBox->setEnabled(false); + pca_animate_timer_.stop(); } update_difference_particles(); @@ -863,6 +871,8 @@ void AnalysisTool::store_settings() { params.set("network_pvalue_of_interest", ui_->network_pvalue_of_interest->text().toStdString()); params.set("network_pvalue_threshold", ui_->network_pvalue_threshold->text().toStdString()); + params.set("regression_slope", session->) + session_->get_project()->set_parameters(Parameters::ANALYSIS_PARAMS, params); } diff --git a/Studio/Data/Session.cpp b/Studio/Data/Session.cpp index 26b335d644..eb5b0ebe45 100644 --- a/Studio/Data/Session.cpp +++ b/Studio/Data/Session.cpp @@ -822,6 +822,8 @@ void Session::new_plane_point(PickResult result) { //--------------------------------------------------------------------------- QString Session::get_filename() { return filename_; } +QString Session::get_parent_dir() + //--------------------------------------------------------------------------- int Session::get_num_shapes() { return shapes_.size(); } diff --git a/Studio/Interface/ShapeWorksStudioApp.cpp b/Studio/Interface/ShapeWorksStudioApp.cpp index b060c7b696..6499a97155 100644 --- a/Studio/Interface/ShapeWorksStudioApp.cpp +++ b/Studio/Interface/ShapeWorksStudioApp.cpp @@ -1485,6 +1485,14 @@ void ShapeWorksStudioApp::open_project(QString filename) { groom_tool_->load_params(); optimize_tool_->load_params(); + + if (optimize_tool_->get_regression_analysis_status()) + { + // Verify if slope and intercept files exist + auto particles_dir = session_->get_filename().dir().absolutePath().toStdString(); + auto slope_filename = session_->get_filename().toStdString() + } + analysis_tool_->store_settings(); update_from_preferences(); update_tool_mode(); diff --git a/Studio/Optimize/OptimizeTool.h b/Studio/Optimize/OptimizeTool.h index e62b58a896..f88e322626 100644 --- a/Studio/Optimize/OptimizeTool.h +++ b/Studio/Optimize/OptimizeTool.h @@ -37,6 +37,10 @@ Q_OBJECT; //! Load params from project void load_params(); //! Store params to project + + //! Get flag if regression needs to enabled for analysis in Studio + inline bool get_regression_analysis_status() { return regression_analysis_status; } + void store_params(); //! Enable action buttons @@ -94,5 +98,7 @@ public Q_SLOTS: QElapsedTimer elapsed_timer_; Ui_OptimizeTool* ui_; + + bool regression_analysis_status_; }; }