ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkPipelineMonitorImageFilter.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 itkPipelineMonitorImageFilter_h
19 #define itkPipelineMonitorImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
25 
66  template <typename TImageType>
67  class ITK_TEMPLATE_EXPORT PipelineMonitorImageFilter :
68  public ImageToImageFilter< TImageType, TImageType>
69  {
70  public:
71 
76 
77  typedef typename TImageType::PointType PointType;
79  typedef typename TImageType::SpacingType SpacingType;
80  typedef typename TImageType::Pointer InputImagePointer;
81  typedef typename TImageType::ConstPointer InputImageConstPointer;
82  typedef typename Superclass::InputImageRegionType ImageRegionType;
83 
84  typedef std::vector<typename TImageType::RegionType> RegionVectorType;
85 
87  itkNewMacro(Self);
88 
91 
101  itkSetMacro( ClearPipelineOnGenerateOutputInformation, bool );
102  itkGetMacro( ClearPipelineOnGenerateOutputInformation, bool );
103  itkBooleanMacro( ClearPipelineOnGenerateOutputInformation );
105 
106 
112  bool VerifyAllInputCanStream(int expectedNumber);
113 
114 
118  bool VerifyAllInputCanNotStream();
119 
123  bool VerifyAllNoUpdate();
124 
125  bool VerifyDownStreamFilterExecutedPropagation();
126 
136  bool VerifyInputFilterExecutedStreaming(int expectedNumber);
137 
142  bool VerifyInputFilterMatchedUpdateOutputInformation();
143 
145  bool VerifyInputFilterBufferedRequestedRegions();
146 
147  bool VerifyInputFilterMatchedRequestedRegions();
148 
149  bool VerifyInputFilterRequestedLargestRegion();
150 
151 
152  unsigned int GetNumberOfUpdates(void) const { return m_NumberOfUpdates; }
153  RegionVectorType GetOutputRequestedRegions(void) const {return m_OutputRequestedRegions;}
154  RegionVectorType GetInputRequestedRegions(void) const {return m_InputRequestedRegions;}
155  RegionVectorType GetUpdatedBufferedRegions(void) const {return m_UpdatedBufferedRegions; }
156  RegionVectorType GetUpdatedRequestedRegions(void) const {return m_UpdatedRequestedRegions; }
157 
158  itkGetConstMacro(UpdatedOutputOrigin, PointType);
159  itkGetConstMacro(UpdatedOutputDirection, DirectionType);
160  itkGetConstMacro(UpdatedOutputSpacing, SpacingType);
161  itkGetConstMacro(UpdatedOutputLargestPossibleRegion, ImageRegionType);
162 
165  void ClearPipelineSavedInformation();
166 
167 
171  virtual void GenerateOutputInformation() ITK_OVERRIDE;
172  virtual void PropagateRequestedRegion(DataObject *output) ITK_OVERRIDE;
173  virtual void EnlargeOutputRequestedRegion( DataObject *output) ITK_OVERRIDE;
174  virtual void GenerateInputRequestedRegion(void) ITK_OVERRIDE;
175  virtual void GenerateData(void) ITK_OVERRIDE;
177 
178  protected:
179 
181 
182  // ~PipelineMonitorImageFilter() { } default implementation OK
183 
184  void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE;
185  private:
186 
187  PipelineMonitorImageFilter(const PipelineMonitorImageFilter &); // not implemented
188  void operator=(const PipelineMonitorImageFilter &); // not implemented
189 
190  bool m_ClearPipelineOnGenerateOutputInformation;
191 
192  unsigned int m_NumberOfUpdates;
193 
194  unsigned int m_NumberOfClearPipeline;
195 
196  RegionVectorType m_OutputRequestedRegions;
197  RegionVectorType m_InputRequestedRegions;
198  RegionVectorType m_UpdatedBufferedRegions;
199  RegionVectorType m_UpdatedRequestedRegions;
200 
201  PointType m_UpdatedOutputOrigin;
202  DirectionType m_UpdatedOutputDirection;
203  SpacingType m_UpdatedOutputSpacing;
204  ImageRegionType m_UpdatedOutputLargestPossibleRegion;
205  };
206 
207 } // end namespace itk
208 
209 #ifndef ITK_MANUAL_INSTANTIATION
210 #include "itkPipelineMonitorImageFilter.hxx"
211 #endif
212 
213 #endif //itkPipelineMonitorImageFilter_hxx
RegionVectorType GetUpdatedRequestedRegions(void) const
Light weight base class for most itk classes.
RegionVectorType GetInputRequestedRegions(void) const
RegionVectorType GetOutputRequestedRegions(void) const
ImageToImageFilter< TImageType, TImageType > Superclass
Enables monitoring, recording and debugging of the pipeline execution and information exchange...
RegionVectorType GetUpdatedBufferedRegions(void) const
std::vector< typename TImageType::RegionType > RegionVectorType
Superclass::InputImageRegionType ImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for filters that take an image as input and overwrite that image as the output...
Base class for all data objects in ITK.