Skip to content

Commit 5de96b6

Browse files
more studio changes
1 parent 69fcb3c commit 5de96b6

File tree

6 files changed

+34
-2
lines changed

6 files changed

+34
-2
lines changed

Libs/Optimize/OptimizeParameters.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const std::string particle_format = "particle_format";
5555
const std::string geodesic_remesh_percent = "geodesic_remesh_percent";
5656
const std::string shared_boundary = "shared_boundary";
5757
const std::string shared_boundary_weight = "shared_boundary_weight";
58+
const std::string output_prefix = "output_prefix";
5859
} // namespace Keys
5960

6061
//---------------------------------------------------------------------------
@@ -99,6 +100,7 @@ OptimizeParameters::OptimizeParameters(ProjectHandle project) {
99100
Keys::time_points_per_subject,
100101
Keys::particle_format,
101102
Keys::geodesic_remesh_percent,
103+
Keys::output_prefix,
102104
Keys::shared_boundary,
103105
Keys::shared_boundary_weight};
104106

@@ -887,6 +889,9 @@ void OptimizeParameters::set_geodesic_remesh_percent(double value) {
887889
params_.set(Keys::geodesic_remesh_percent, value);
888890
}
889891

892+
//---------------------------------------------------------------------------
893+
void OptimizeParameters::set_output_prefix(std::string value) { params_.set(Keys::output_prefix, value); }
894+
890895
//---------------------------------------------------------------------------
891896
bool OptimizeParameters::get_shared_boundary() { return params_.get(Keys::shared_boundary, false); }
892897

Libs/Optimize/OptimizeParameters.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class OptimizeParameters {
143143

144144
double get_shared_boundary_weight();
145145
void set_shared_boundary_weight(double value);
146+
void set_output_prefix(std::string value);
146147

147148
private:
148149
std::string get_output_prefix();

Studio/Analysis/AnalysisTool.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ AnalysisTool::AnalysisTool(Preferences& prefs) : preferences_(prefs) {
138138
ui_->metrics_open_button->setChecked(false);
139139

140140
/// TODO nothing there yet (regression tab)
141-
ui_->tabWidget->removeTab(3);
141+
// ui_->tabWidget->removeTab(3);
142142

143143
for (auto button : {ui_->distance_transform_radio_button, ui_->mesh_warping_radio_button, ui_->legacy_radio_button}) {
144144
connect(button, &QRadioButton::clicked, this, &AnalysisTool::reconstruction_method_changed);
@@ -378,14 +378,22 @@ void AnalysisTool::handle_analysis_options() {
378378
ui_->mcaLevelBetweenButton->setEnabled(true);
379379
ui_->vanillaPCAButton->setChecked(true);
380380
}
381-
} else {
381+
} else if (ui_->tabWidget->currentWidget() == ui_->regression_tab){
382382
// regression mode
383383
ui_->sampleSpinBox->setEnabled(false);
384384
ui_->medianButton->setEnabled(false);
385385
ui_->pcaSlider->setEnabled(false);
386386
ui_->pcaAnimateCheckBox->setEnabled(false);
387387
ui_->pcaModeSpinBox->setEnabled(false);
388388
pca_animate_timer_.stop();
389+
390+
} else {
391+
ui_->sampleSpinBox->setEnabled(false);
392+
ui_->medianButton->setEnabled(false);
393+
ui_->pcaSlider->setEnabled(false);
394+
ui_->pcaAnimateCheckBox->setEnabled(false);
395+
ui_->pcaModeSpinBox->setEnabled(false);
396+
pca_animate_timer_.stop();
389397
}
390398

391399
update_difference_particles();
@@ -861,6 +869,8 @@ void AnalysisTool::store_settings() {
861869
params.set("network_pvalue_of_interest", ui_->network_pvalue_of_interest->text().toStdString());
862870
params.set("network_pvalue_threshold", ui_->network_pvalue_threshold->text().toStdString());
863871

872+
params.set("regression_slope", session->)
873+
864874
session_->get_project()->set_parameters(Parameters::ANALYSIS_PARAMS, params);
865875
}
866876

Studio/Data/Session.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,8 @@ void Session::new_plane_point(PickResult result) {
837837
//---------------------------------------------------------------------------
838838
QString Session::get_filename() { return filename_; }
839839

840+
QString Session::get_parent_dir()
841+
840842
//---------------------------------------------------------------------------
841843
int Session::get_num_shapes() { return shapes_.size(); }
842844

Studio/Interface/ShapeWorksStudioApp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,14 @@ void ShapeWorksStudioApp::open_project(QString filename) {
15281528

15291529
groom_tool_->load_params();
15301530
optimize_tool_->load_params();
1531+
1532+
if (optimize_tool_->get_regression_analysis_status())
1533+
{
1534+
// Verify if slope and intercept files exist
1535+
auto particles_dir = session_->get_filename().dir().absolutePath().toStdString();
1536+
auto slope_filename = session_->get_filename().toStdString()
1537+
}
1538+
analysis_tool_->store_settings();
15311539
update_from_preferences();
15321540

15331541
update_tool_mode();

Studio/Optimize/OptimizeTool.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Q_OBJECT;
3737
//! Load params from project
3838
void load_params();
3939
//! Store params to project
40+
41+
//! Get flag if regression needs to enabled for analysis in Studio
42+
inline bool get_regression_analysis_status() { return regression_analysis_status; }
43+
4044
void store_params();
4145

4246
//! Enable action buttons
@@ -94,5 +98,7 @@ public Q_SLOTS:
9498
QElapsedTimer elapsed_timer_;
9599

96100
Ui_OptimizeTool* ui_;
101+
102+
bool regression_analysis_status_;
97103
};
98104
}

0 commit comments

Comments
 (0)