Class to load and save parameter presets for rigid registration. More...
#include <mitkRigidRegistrationTestPreset.h>
Public Member Functions | |
RigidRegistrationTestPreset () | |
~RigidRegistrationTestPreset () | |
bool | LoadPreset () |
Tries to find mitkRigidRegistrationTestPresets.xml in /mitk/Config and loads all presets stored in this file. | |
bool | LoadPreset (std::string fileName) |
Tries to open preset xml file fileName and loads all presets stored in this file. | |
itk::Array< double > | getTransformValues (std::string name) |
Returns an array including all all transform values belonging to preset name. | |
itk::Array< double > | getMetricValues (std::string name) |
Returns an array including all all metric values belonging to preset name. | |
itk::Array< double > | getOptimizerValues (std::string name) |
Returns an array including all all optimizer values belonging to preset name. | |
itk::Array< double > | getInterpolatorValues (std::string name) |
Returns an array including all interpolator values belonging to preset name. | |
std::map< std::string, itk::Array< double > > & | getTransformValuesPresets () |
Returns a map with all preset names and their according transform values as an array. | |
std::map< std::string, itk::Array< double > > & | getMetricValuesPresets () |
Returns a map with all preset names and their according metric values as an array. | |
std::map< std::string, itk::Array< double > > & | getOptimizerValuesPresets () |
Returns a map with all preset names and their according optimizer values as an array. | |
std::map< std::string, itk::Array< double > > & | getInterpolatorValuesPresets () |
Returns a map with all preset names and their according interpolator values as an array. | |
bool | newPresets (std::map< std::string, itk::Array< double > > newTransformValues, std::map< std::string, itk::Array< double > > newMetricValues, std::map< std::string, itk::Array< double > > newOptimizerValues, std::map< std::string, itk::Array< double > > newInterpolatorValues, std::string fileName="") |
Saves new presets in the previous opened xml file or in the new fileName location. |
Class to load and save parameter presets for rigid registration.
This class stores parameter presets for rigid registration applications. To that belong parameters for transformations, metrics, optimizer and interpolators. The presets will be stored in a xml file. Existing presets can be opened with LoadPreset() and saved with newPresets(...).
Definition at line 42 of file mitkRigidRegistrationTestPreset.h.
mitk::RigidRegistrationTestPreset::RigidRegistrationTestPreset | ( | ) |
Definition at line 26 of file mitkRigidRegistrationTestPreset.cpp.
{ m_Name = ""; m_XmlFileName = "mitkRigidRegistrationTestPresets.xml"; }
mitk::RigidRegistrationTestPreset::~RigidRegistrationTestPreset | ( | ) |
Definition at line 32 of file mitkRigidRegistrationTestPreset.cpp.
{ }
itk::Array< double > mitk::RigidRegistrationTestPreset::getInterpolatorValues | ( | std::string | name ) |
Returns an array including all interpolator values belonging to preset name.
Definition at line 161 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), and mitkRigidRegistrationTestPresetTest().
{
return m_InterpolatorValues[name];
}
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationTestPreset::getInterpolatorValuesPresets | ( | ) |
Returns a map with all preset names and their according interpolator values as an array.
Definition at line 181 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationTestPresetTest().
{
return m_InterpolatorValues;
}
itk::Array< double > mitk::RigidRegistrationTestPreset::getMetricValues | ( | std::string | name ) |
Returns an array including all all metric values belonging to preset name.
Definition at line 151 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), mitk::PyramidalRegistrationMethod::GenerateData2(), and mitkRigidRegistrationTestPresetTest().
{
return m_MetricValues[name];
}
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationTestPreset::getMetricValuesPresets | ( | ) |
Returns a map with all preset names and their according metric values as an array.
Definition at line 171 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationTestPresetTest().
{
return m_MetricValues;
}
itk::Array< double > mitk::RigidRegistrationTestPreset::getOptimizerValues | ( | std::string | name ) |
Returns an array including all all optimizer values belonging to preset name.
Definition at line 156 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), mitk::RegistrationInterfaceCommand< TRegistration, TPixel >::Execute(), mitk::PyramidalRegistrationMethod::GenerateData2(), and mitkRigidRegistrationTestPresetTest().
{
return m_OptimizerValues[name];
}
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationTestPreset::getOptimizerValuesPresets | ( | ) |
Returns a map with all preset names and their according optimizer values as an array.
Definition at line 176 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationTestPresetTest().
{
return m_OptimizerValues;
}
itk::Array< double > mitk::RigidRegistrationTestPreset::getTransformValues | ( | std::string | name ) |
Returns an array including all all transform values belonging to preset name.
Definition at line 146 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), mitk::RegistrationInterfaceCommand< TRegistration, TPixel >::Execute(), mitk::PyramidalRegistrationMethod::GenerateData2(), and mitkRigidRegistrationTestPresetTest().
{
return m_TransformValues[name];
}
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationTestPreset::getTransformValuesPresets | ( | ) |
Returns a map with all preset names and their according transform values as an array.
Definition at line 166 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationParameter(), QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationTestPresetTest().
{
return m_TransformValues;
}
bool mitk::RigidRegistrationTestPreset::LoadPreset | ( | std::string | fileName ) |
Tries to open preset xml file fileName and loads all presets stored in this file.
Definition at line 53 of file mitkRigidRegistrationTestPreset.cpp.
References MITK_INFO.
{ if ( fileName.empty() ) return false; vtkXMLParser::SetFileName( fileName.c_str() ); m_XmlFileName = fileName; if ( !vtkXMLParser::Parse() ) { #ifdef INTERDEBUG MITK_INFO<<"RigidRegistrationTestPreset::LoadPreset xml file cannot parse!"<<std::endl; #endif } return true; }
bool mitk::RigidRegistrationTestPreset::LoadPreset | ( | ) |
Tries to find mitkRigidRegistrationTestPresets.xml in /mitk/Config and loads all presets stored in this file.
Definition at line 36 of file mitkRigidRegistrationTestPreset.cpp.
References mitk::StandardFileLocations::AddDirectoryForSearch(), mitk::StandardFileLocations::FindFile(), mitk::StandardFileLocations::GetInstance(), and MITK_ROOT.
Referenced by mitk::RegistrationInterfaceCommand< TRegistration, TPixel >::Execute(), mitkRigidRegistrationTestPresetTest(), and QmitkRigidRegistrationSelectorView::QmitkRigidRegistrationSelectorView().
{ std::string location1 = MITK_ROOT; std::string location2 = "/QFunctionalities/QmitkRigidRegistration"; std::string location = location1 + location2; mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch(location.c_str(), true); std::string xmlFileName = mitk::StandardFileLocations::GetInstance()->FindFile("mitkRigidRegistrationTestPresets.xml", "Config"); if (!xmlFileName.empty()) { m_XmlFileName = xmlFileName; return LoadPreset(m_XmlFileName); } else return false; }
bool mitk::RigidRegistrationTestPreset::newPresets | ( | std::map< std::string, itk::Array< double > > | newTransformValues, |
std::map< std::string, itk::Array< double > > | newMetricValues, | ||
std::map< std::string, itk::Array< double > > | newOptimizerValues, | ||
std::map< std::string, itk::Array< double > > | newInterpolatorValues, | ||
std::string | fileName = "" |
||
) |
Saves new presets in the previous opened xml file or in the new fileName location.
Every old entry will be removed from the xml file and replaced by the ones stored in the parameter maps. Make sure you have the old presets as well as the new ones within the maps.
Definition at line 218 of file mitkRigidRegistrationTestPreset.cpp.
Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationTestPresetTest().
{ if ( !fileName.empty() ) { m_XmlFileName = fileName; } m_TransformValues = newTransformValues; m_MetricValues = newMetricValues; m_OptimizerValues = newOptimizerValues; m_InterpolatorValues = newInterpolatorValues; return save(); }