ITK  4.2.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);
113 protected:
116  void PrintSelf(std::ostream & os, Indent indent) const;
118 
122  using Superclass::MakeOutput;
123  virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
124 
126  virtual void GenerateData();
127 
130  virtual void GenerateInputRequestedRegion()
132 
133  virtual void GenerateOutputInformation();
134 
135 private:
136  ImageToListSampleFilter(const Self &); //purposely not implemented
137  void operator=(const Self &); //purposely not implemented
138 
139  MaskPixelType m_MaskValue;
140 }; // end of class ImageToListSampleFilter
141 } // end of namespace Statistics
142 } // end of namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkImageToListSampleFilter.hxx"
146 #endif
147 
148 #endif
149