Public Member Functions

mitk::RigidRegistrationPreset Class Reference
[Classes related to rigid registration]

Class to load and save parameter presets for rigid registration. More...

#include <mitkRigidRegistrationPreset.h>

List of all members.

Public Member Functions

 RigidRegistrationPreset ()
 ~RigidRegistrationPreset ()
bool LoadPreset ()
 Tries to find mitkRigidRegistrationPresets.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.

Detailed Description

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(...).

Author:
Daniel Stein

Definition at line 42 of file mitkRigidRegistrationPreset.h.


Constructor & Destructor Documentation

mitk::RigidRegistrationPreset::RigidRegistrationPreset (  )

Definition at line 26 of file mitkRigidRegistrationPreset.cpp.

  {
    m_Name = "";
    m_XmlFileName = "mitkRigidRegistrationPresets.xml";
  }
mitk::RigidRegistrationPreset::~RigidRegistrationPreset (  )

Definition at line 32 of file mitkRigidRegistrationPreset.cpp.

  {
  }

Member Function Documentation

itk::Array< double > mitk::RigidRegistrationPreset::getInterpolatorValues ( std::string  name )

Returns an array including all interpolator values belonging to preset name.

Definition at line 162 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), and mitkRigidRegistrationPresetTest().

  {
    return m_InterpolatorValues[name];
  }
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationPreset::getInterpolatorValuesPresets (  )

Returns a map with all preset names and their according interpolator values as an array.

Definition at line 182 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationPresetTest().

  {
    return m_InterpolatorValues;
  }
itk::Array< double > mitk::RigidRegistrationPreset::getMetricValues ( std::string  name )

Returns an array including all all metric values belonging to preset name.

Definition at line 152 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), and mitkRigidRegistrationPresetTest().

  {
    return m_MetricValues[name];
  }
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationPreset::getMetricValuesPresets (  )

Returns a map with all preset names and their according metric values as an array.

Definition at line 172 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationPresetTest().

  {
    return m_MetricValues;
  }
itk::Array< double > mitk::RigidRegistrationPreset::getOptimizerValues ( std::string  name )

Returns an array including all all optimizer values belonging to preset name.

Definition at line 157 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), and mitkRigidRegistrationPresetTest().

  {
    return m_OptimizerValues[name];
  }
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationPreset::getOptimizerValuesPresets (  )

Returns a map with all preset names and their according optimizer values as an array.

Definition at line 177 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationPresetTest().

  {
    return m_OptimizerValues;
  }
itk::Array< double > mitk::RigidRegistrationPreset::getTransformValues ( std::string  name )

Returns an array including all all transform values belonging to preset name.

Definition at line 147 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationPreset(), and mitkRigidRegistrationPresetTest().

  {
    return m_TransformValues[name];
  }
std::map< std::string, itk::Array< double > > & mitk::RigidRegistrationPreset::getTransformValuesPresets (  )

Returns a map with all preset names and their according transform values as an array.

Definition at line 167 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoLoadRigidRegistrationParameter(), QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationPresetTest().

  {
    return m_TransformValues;
  }
bool mitk::RigidRegistrationPreset::LoadPreset ( std::string  fileName )

Tries to open preset xml file fileName and loads all presets stored in this file.

Definition at line 54 of file mitkRigidRegistrationPreset.cpp.

References MITK_INFO.

  {
    if ( fileName.empty() )
      return false;

    vtkXMLParser::SetFileName( fileName.c_str() );
    m_XmlFileName = fileName;

    if ( !vtkXMLParser::Parse() )
    {
  #ifdef INTERDEBUG
      MITK_INFO<<"RigidRegistrationPreset::LoadPreset xml file cannot parse!"<<std::endl;
  #endif
    }

    return true;

  }
bool mitk::RigidRegistrationPreset::LoadPreset (  )

Tries to find mitkRigidRegistrationPresets.xml in /mitk/Config and loads all presets stored in this file.

Definition at line 36 of file mitkRigidRegistrationPreset.cpp.

References mitk::StandardFileLocations::AddDirectoryForSearch(), mitk::StandardFileLocations::FindFile(), mitk::StandardFileLocations::GetInstance(), and MITK_ROOT.

Referenced by mitkRigidRegistrationPresetTest(), 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);
    mitk::StandardFileLocations::GetInstance()->AddDirectoryForSearch("/bin", true);
    std::string xmlFileName = mitk::StandardFileLocations::GetInstance()->FindFile("mitkRigidRegistrationPresets.xml", "Config");

    if (!xmlFileName.empty())
    {
      m_XmlFileName = xmlFileName;
      return LoadPreset(m_XmlFileName);
    }
    else
      return false;
  }
bool mitk::RigidRegistrationPreset::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 219 of file mitkRigidRegistrationPreset.cpp.

Referenced by QmitkRigidRegistrationSelectorView::DoSaveRigidRegistrationParameter(), and mitkRigidRegistrationPresetTest().

  {
    if ( !fileName.empty() )
    {
      m_XmlFileName = fileName;
    }
    m_TransformValues = newTransformValues;
    m_MetricValues = newMetricValues;
    m_OptimizerValues = newOptimizerValues;
    m_InterpolatorValues = newInterpolatorValues;
    return save();
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines