Skip to content

Commit

Permalink
more studio changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nawazishkhan1-nk committed Aug 13, 2024
1 parent 0c3214b commit 56f7d96
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Libs/Optimize/OptimizeParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -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<std::string> to_remove;

Expand Down Expand Up @@ -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); }
1 change: 1 addition & 0 deletions Libs/Optimize/OptimizeParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
14 changes: 12 additions & 2 deletions Studio/Analysis/AnalysisTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -381,14 +381,22 @@ 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);
ui_->pcaSlider->setEnabled(false);
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();
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions Studio/Data/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }

Expand Down
8 changes: 8 additions & 0 deletions Studio/Interface/ShapeWorksStudioApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions Studio/Optimize/OptimizeTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -94,5 +98,7 @@ public Q_SLOTS:
QElapsedTimer elapsed_timer_;

Ui_OptimizeTool* ui_;

bool regression_analysis_status_;
};
}

0 comments on commit 56f7d96

Please sign in to comment.