ITK  4.3.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 >
43 class ITK_EXPORT ImportImageFilter:
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;
133 
136  virtual void GenerateData();
137 
141  virtual void GenerateOutputInformation();
142 
150  virtual void EnlargeOutputRequestedRegion(DataObject *output);
151 
152 private:
153  ImportImageFilter(const ImportImageFilter &); //purposely not implemented
154  void operator=(const ImportImageFilter &); //purposely not implemented
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
172