ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImageToListSampleFilter.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 itkImageToListSampleFilter_h
19 #define itkImageToListSampleFilter_h
20 
21 #include "itkListSample.h"
22 #include "itkPixelTraits.h"
23 #include "itkProcessObject.h"
24 #include "itkDataObjectDecorator.h"
25 
26 namespace itk
27 {
28 namespace Statistics
29 {
54 template< typename TImage, typename TMaskImage = TImage >
55 class ITK_TEMPLATE_EXPORT ImageToListSampleFilter:
56  public ProcessObject
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_ASSIGN(ImageToListSampleFilter);
60 
66 
69 
71  itkNewMacro(Self);
72 
74  using ImageType = TImage;
75  using ImagePointer = typename ImageType::Pointer;
76  using ImageConstPointer = typename ImageType::ConstPointer;
77  using PixelType = typename ImageType::PixelType;
79 
81  using MaskImageType = TMaskImage;
82  using MaskImagePointer = typename MaskImageType::Pointer;
83  using MaskImageConstPointer = typename MaskImageType::ConstPointer;
84  using MaskPixelType = typename MaskImageType::PixelType;
85 
88 
90  unsigned int GetMeasurementVectorSize() const;
91 
93  using Superclass::SetInput;
94  void SetInput(const ImageType *image);
95 
96  const ImageType * GetInput() const;
97 
99  void SetMaskImage(const MaskImageType *image);
100 
101  const MaskImageType * GetMaskImage() const;
102 
106  const ListSampleType * GetOutput() const;
107 
112  itkSetMacro(MaskValue, MaskPixelType);
113  itkGetConstMacro(MaskValue, MaskPixelType);
115 
116 protected:
118  ~ImageToListSampleFilter() override = default;
119  void PrintSelf(std::ostream & os, Indent indent) const override;
120 
124  using Superclass::MakeOutput;
125  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
126 
128  void GenerateData() override;
129 
132  void GenerateInputRequestedRegion() override;
133 
134  void GenerateOutputInformation() override;
135 
136 private:
138 }; // end of class ImageToListSampleFilter
139 } // end of namespace Statistics
140 } // end of namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 #include "itkImageToListSampleFilter.hxx"
144 #endif
145 
146 #endif
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
The class takes an image as input and generates a list sample as output.
typename MaskImageType::ConstPointer MaskImageConstPointer
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:40
typename MaskImageType::PixelType MaskPixelType
This class is the native implementation of the a Sample with an STL container.
Definition: itkListSample.h:51
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename ImageType::ConstPointer ImageConstPointer
typename MeasurementVectorPixelTraits< PixelType >::MeasurementVectorType MeasurementVectorType
SmartPointer< Self > Pointer
typename MaskImageType::Pointer MaskImagePointer