Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkRigidRegistrationPreset.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKRIGIDREGISTRATIONPRESET_H_HEADER
18 #define MITKRIGIDREGISTRATIONPRESET_H_HEADER
19 
21 #include <vtkXMLParser.h>
22 
23 #include <list>
24 #include <map>
25 #include <string>
26 
27 #include "mitkCommon.h"
28 #include <itkArray.h>
29 
30 namespace mitk
31 {
47  {
48  public:
51 
55  bool LoadPreset();
59  bool LoadPreset(std::string fileName);
63  itk::Array<double> getTransformValues(std::string name);
67  itk::Array<double> getMetricValues(std::string name);
71  itk::Array<double> getOptimizerValues(std::string name);
75  itk::Array<double> getInterpolatorValues(std::string name);
76 
77  std::list<std::string> &getAvailablePresets();
78 
82  std::map<std::string, itk::Array<double>> &getTransformValuesPresets();
86  std::map<std::string, itk::Array<double>> &getMetricValuesPresets();
90  std::map<std::string, itk::Array<double>> &getOptimizerValuesPresets();
94  std::map<std::string, itk::Array<double>> &getInterpolatorValuesPresets();
102  bool newPresets(std::map<std::string, itk::Array<double>> newTransformValues,
103  std::map<std::string, itk::Array<double>> newMetricValues,
104  std::map<std::string, itk::Array<double>> newOptimizerValues,
105  std::map<std::string, itk::Array<double>> newInterpolatorValues,
106  std::string fileName = "");
107 
108  private:
112  void StartElement(const char *elementName, const char **atts) override;
113 
117  // bool saveXML(mitk::XMLWriter& xmlWriter);
121  bool save();
125  // void saveTransformValues(mitk::XMLWriter& xmlWriter, std::string item);
129  // void saveMetricValues(mitk::XMLWriter& xmlWriter, std::string item);
133  // void saveOptimizerValues(mitk::XMLWriter& xmlWriter, std::string item);
137  // void saveInterpolatorValues(mitk::XMLWriter& xmlWriter, std::string item);
138 
142  itk::Array<double> loadTransformValues(itk::Array<double> transformValues, double transform, const char **atts);
146  itk::Array<double> loadMetricValues(itk::Array<double> metricValues, double metric, const char **atts);
150  itk::Array<double> loadOptimizerValues(itk::Array<double> optimizerValues, double optimizer, const char **atts);
154  itk::Array<double> loadInterpolatorValues(
155  itk::Array<double> interpolatorValues /*, double interpolator, const char **atts*/);
156 
160  std::string ReadXMLStringAttribut(std::string name, const char **atts);
161 
162  std::string m_Name;
163  std::map<std::string, itk::Array<double>> m_TransformValues;
164  std::map<std::string, itk::Array<double>> m_MetricValues;
165  std::map<std::string, itk::Array<double>> m_OptimizerValues;
166  std::map<std::string, itk::Array<double>> m_InterpolatorValues;
167  std::list<std::string> m_LoadedPresets;
168 
169  std::string m_XmlFileName;
170  };
171 }
172 #endif
Class to load and save parameter presets for rigid registration.
#define MITKRIGIDREGISTRATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map(const InputImageType *input, const RegistrationType *registration, bool throwOnOutOfInputAreaError=false, const double &paddingValue=0, const ResultImageGeometryType *resultGeometry=NULL, bool throwOnMappingError=true, const double &errorValue=0, mitk::ImageMappingInterpolator::Type interpolatorType=mitk::ImageMappingInterpolator::Linear)