Loading...
Searching...
No Matches
elxParameterObject.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef elxParameterObject_h
#define elxParameterObject_h
#include "itkObjectFactory.h"
#include "itkDataObject.h"
#include "elxMacro.h"
namespace elastix
{
// TODO: Why does the compiler not see ELASTIXLIB_API declspec in elxMacro.h?
// error: variable has incomplete type 'class ELASTIXLIB_API'
// with class ELASTIXLIB_API ParameterObject : public itk::DataObject
class ParameterObject : public itk::DataObject
{
public:
using Self = ParameterObject;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ParameterObject, itk::DataObject);
using ParameterKeyType = std::string;
using ParameterValueType = std::string;
using ParameterValueVectorType = std::vector<ParameterValueType>;
using ParameterValueVectorIterator = ParameterValueVectorType::iterator;
using ParameterMapType = std::map<ParameterKeyType, ParameterValueVectorType>;
using ParameterMapIterator = ParameterMapType::iterator;
using ParameterMapConstIterator = ParameterMapType::const_iterator;
using ParameterMapVectorType = std::vector<ParameterMapType>;
using ParameterFileNameType = std::string;
using ParameterFileNameVectorType = std::vector<ParameterFileNameType>;
using ParameterFileNameVectorIterator = ParameterFileNameVectorType::iterator;
using ParameterFileNameVectorConstIterator = ParameterFileNameVectorType::const_iterator;
/* Set/Get/Add parameter map or vector of parameter maps. */
// TODO: Use itkSetMacro for ParameterMapVectorType
void
SetParameterMap(const ParameterMapType & parameterMap);
void
SetParameterMap(const unsigned int index, const ParameterMapType & parameterMap);
[[deprecated("Instead of calling this overload, please call SetParameterMaps")]] void
SetParameterMap(const ParameterMapVectorType & parameterMaps);
void
SetParameterMaps(const ParameterMapVectorType & parameterMaps);
void
AddParameterMap(const ParameterMapType & parameterMap);
const ParameterMapType &
GetParameterMap(const unsigned int index) const;
[[deprecated("Instead of calling this member function, please call GetParameterMaps")]] const ParameterMapVectorType &
GetParameterMap() const
{
return m_ParameterMaps;
}
const ParameterMapVectorType &
GetParameterMaps() const
{
return m_ParameterMaps;
}
unsigned int
GetNumberOfParameterMaps() const
{
return static_cast<unsigned int>(m_ParameterMaps.size());
}
void
SetParameter(const unsigned int index, const ParameterKeyType & key, const ParameterValueType & value);
void
SetParameter(const unsigned int index, const ParameterKeyType & key, const ParameterValueVectorType & value);
void
SetParameter(const ParameterKeyType & key, const ParameterValueType & value);
void
SetParameter(const ParameterKeyType & key, const ParameterValueVectorType & value);
const ParameterValueVectorType &
GetParameter(const unsigned int index, const ParameterKeyType & key);
void
RemoveParameter(const unsigned int index, const ParameterKeyType & key);
void
RemoveParameter(const ParameterKeyType & key);
/* Read/Write parameter file or multiple parameter files to/from disk. */
void
ReadParameterFile(const ParameterFileNameType & parameterFileName);
[[deprecated("Instead of calling this overload, please call ReadParameterFiles")]] void
ReadParameterFile(const ParameterFileNameVectorType & parameterFileNameVector);
void
ReadParameterFiles(const ParameterFileNameVectorType & parameterFileNameVector);
void
AddParameterFile(const ParameterFileNameType & parameterFileName);
[[deprecated("Instead of calling this overload, please call WriteParameterFiles")]] void
WriteParameterFile() const;
static void
WriteParameterFile(const ParameterMapType & parameterMap, const ParameterFileNameType & parameterFileName);
void
WriteParameterFile(const ParameterFileNameType & parameterFileName) const;
[[deprecated("Instead of calling this overload, please call WriteParameterFiles")]] void
WriteParameterFile(const ParameterFileNameVectorType & parameterFileNameVector) const;
[[deprecated("Instead of calling this overload, please call WriteParameterFiles")]] static void
WriteParameterFile(const ParameterMapVectorType & parameterMapVector,
const ParameterFileNameVectorType & parameterFileNameVector);
void
WriteParameterFiles() const;
void
WriteParameterFiles(const ParameterFileNameVectorType & parameterFileNameVector) const;
static void
WriteParameterFiles(const ParameterMapVectorType & parameterMapVector,
const ParameterFileNameVectorType & parameterFileNameVector);
/* Get preconfigured parameter maps. */
static const ParameterMapType
GetDefaultParameterMap(const std::string & transformName,
const unsigned int numberOfResolutions = 4u,
const double finalGridSpacingInPhysicalUnits = 10.0);
protected:
void
PrintSelf(std::ostream & os, itk::Indent indent) const override;
private:
ParameterMapVectorType m_ParameterMaps;
};
} // namespace elastix
#endif // elxParameterObject_h
elastix::ParameterObject
Definition elxParameterObject.h:33
elastix::ParameterObject::GetNumberOfParameterMaps
unsigned int GetNumberOfParameterMaps() const
Definition elxParameterObject.h:85
elastix::ParameterObject::RemoveParameter
void RemoveParameter(const ParameterKeyType &key)
elastix::ParameterObject::ParameterFileNameVectorConstIterator
ParameterFileNameVectorType::const_iterator ParameterFileNameVectorConstIterator
Definition elxParameterObject.h:52
elastix::ParameterObject::WriteParameterFile
void WriteParameterFile() const
elastix::ParameterObject::ReadParameterFiles
void ReadParameterFiles(const ParameterFileNameVectorType &parameterFileNameVector)
elastix::ParameterObject::ReadParameterFile
void ReadParameterFile(const ParameterFileNameVectorType &parameterFileNameVector)
elastix::ParameterObject::m_ParameterMaps
ParameterMapVectorType m_ParameterMaps
Definition elxParameterObject.h:154
elastix::ParameterObject::Pointer
itk::SmartPointer< Self > Pointer
Definition elxParameterObject.h:36
elastix::ParameterObject::WriteParameterFile
static void WriteParameterFile(const ParameterMapVectorType &parameterMapVector, const ParameterFileNameVectorType &parameterFileNameVector)
elastix::ParameterObject::AddParameterFile
void AddParameterFile(const ParameterFileNameType &parameterFileName)
elastix::ParameterObject::ParameterValueType
std::string ParameterValueType
Definition elxParameterObject.h:42
elastix::ParameterObject::ParameterFileNameVectorType
std::vector< ParameterFileNameType > ParameterFileNameVectorType
Definition elxParameterObject.h:50
elastix::ParameterObject::GetParameterMap
const ParameterMapType & GetParameterMap(const unsigned int index) const
elastix::ParameterObject::SetParameterMap
void SetParameterMap(const unsigned int index, const ParameterMapType &parameterMap)
elastix::ParameterObject::GetDefaultParameterMap
static const ParameterMapType GetDefaultParameterMap(const std::string &transformName, const unsigned int numberOfResolutions=4u, const double finalGridSpacingInPhysicalUnits=10.0)
elastix::ParameterObject::ParameterFileNameVectorIterator
ParameterFileNameVectorType::iterator ParameterFileNameVectorIterator
Definition elxParameterObject.h:51
elastix::ParameterObject::RemoveParameter
void RemoveParameter(const unsigned int index, const ParameterKeyType &key)
elastix::ParameterObject::ParameterFileNameType
std::string ParameterFileNameType
Definition elxParameterObject.h:49
elastix::ParameterObject::AddParameterMap
void AddParameterMap(const ParameterMapType &parameterMap)
elastix::ParameterObject::WriteParameterFile
static void WriteParameterFile(const ParameterMapType &parameterMap, const ParameterFileNameType &parameterFileName)
elastix::ParameterObject::WriteParameterFiles
void WriteParameterFiles(const ParameterFileNameVectorType &parameterFileNameVector) const
elastix::ParameterObject::GetParameterMap
const ParameterMapVectorType & GetParameterMap() const
Definition elxParameterObject.h:73
elastix::ParameterObject::SetParameterMap
void SetParameterMap(const ParameterMapVectorType &parameterMaps)
elastix::ParameterObject::ParameterKeyType
std::string ParameterKeyType
Definition elxParameterObject.h:41
elastix::ParameterObject::ParameterMapType
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
Definition elxParameterObject.h:45
elastix::ParameterObject::GetParameterMaps
const ParameterMapVectorType & GetParameterMaps() const
Definition elxParameterObject.h:79
elastix::ParameterObject::GetParameter
const ParameterValueVectorType & GetParameter(const unsigned int index, const ParameterKeyType &key)
elastix::ParameterObject::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxParameterObject.h:37
elastix::ParameterObject::SetParameter
void SetParameter(const ParameterKeyType &key, const ParameterValueVectorType &value)
elastix::ParameterObject::WriteParameterFile
void WriteParameterFile(const ParameterFileNameVectorType &parameterFileNameVector) const
elastix::ParameterObject::ParameterValueVectorIterator
ParameterValueVectorType::iterator ParameterValueVectorIterator
Definition elxParameterObject.h:44
elastix::ParameterObject::SetParameterMaps
void SetParameterMaps(const ParameterMapVectorType &parameterMaps)
elastix::ParameterObject::ParameterValueVectorType
std::vector< ParameterValueType > ParameterValueVectorType
Definition elxParameterObject.h:43
elastix::ParameterObject::SetParameterMap
void SetParameterMap(const ParameterMapType &parameterMap)
elastix::ParameterObject::Self
ParameterObject Self
Definition elxParameterObject.h:35
elastix::ParameterObject::ParameterMapVectorType
std::vector< ParameterMapType > ParameterMapVectorType
Definition elxParameterObject.h:48
elastix::ParameterObject::ReadParameterFile
void ReadParameterFile(const ParameterFileNameType &parameterFileName)
elastix::ParameterObject::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
elastix::ParameterObject::WriteParameterFiles
void WriteParameterFiles() const
elastix::ParameterObject::SetParameter
void SetParameter(const unsigned int index, const ParameterKeyType &key, const ParameterValueVectorType &value)
elastix::ParameterObject::SetParameter
void SetParameter(const ParameterKeyType &key, const ParameterValueType &value)
elastix::ParameterObject::ParameterMapIterator
ParameterMapType::iterator ParameterMapIterator
Definition elxParameterObject.h:46
elastix::ParameterObject::WriteParameterFiles
static void WriteParameterFiles(const ParameterMapVectorType &parameterMapVector, const ParameterFileNameVectorType &parameterFileNameVector)
elastix::ParameterObject::SetParameter
void SetParameter(const unsigned int index, const ParameterKeyType &key, const ParameterValueType &value)
elastix::ParameterObject::WriteParameterFile
void WriteParameterFile(const ParameterFileNameType &parameterFileName) const
elastix::ParameterObject::ParameterMapConstIterator
ParameterMapType::const_iterator ParameterMapConstIterator
Definition elxParameterObject.h:47
elxMacro.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |