ITK  6.0.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  * https://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;
48  using ValueType = typename OutputImageType::ValueType;
49 
51  itkNewMacro(Self);
52 
54  itkOverrideGetNameOfClassMacro(PointSetToImageFilter);
55 
57  using typename Superclass::OutputImageRegionType;
58 
60  using InputPointSetType = TInputPointSet;
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);
96  virtual void
97  SetSpacing(const float * v);
98 
103  itkGetConstReferenceMacro(Spacing, SpacingType);
104 
108  itkSetMacro(Direction, DirectionType);
109  itkGetConstReferenceMacro(Direction, DirectionType);
116  itkSetMacro(Origin, PointType);
117  virtual void
118  SetOrigin(const double * v);
121  virtual void
122  SetOrigin(const float * v);
123 
128  itkGetConstReferenceMacro(Origin, PointType);
129 
136  itkSetMacro(InsideValue, ValueType);
137  itkGetConstMacro(InsideValue, ValueType);
146  itkSetMacro(OutsideValue, ValueType);
147  itkGetConstMacro(OutsideValue, ValueType);
151  itkSetMacro(Size, SizeType);
152  itkGetConstMacro(Size, SizeType);
155 protected:
157  ~PointSetToImageFilter() override = default;
158 
159  void
161  {} // do nothing
162  void
163  GenerateData() override;
164 
165  SizeType m_Size{};
166 
167  PointType m_Origin{};
168 
169  SpacingType m_Spacing{};
170 
171  DirectionType m_Direction{};
172 
173  ValueType m_InsideValue{};
174  ValueType m_OutsideValue{};
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::PointSetToImageFilter::SizeType
typename TOutputImage::SizeType SizeType
Definition: itkPointSetToImageFilter.h:45
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
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::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::InputPointSetConstPointer
typename InputPointSetType::ConstPointer InputPointSetConstPointer
Definition: itkPointSetToImageFilter.h:62
itk::PointSetToImageFilter::ValueType
typename OutputImageType::ValueType ValueType
Definition: itkPointSetToImageFilter.h:48
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:139
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