ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkPathToImageFilter.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 itkPathToImageFilter_h
19 #define itkPathToImageFilter_h
20 
21 #include "itkImageSource.h"
22 #include "itkConceptChecking.h"
23 
24 namespace itk
25 {
35 template< typename TInputPath, typename TOutputImage >
36 class ITK_TEMPLATE_EXPORT PathToImageFilter:public ImageSource< TOutputImage >
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_ASSIGN(PathToImageFilter);
40 
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(PathToImageFilter, ImageSource);
52 
54  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
55  using InputPathType = TInputPath;
56  using InputPathPointer = typename InputPathType::Pointer;
57  using InputPathConstPointer = typename InputPathType::ConstPointer;
58  using OutputImageType = TOutputImage;
59  using OutputImagePointer = typename OutputImageType::Pointer;
61  using ValueType = typename OutputImageType::ValueType;
62 
64  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
65 
67  using Superclass::SetInput;
68  virtual void SetInput(const InputPathType *path);
69 
70  virtual void SetInput(unsigned int, const TInputPath *path);
71 
72  const InputPathType * GetInput();
73 
74  const InputPathType * GetInput(unsigned int idx);
75 
80  virtual void SetSpacing(const double *spacing);
81 
82  virtual void SetSpacing(const float *spacing);
83 
84  virtual const double * GetSpacing() const;
85 
88  itkSetMacro(PathValue, ValueType);
89  itkGetConstMacro(PathValue, ValueType);
90  itkSetMacro(BackgroundValue, ValueType);
91  itkGetConstMacro(BackgroundValue, ValueType);
93 
98  virtual void SetOrigin(const double *origin);
99 
100  virtual void SetOrigin(const float *origin);
101 
102  virtual const double * GetOrigin() const;
103 
105  itkSetMacro(Size, SizeType);
106  itkGetConstMacro(Size, SizeType);
108 
109 protected:
111  ~PathToImageFilter() override = default;
112 
113  void GenerateOutputInformation() override {} // do nothing
114  void GenerateData() override;
115 
117  double m_Spacing[OutputImageDimension];
118  double m_Origin[OutputImageDimension];
121 
122  void PrintSelf(std::ostream & os, Indent indent) const override;
123 };
124 } // end namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 #include "itkPathToImageFilter.hxx"
128 #endif
129 
130 #endif
typename OutputImageType::Pointer OutputImagePointer
typename OutputImageType::ValueType ValueType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
Base class for filters that take a Path as input and produce an image as output. Base class for filte...
typename OutputImageType::SizeType SizeType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
typename InputPathType::ConstPointer InputPathConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void GenerateOutputInformation() override
typename InputPathType::Pointer InputPathPointer