ITK  5.2.0
Insight Toolkit
itkImageToListSampleFilter.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 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 {
55 template <typename TImage, typename TMaskImage = TImage>
56 class ITK_TEMPLATE_EXPORT ImageToListSampleFilter : public ProcessObject
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(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
91  GetMeasurementVectorSize() const;
92 
94  using Superclass::SetInput;
95  void
96  SetInput(const ImageType * image);
97 
98  const ImageType *
99  GetInput() const;
100 
102  void
103  SetMaskImage(const MaskImageType * image);
104 
105  const MaskImageType *
106  GetMaskImage() const;
107 
111  const ListSampleType *
112  GetOutput() const;
113 
118  itkSetMacro(MaskValue, MaskPixelType);
119  itkGetConstMacro(MaskValue, MaskPixelType);
121 
122 protected:
124  ~ImageToListSampleFilter() override = default;
125  void
126  PrintSelf(std::ostream & os, Indent indent) const override;
127 
131  using Superclass::MakeOutput;
133  MakeOutput(DataObjectPointerArraySizeType idx) override;
134 
136  void
137  GenerateData() override;
138 
141  void
142  GenerateInputRequestedRegion() override;
143 
144  void
145  GenerateOutputInformation() override;
146 
147 private:
149 }; // end of class ImageToListSampleFilter
150 } // end of namespace Statistics
151 } // end of namespace itk
152 
153 #ifndef ITK_MANUAL_INSTANTIATION
154 # include "itkImageToListSampleFilter.hxx"
155 #endif
156 
157 #endif
itk::Statistics::ImageToListSampleFilter::ImagePointer
typename ImageType::Pointer ImagePointer
Definition: itkImageToListSampleFilter.h:75
itk::Statistics::ImageToListSampleFilter::ImageConstPointer
typename ImageType::ConstPointer ImageConstPointer
Definition: itkImageToListSampleFilter.h:76
itk::Statistics::ImageToListSampleFilter::MeasurementVectorType
typename MeasurementVectorPixelTraits< PixelType >::MeasurementVectorType MeasurementVectorType
Definition: itkImageToListSampleFilter.h:78
itk::Statistics::ListSample
This class is the native implementation of the a Sample with an STL container.
Definition: itkListSample.h:51
itkPixelTraits.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ProcessObject::DataObjectPointerArraySizeType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Definition: itkProcessObject.h:193
itk::Statistics::ImageToListSampleFilter::MaskImageConstPointer
typename MaskImageType::ConstPointer MaskImageConstPointer
Definition: itkImageToListSampleFilter.h:83
itk::Statistics::MeasurementVectorPixelTraits::MeasurementVectorType
TPixelType MeasurementVectorType
Definition: itkMeasurementVectorTraits.h:441
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkProcessObject.h
itkDataObjectDecorator.h
itk::Statistics::ImageToListSampleFilter
The class takes an image as input and generates a list sample as output.
Definition: itkImageToListSampleFilter.h:56
itk::Statistics::ImageToListSampleFilter::MaskPixelType
typename MaskImageType::PixelType MaskPixelType
Definition: itkImageToListSampleFilter.h:84
itkListSample.h
itk::Statistics::ImageToListSampleFilter::ImageType
TImage ImageType
Definition: itkImageToListSampleFilter.h:74
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::ProcessObject
class ITK_FORWARD_EXPORT ProcessObject
Definition: itkDataObject.h:41
itk::Statistics::ImageToListSampleFilter::PixelType
typename ImageType::PixelType PixelType
Definition: itkImageToListSampleFilter.h:77
itk::Statistics::ImageToListSampleFilter::m_MaskValue
MaskPixelType m_MaskValue
Definition: itkImageToListSampleFilter.h:148
itk::Statistics::ImageToListSampleFilter::MaskImageType
TMaskImage MaskImageType
Definition: itkImageToListSampleFilter.h:81
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::Statistics::ImageToListSampleFilter::MaskImagePointer
typename MaskImageType::Pointer MaskImagePointer
Definition: itkImageToListSampleFilter.h:82