Orfeo Toolbox  4.2
itkImage.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 __itkImage_h
19 #define __itkImage_h
20 
21 #include "itkImageRegion.h"
25 #include "itkPoint.h"
26 #include "itkFixedArray.h"
27 #include "itkWeakPointer.h"
29 
30 namespace itk
31 {
74 template< typename TPixel, unsigned int VImageDimension = 2 >
75 class Image:public ImageBase< VImageDimension >
76 {
77 public:
79  typedef Image Self;
84 
86  itkNewMacro(Self);
87 
89  itkTypeMacro(Image, ImageBase);
90 
93  typedef TPixel PixelType;
94 
96  typedef TPixel ValueType;
97 
102  typedef TPixel InternalPixelType;
103 
105 
110 
114 
119  itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);
120 
124 
127 
129  typedef typename Superclass::SizeType SizeType;
131 
134 
137 
141 
146 
150 
154 
157 
163  template <typename UPixelType, unsigned int UImageDimension = VImageDimension>
164  struct Rebind
165  {
167  };
168 
169 
172  virtual void Allocate(bool initializePixels = false) ITK_OVERRIDE;
173 
176  virtual void Initialize();
177 
180  void FillBuffer(const TPixel & value);
181 
187  void SetPixel(const IndexType & index, const TPixel & value)
188  {
189  OffsetValueType offset = this->ComputeOffset(index);
190  ( *m_Buffer )[offset] = value;
191  }
192 
197  const TPixel & GetPixel(const IndexType & index) const
198  {
199  OffsetValueType offset = this->ComputeOffset(index);
200  return ( ( *m_Buffer )[offset] );
201  }
202 
207  TPixel & GetPixel(const IndexType & index)
208  {
209  OffsetValueType offset = this->ComputeOffset(index);
210  return ( ( *m_Buffer )[offset] );
211  }
212 
217  TPixel & operator[](const IndexType & index)
218  { return this->GetPixel(index); }
219 
224  const TPixel & operator[](const IndexType & index) const
225  { return this->GetPixel(index); }
226 
229  virtual TPixel * GetBufferPointer()
230  { return m_Buffer ? m_Buffer->GetBufferPointer() : ITK_NULLPTR; }
231  virtual const TPixel * GetBufferPointer() const
232  { return m_Buffer ? m_Buffer->GetBufferPointer() : ITK_NULLPTR; }
233 
236  { return m_Buffer.GetPointer(); }
237 
239  { return m_Buffer.GetPointer(); }
240 
243  void SetPixelContainer(PixelContainer *container);
244 
255  virtual void Graft(const DataObject *data);
256 
259  { return AccessorType(); }
260 
262  const AccessorType GetPixelAccessor(void) const
263  { return AccessorType(); }
264 
267  { return NeighborhoodAccessorFunctorType(); }
268 
271  { return NeighborhoodAccessorFunctorType(); }
272 
273  virtual unsigned int GetNumberOfComponentsPerPixel() const;
274 
275 protected:
276  Image();
277  void PrintSelf(std::ostream & os, Indent indent) const;
278 
279  virtual ~Image() {}
280 
287 
288 private:
289  Image(const Self &); //purposely not implemented
290  void operator=(const Self &); //purposely not implemented
291 
294 };
295 } // end namespace itk
296 
297 #ifndef ITK_MANUAL_INSTANTIATION
298 #include "itkImage.hxx"
299 #endif
300 
301 #endif

Generated at Sat Aug 30 2014 14:51:27 for Orfeo Toolbox with doxygen 1.8.3.1