23#include "vnl/vnl_matrix.h"
41template <
typename TValue>
42class ITK_TEMPLATE_EXPORT
Array2D :
public vnl_matrix<TValue>
54 Array2D(
unsigned int numberOfRows,
unsigned int numberOfCols);
58 Array2D(
unsigned int numberOfRows,
unsigned int numberOfCols,
const TValue & initialValue);
67 : vnl_matrix<TValue>(std::move(array))
86 this->VnlMatrixType::operator=(std::move(array));
105 return this->operator()(
static_cast<unsigned int>(row),
static_cast<unsigned int>(col));
112 this->operator()(
static_cast<unsigned int>(row),
static_cast<unsigned int>(col)) = value;
123template <
typename TValue>
127 const unsigned int numberOfRows = arr.rows();
128 const unsigned int numberOfColumns = arr.cols();
130 for (
unsigned int r = 0; r < numberOfRows; ++r)
133 if (numberOfColumns >= 1)
135 const unsigned int lastColumn = numberOfColumns - 1;
136 for (
unsigned int c = 0; c < lastColumn; ++c)
138 os << arr(r, c) <<
", ";
140 os << arr(r, lastColumn);
142 os <<
']' << std::endl;
150ITKCommon_EXPORT std::ostream &
153ITKCommon_EXPORT std::ostream &
158#ifndef ITK_MANUAL_INSTANTIATION
159# include "itkArray2D.hxx"
Pixel-wise addition of two images.
Array2D class representing a 2D array.
Array2D(const Self &)=default
Self & operator=(const VnlMatrixType &matrix)
void SetElement(SizeValueType row, SizeValueType col, const TValue &value)
~Array2D() override=default
vnl_matrix< TValue > VnlMatrixType
Array2D(unsigned int numberOfRows, unsigned int numberOfCols, const TValue &initialValue)
void Fill(TValue const &v)
Self & operator=(Self &&array) noexcept
Self & operator=(const Self &)=default
Array2D(unsigned int numberOfRows, unsigned int numberOfCols)
void SetSize(unsigned int m, unsigned int n)
const TValue & GetElement(SizeValueType row, SizeValueType col) const
Array2D(const VnlMatrixType &matrix)
Array2D(Self &&array) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
unsigned long SizeValueType