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 Oct 9, 2024
1 parent 69fcb3c commit 5de96b6
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Libs/Optimize/OptimizeParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const std::string particle_format = "particle_format";
const std::string geodesic_remesh_percent = "geodesic_remesh_percent";
const std::string shared_boundary = "shared_boundary";
const std::string shared_boundary_weight = "shared_boundary_weight";
const std::string output_prefix = "output_prefix";
} // namespace Keys

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -99,6 +100,7 @@ OptimizeParameters::OptimizeParameters(ProjectHandle project) {
Keys::time_points_per_subject,
Keys::particle_format,
Keys::geodesic_remesh_percent,
Keys::output_prefix,
Keys::shared_boundary,
Keys::shared_boundary_weight};

Expand Down Expand Up @@ -887,6 +889,9 @@ 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); }

//---------------------------------------------------------------------------
bool OptimizeParameters::get_shared_boundary() { return params_.get(Keys::shared_boundary, false); }

Expand Down
1 change: 1 addition & 0 deletions Libs/Optimize/OptimizeParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class OptimizeParameters {

double get_shared_boundary_weight();
void set_shared_boundary_weight(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 @@ -378,14 +378,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 @@ -861,6 +869,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 @@ -837,6 +837,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 @@ -1528,6 +1528,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 5de96b6

Please sign in to comment.