Skip to content

Commit

Permalink
ENH: Add GetParameterMaps and SetParameterMaps to ParameterObject
Browse files Browse the repository at this point in the history
Equivalent to `GetParameterMaps()` and `SetParameterMap(const ParameterMapVectorType &)`.

It appears more readable in these cases, to use the plural form "maps", rather than "map". Moreover, `SetParameterMaps` may be easier to use because it is not overloading.
  • Loading branch information
N-Dekker committed Mar 21, 2023
1 parent 4335006 commit 38b6152
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Core/Main/elxParameterObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ ParameterObject::SetParameterMap(const ParameterMapVectorType & parameterMaps)
}


/**
* ********************* SetParameterMaps *********************
*/

void
ParameterObject::SetParameterMaps(const ParameterMapVectorType & parameterMaps)
{
if (m_ParameterMaps != parameterMaps)
{
m_ParameterMaps = parameterMaps;
this->Modified();
}
}


/**
* ********************* AddParameterMap *********************
*/
Expand Down
8 changes: 8 additions & 0 deletions Core/Main/elxParameterObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class ParameterObject : public itk::DataObject
void
SetParameterMap(const ParameterMapVectorType & parameterMaps);
void
SetParameterMaps(const ParameterMapVectorType & parameterMaps);
void
AddParameterMap(const ParameterMapType & parameterMap);
const ParameterMapType &
GetParameterMap(const unsigned int index) const;
Expand All @@ -70,6 +72,12 @@ class ParameterObject : public itk::DataObject
return m_ParameterMaps;
}

const ParameterMapVectorType &
GetParameterMaps() const
{
return m_ParameterMaps;
}

unsigned int
GetNumberOfParameterMaps() const
{
Expand Down

0 comments on commit 38b6152

Please sign in to comment.