Commit f2289b3c authored by Matt Clarkson's avatar Matt Clarkson

Issue #5353: Rename vars to indicate 'Save regardless of calibration', rather...

Issue #5353: Rename vars to indicate 'Save regardless of calibration', rather than 'Save before calibration', which was buggy.
parent 1b03b928
......@@ -67,7 +67,7 @@ const bool NiftyCalVideoCalibrationManager::DefaultUpdateNodes(tr
const unsigned int NiftyCalVideoCalibrationManager::DefaultMinimumNumberOfPoints(70);
const bool NiftyCalVideoCalibrationManager::DefaultModelIsStationary(true);
const bool NiftyCalVideoCalibrationManager::DefaultCameraIsStationary(false);
const bool NiftyCalVideoCalibrationManager::DefaultSaveOutputBeforeCalibration(false);
const bool NiftyCalVideoCalibrationManager::DefaultSaveOutputRegardlessOfCalibration(false);
const bool NiftyCalVideoCalibrationManager::DefaultResetCalibrationIfNodeChanges(true);
const NiftyCalVideoCalibrationManager::CalibrationPatterns
......@@ -85,7 +85,7 @@ NiftyCalVideoCalibrationManager::NiftyCalVideoCalibrationManager()
, m_Do3DOptimisation(NiftyCalVideoCalibrationManager::DefaultDo3DOptimisation)
, m_ModelIsStationary(NiftyCalVideoCalibrationManager::DefaultModelIsStationary)
, m_CameraIsStationary(NiftyCalVideoCalibrationManager::DefaultCameraIsStationary)
, m_SaveOutputBeforeCalibration(NiftyCalVideoCalibrationManager::DefaultSaveOutputBeforeCalibration)
, m_SaveOutputRegardlessOfCalibration(NiftyCalVideoCalibrationManager::DefaultSaveOutputRegardlessOfCalibration)
, m_NumberOfSnapshotsForCalibrating(NiftyCalVideoCalibrationManager::DefaultNumberOfSnapshotsForCalibrating)
, m_ScaleFactorX(NiftyCalVideoCalibrationManager::DefaultScaleFactorX)
, m_ScaleFactorY(NiftyCalVideoCalibrationManager::DefaultScaleFactorY)
......@@ -1961,8 +1961,7 @@ std::string NiftyCalVideoCalibrationManager::Calibrate()
message << "ERROR: Calibration failed: " << e.what() << std::endl;
m_CalibrationResult += message.str();
// If this option is selected, we save regardless.
if (this->GetSaveOutputBeforeCalibration())
if (this->GetSaveOutputRegardlessOfCalibration())
{
this->Save();
}
......
......@@ -80,7 +80,7 @@ public:
const static bool DefaultUpdateNodes;
const static bool DefaultModelIsStationary;
const static bool DefaultCameraIsStationary;
const static bool DefaultSaveOutputBeforeCalibration;
const static bool DefaultSaveOutputRegardlessOfCalibration;
const static bool DefaultResetCalibrationIfNodeChanges;
mitkClassMacroItkParent(NiftyCalVideoCalibrationManager, itk::Object);
......@@ -115,8 +115,8 @@ public:
itkSetMacro(CameraIsStationary, bool);
itkGetMacro(CameraIsStationary, bool);
itkSetMacro(SaveOutputBeforeCalibration, bool);
itkGetMacro(SaveOutputBeforeCalibration, bool);
itkSetMacro(SaveOutputRegardlessOfCalibration, bool);
itkGetMacro(SaveOutputRegardlessOfCalibration, bool);
itkSetMacro(ResetCalibrationIfNodeChanges, bool);
itkGetMacro(ResetCalibrationIfNodeChanges, bool);
......@@ -353,7 +353,7 @@ private:
bool m_DoClustering;
bool m_ModelIsStationary;
bool m_CameraIsStationary;
bool m_SaveOutputBeforeCalibration;
bool m_SaveOutputRegardlessOfCalibration;
bool m_ResetCalibrationIfNodeChanges;
unsigned int m_NumberOfSnapshotsForCalibrating;
std::string m_ModelFileName;
......
......@@ -216,8 +216,8 @@ void CameraCalView::RetrievePreferenceValues()
bool cameraIsStationary = prefs->GetBool(CameraCalViewPreferencePage::CAMERA_IS_STATIONARY_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultCameraIsStationary);
m_Manager->SetCameraIsStationary(cameraIsStationary);
bool saveOutputBeforeCalibration = prefs->GetBool(CameraCalViewPreferencePage::SAVE_OUTPUT_BEFORE_CALIBRATION_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultSaveOutputBeforeCalibration);
m_Manager->SetSaveOutputBeforeCalibration(saveOutputBeforeCalibration);
bool saveOutputRegardlessOfCalibration = prefs->GetBool(CameraCalViewPreferencePage::SAVE_OUTPUT_REGARDLESS_OF_CALIBRATION_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultSaveOutputRegardlessOfCalibration);
m_Manager->SetSaveOutputRegardlessOfCalibration(saveOutputRegardlessOfCalibration);
bool resetCalibrationIfNodeChanges = prefs->GetBool(CameraCalViewPreferencePage::RESET_CALIBRATION_IF_NODE_CHANGES_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultResetCalibrationIfNodeChanges);
m_Manager->SetResetCalibrationIfNodeChanges(resetCalibrationIfNodeChanges);
......@@ -424,7 +424,7 @@ void CameraCalView::OnGrabButtonPressed()
// However, if the user just wants to grab data, and hence
// m_Manager->GetSaveOutputBeforeCalibration() is true, then we do NOT need this check.
// So, only do this check if m_Manager->GetSaveOutputBeforeCalibration() is false.
if (m_Manager->GetModelFileName().empty() && !m_Manager->GetSaveOutputBeforeCalibration())
if (m_Manager->GetModelFileName().empty() && !m_Manager->GetSaveOutputRegardlessOfCalibration())
{
QMessageBox msgBox;
msgBox.setText("An Error Occurred.");
......
......@@ -48,7 +48,7 @@ const QString CameraCalViewPreferencePage::PREVIOUS_CALIBRATION_DIR_NODE_NAME("p
const QString CameraCalViewPreferencePage::OUTPUT_DIR_NODE_NAME("output directory");
const QString CameraCalViewPreferencePage::MODEL_IS_STATIONARY_NODE_NAME("model is stationary");
const QString CameraCalViewPreferencePage::CAMERA_IS_STATIONARY_NODE_NAME("camera is stationary");
const QString CameraCalViewPreferencePage::SAVE_OUTPUT_BEFORE_CALIBRATION_NODE_NAME("save output before calibration");
const QString CameraCalViewPreferencePage::SAVE_OUTPUT_REGARDLESS_OF_CALIBRATION_NODE_NAME("save output regardless of calibration");
const QString CameraCalViewPreferencePage::RESET_CALIBRATION_IF_NODE_CHANGES_NODE_NAME("reset if node changes");
//-----------------------------------------------------------------------------
......@@ -393,7 +393,7 @@ bool CameraCalViewPreferencePage::PerformOk()
m_CameraCalViewPreferencesNode->Put(CameraCalViewPreferencePage::OUTPUT_DIR_NODE_NAME, m_Ui->m_OutputDirLineEdit->text());
m_CameraCalViewPreferencesNode->PutBool(CameraCalViewPreferencePage::MODEL_IS_STATIONARY_NODE_NAME, m_Ui->m_ModelIsStationaryCheckBox->isChecked());
m_CameraCalViewPreferencesNode->PutBool(CameraCalViewPreferencePage::CAMERA_IS_STATIONARY_NODE_NAME, m_Ui->m_CameraIsStationaryCheckBox->isChecked());
m_CameraCalViewPreferencesNode->PutBool(CameraCalViewPreferencePage::SAVE_OUTPUT_BEFORE_CALIBRATION_NODE_NAME, m_Ui->m_SaveOutputBeforeCalibrationCheckBox->isChecked());
m_CameraCalViewPreferencesNode->PutBool(CameraCalViewPreferencePage::SAVE_OUTPUT_REGARDLESS_OF_CALIBRATION_NODE_NAME, m_Ui->m_SaveOutputBeforeCalibrationCheckBox->isChecked());
m_CameraCalViewPreferencesNode->PutBool(CameraCalViewPreferencePage::RESET_CALIBRATION_IF_NODE_CHANGES_NODE_NAME, m_Ui->m_ResetCalibrationIfNodeChangesCheckBox->isChecked());
return true;
}
......@@ -435,7 +435,7 @@ void CameraCalViewPreferencePage::Update()
m_Ui->m_OutputDirLineEdit->setText(path);
m_Ui->m_ModelIsStationaryCheckBox->setChecked(m_CameraCalViewPreferencesNode->GetBool(CameraCalViewPreferencePage::MODEL_IS_STATIONARY_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultModelIsStationary));
m_Ui->m_CameraIsStationaryCheckBox->setChecked(m_CameraCalViewPreferencesNode->GetBool(CameraCalViewPreferencePage::CAMERA_IS_STATIONARY_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultCameraIsStationary));
m_Ui->m_SaveOutputBeforeCalibrationCheckBox->setChecked(m_CameraCalViewPreferencesNode->GetBool(CameraCalViewPreferencePage::SAVE_OUTPUT_BEFORE_CALIBRATION_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultSaveOutputBeforeCalibration));
m_Ui->m_SaveOutputBeforeCalibrationCheckBox->setChecked(m_CameraCalViewPreferencesNode->GetBool(CameraCalViewPreferencePage::SAVE_OUTPUT_REGARDLESS_OF_CALIBRATION_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultSaveOutputRegardlessOfCalibration));
m_Ui->m_ResetCalibrationIfNodeChangesCheckBox->setChecked(m_CameraCalViewPreferencesNode->GetBool(CameraCalViewPreferencePage::RESET_CALIBRATION_IF_NODE_CHANGES_NODE_NAME, niftk::NiftyCalVideoCalibrationManager::DefaultResetCalibrationIfNodeChanges));
}
......
......@@ -65,7 +65,7 @@ public:
static const QString OUTPUT_DIR_NODE_NAME;
static const QString MODEL_IS_STATIONARY_NODE_NAME;
static const QString CAMERA_IS_STATIONARY_NODE_NAME;
static const QString SAVE_OUTPUT_BEFORE_CALIBRATION_NODE_NAME;
static const QString SAVE_OUTPUT_REGARDLESS_OF_CALIBRATION_NODE_NAME;
static const QString RESET_CALIBRATION_IF_NODE_CHANGES_NODE_NAME;
CameraCalViewPreferencePage();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment