ITK  5.2.0
Insight Toolkit
itkPointSetToImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkPointSetToImageFilter_h
19 #define itkPointSetToImageFilter_h
20 
21 #include "itkImageSource.h"
22 #include "itkConceptChecking.h"
23 
24 namespace itk
25 {
34 template <typename TInputPointSet, typename TOutputImage>
35 class ITK_TEMPLATE_EXPORT PointSetToImageFilter : public ImageSource<TOutputImage>
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_MOVE(PointSetToImageFilter);
39 
45  using SizeType = typename TOutputImage::SizeType;
46  using OutputImageType = TOutputImage;
47  using OutputImagePointer = typename OutputImageType::Pointer;
48  using ValueType = typename OutputImageType::ValueType;
49 
51  itkNewMacro(Self);
52 
54  itkTypeMacro(PointSetToImageFilter, ImageSource);
55 
57  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
58 
60  using InputPointSetType = TInputPointSet;
61  using InputPointSetPointer = typename InputPointSetType::Pointer;
62  using InputPointSetConstPointer = typename InputPointSetType::ConstPointer;
63 
65  static constexpr unsigned int InputPointSetDimension = InputPointSetType::PointDimension;
66  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
67 
69  using SpacingType = typename TOutputImage::SpacingType;
72 
74  using Superclass::SetInput;
75  virtual void
76  SetInput(const InputPointSetType * input);
77 
78  virtual void
79  SetInput(unsigned int, const InputPointSetType * pointset);
80 
81  const InputPointSetType *
82  GetInput();
83 
84  const InputPointSetType *
85  GetInput(unsigned int idx);
86 
91  itkSetMacro(Spacing, SpacingType);
92  virtual void
93  SetSpacing(const double * v);
95 
96  virtual void
97  SetSpacing(const float * v);
98 
103  itkGetConstReferenceMacro(Spacing, SpacingType);
104 
108  itkSetMacro(Direction, DirectionType);
109  itkGetConstReferenceMacro(Direction, DirectionType);
111 
116  itkSetMacro(Origin, PointType);
117  virtual void
118  SetOrigin(const double * v);
120 
121  virtual void
122  SetOrigin(const float * v);
123 
128  itkGetConstReferenceMacro(Origin, PointType);
129 
136  itkSetMacro(InsideValue, ValueType);
137  itkGetConstMacro(InsideValue, ValueType);
139 
146  itkSetMacro(OutsideValue, ValueType);
147  itkGetConstMacro(OutsideValue, ValueType);
149 
151  itkSetMacro(Size, SizeType);
152  itkGetConstMacro(Size, SizeType);
154 
155 protected:
157  ~PointSetToImageFilter() override = default;
158 
159  void
161  {} // do nothing
162  void
163  GenerateData() override;
164 
166 
168 
170 
172 
175 
176  void
177  PrintSelf(std::ostream & os, Indent indent) const override;
178 };
179 } // end namespace itk
180 
181 #ifndef ITK_MANUAL_INSTANTIATION
182 # include "itkPointSetToImageFilter.hxx"
183 #endif
184 
185 #endif
itk::PointSetToImageFilter::SizeType
typename TOutputImage::SizeType SizeType
Definition: itkPointSetToImageFilter.h:45
itk::PointSetToImageFilter::PointType
typename TOutputImage::PointType PointType
Definition: itkPointSetToImageFilter.h:71
itk::GTest::TypedefsAndConstructors::Dimension2::DirectionType
ImageBaseType::DirectionType DirectionType
Definition: itkGTestTypedefsAndConstructors.h:52
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::PointSetToImageFilter
Base class for filters that take a PointSet as input and produce an image as output....
Definition: itkPointSetToImageFilter.h:35
itkImageSource.h
itk::Size
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:69
itk::PointSetToImageFilter::m_OutsideValue
ValueType m_OutsideValue
Definition: itkPointSetToImageFilter.h:174
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itkConceptChecking.h
itk::PointSetToImageFilter::SpacingType
typename TOutputImage::SpacingType SpacingType
Definition: itkPointSetToImageFilter.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::PointSetToImageFilter::DirectionType
typename TOutputImage::DirectionType DirectionType
Definition: itkPointSetToImageFilter.h:70
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::PointSetToImageFilter::m_Spacing
SpacingType m_Spacing
Definition: itkPointSetToImageFilter.h:169
itk::PointSetToImageFilter::m_InsideValue
ValueType m_InsideValue
Definition: itkPointSetToImageFilter.h:173
itk::PointSetToImageFilter::InputPointSetConstPointer
typename InputPointSetType::ConstPointer InputPointSetConstPointer
Definition: itkPointSetToImageFilter.h:62
itk::PointSetToImageFilter::m_Direction
DirectionType m_Direction
Definition: itkPointSetToImageFilter.h:171
itk::PointSetToImageFilter::ValueType
typename OutputImageType::ValueType ValueType
Definition: itkPointSetToImageFilter.h:48
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::PointSetToImageFilter::InputPointSetPointer
typename InputPointSetType::Pointer InputPointSetPointer
Definition: itkPointSetToImageFilter.h:61
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::PointSetToImageFilter::m_Size
SizeType m_Size
Definition: itkPointSetToImageFilter.h:165
itk::PointSetToImageFilter::m_Origin
PointType m_Origin
Definition: itkPointSetToImageFilter.h:167
itk::PointSetToImageFilter::InputPointSetType
TInputPointSet InputPointSetType
Definition: itkPointSetToImageFilter.h:60
itk::PointSetToImageFilter::GenerateOutputInformation
void GenerateOutputInformation() override
Definition: itkPointSetToImageFilter.h:160
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90