ITK  4.3.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< class TImage, class TMaskImage = TImage >
55 class ITK_EXPORT ImageToListSampleFilter:
56  public ProcessObject
57 {
58 public:
64 
67 
69  itkNewMacro(Self);
70 
72  typedef TImage ImageType;
73  typedef typename ImageType::Pointer ImagePointer;
74  typedef typename ImageType::ConstPointer ImageConstPointer;
75  typedef typename ImageType::PixelType PixelType;
76  typedef typename MeasurementVectorPixelTraits<
78 
80  typedef TMaskImage MaskImageType;
81  typedef typename MaskImageType::Pointer MaskImagePointer;
82  typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
83  typedef typename MaskImageType::PixelType MaskPixelType;
84 
87 
89  unsigned int GetMeasurementVectorSize() const;
90 
92  using Superclass::SetInput;
93  void SetInput(const ImageType *image);
94 
95  const ImageType * GetInput() const;
96 
98  void SetMaskImage(const MaskImageType *image);
99 
100  const MaskImageType * GetMaskImage() const;
101 
105  const ListSampleType * GetOutput() const;
106 
111  itkSetMacro(MaskValue, MaskPixelType);
112  itkGetConstMacro(MaskValue, MaskPixelType);
114 
115 protected:
118  void PrintSelf(std::ostream & os, Indent indent) const;
119 
123  using Superclass::MakeOutput;
124  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
125 
127  virtual void GenerateData();
128 
131  virtual void GenerateInputRequestedRegion()
133 
134  virtual void GenerateOutputInformation();
135 
136 private:
137  ImageToListSampleFilter(const Self &); //purposely not implemented
138  void operator=(const Self &); //purposely not implemented
139 
140  MaskPixelType m_MaskValue;
141 }; // end of class ImageToListSampleFilter
142 } // end of namespace Statistics
143 } // end of namespace itk
144 
145 #ifndef ITK_MANUAL_INSTANTIATION
146 #include "itkImageToListSampleFilter.hxx"
147 #endif
148 
149 #endif
150