ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkContinuousIndex.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkContinuousIndex_h
19 #define itkContinuousIndex_h
20 
21 #include "itkPoint.h"
22 #include "itkIndex.h"
23 
24 namespace itk
25 {
44 template< typename TCoordRep = double, unsigned int VIndexDimension = 2 >
45 class ContinuousIndex:public Point< TCoordRep, VIndexDimension >
46 {
47 public:
51 
54  using ValueType = TCoordRep;
55  using CoordRepType = TCoordRep;
56 
58  static constexpr unsigned int IndexDimension = VIndexDimension;
59 
62 
64  using BaseArray = typename Superclass::BaseArray;
65  using Iterator = typename BaseArray::Iterator;
66  using ConstIterator = typename BaseArray::ConstIterator;
67 
69  ContinuousIndex() = default;
70  ContinuousIndex(const ContinuousIndex &) = default;
71  ContinuousIndex(ContinuousIndex &&) = default;
72  ContinuousIndex & operator=(const ContinuousIndex &) = default;
74  ~ContinuousIndex() = default;
76 
79 
81  ContinuousIndex(const IndexType & index)
82  {
83  for ( unsigned int i = 0; i < VIndexDimension; i++ )
84  {
85  ( *this )[i] = TCoordRep(index[i]);
86  }
87  }
88 };
89 } // namespace itk
91 
92 #endif
static constexpr unsigned int IndexDimension
FixedArray< TCoordRep, NPointDimension > BaseArray
Definition: itkPoint.h:70
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
ContinuousIndex(const ValueType r[IndexDimension])
~ContinuousIndex()=default
ContinuousIndex()=default
A templated class holding a point in n-Dimensional image space.
ContinuousIndex & operator=(const ContinuousIndex &)=default
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
ContinuousIndex(const IndexType &index)