ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkImportImageFilter.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 itkImportImageFilter_h
19 #define itkImportImageFilter_h
20 
21 #include "itkImageSource.h"
22 
23 namespace itk
24 {
42 template< typename TPixel, unsigned int VImageDimension = 2 >
44  public ImageSource< Image< TPixel, VImageDimension > >
45 {
46 public:
52 
58 
60  itkNewMacro(Self);
61 
64 
67 
70 
74 
76  typedef TPixel OutputImagePixelType;
77 
79  TPixel * GetImportPointer();
80 
88  void SetImportPointer(TPixel *ptr, SizeValueType num,
89  bool LetFilterManageMemory);
90 
95  void SetRegion(const RegionType & region)
96  { if ( m_Region != region ) { m_Region = region; this->Modified(); } }
97 
102  const RegionType & GetRegion() const
103  { return m_Region; }
104 
107  itkSetMacro(Spacing, SpacingType);
108  itkGetConstReferenceMacro(Spacing, SpacingType);
109  itkSetVectorMacro(Spacing, const float, VImageDimension);
111 
114  itkSetMacro(Origin, OriginType);
115  itkGetConstReferenceMacro(Origin, OriginType);
116  itkSetVectorMacro(Origin, const float, VImageDimension);
118 
120 
123  virtual void SetDirection(const DirectionType & direction);
124 
127  itkGetConstReferenceMacro(Direction, DirectionType);
128 
129 protected:
132  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
133 
136  virtual void GenerateData() ITK_OVERRIDE;
137 
141  virtual void GenerateOutputInformation() ITK_OVERRIDE;
142 
150  virtual void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
151 
152 private:
153  ImportImageFilter(const ImportImageFilter &) ITK_DELETE_FUNCTION;
154  void operator=(const ImportImageFilter &) ITK_DELETE_FUNCTION;
155 
160 
161  TPixel * m_ImportPointer;
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkImportImageFilter.hxx"
169 #endif
170 
171 #endif
TPixel * GetImportPointer()
virtual void GenerateOutputInformation() override
void SetImportPointer(TPixel *ptr, SizeValueType num, bool LetFilterManageMemory)
SmartPointer< const Self > ConstPointer
void PrintSelf(std::ostream &os, Indent indent) const override
Represent the size (bounds) of a n-dimensional image.
Definition: itkSize.h:52
Matrix< SpacePrecisionType, VImageDimension, VImageDimension > DirectionType
Index< VImageDimension > IndexType
virtual void EnlargeOutputRequestedRegion(DataObject *output) override
An image region represents a structured region of data.
virtual void SetDirection(const DirectionType &direction)
Base class for all process objects that output image data.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
virtual void GenerateData() override
Import data from a standard C array into an itk::Image.
ImageRegion< VImageDimension > RegionType
ImageSource< OutputImageType > Superclass
virtual void Modified() const
OutputImageType::Pointer OutputImagePointer
const RegionType & GetRegion() const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetRegion(const RegionType &region)
OutputImageType::SpacingType SpacingType
OutputImageType::PointType OriginType
Image< TPixel, VImageDimension > OutputImageType
Size< VImageDimension > SizeType
Base class for all data objects in ITK.
Templated n-dimensional image class.
Definition: itkImage.h:75
SmartPointer< Self > Pointer