ITK  5.0.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  using PointType = typename TImageType::PointType;
79  using SpacingType = typename TImageType::SpacingType;
80  using InputImagePointer = typename TImageType::Pointer;
81  using InputImageConstPointer = typename TImageType::ConstPointer;
82  using ImageRegionType = typename Superclass::InputImageRegionType;
83 
84  using RegionVectorType = std::vector<typename TImageType::RegionType>;
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() const { return m_NumberOfUpdates; }
153  RegionVectorType GetOutputRequestedRegions() const {return m_OutputRequestedRegions;}
154  RegionVectorType GetInputRequestedRegions() const {return m_InputRequestedRegions;}
155  RegionVectorType GetUpdatedBufferedRegions() const {return m_UpdatedBufferedRegions; }
156  RegionVectorType GetUpdatedRequestedRegions() 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  void GenerateOutputInformation() override;
172  void PropagateRequestedRegion(DataObject *output) override;
173  void EnlargeOutputRequestedRegion( DataObject *output) override;
174  void GenerateInputRequestedRegion() override;
175  void GenerateData() override;
177 
178  protected:
179 
181 
182  // ~PipelineMonitorImageFilter() { } default implementation OK
183 
184  void PrintSelf(std::ostream &os, Indent indent) const override;
185  private:
186 
188  void operator=(const PipelineMonitorImageFilter &) = delete;
189 
191 
192  unsigned int m_NumberOfUpdates;
193 
195 
200 
205  };
206 
207 } // end namespace itk
208 
209 #ifndef ITK_MANUAL_INSTANTIATION
210 #include "itkPipelineMonitorImageFilter.hxx"
211 #endif
212 
213 #endif //itkPipelineMonitorImageFilter_hxx
Light weight base class for most itk classes.
RegionVectorType GetOutputRequestedRegions() const
typename Superclass::InputImageRegionType ImageRegionType
typename TImageType::ConstPointer InputImageConstPointer
Enables monitoring, recording and debugging of the pipeline execution and information exchange...
RegionVectorType GetUpdatedRequestedRegions() const
std::vector< typename TImageType::RegionType > RegionVectorType
RegionVectorType GetInputRequestedRegions() const
typename TImageType::DirectionType DirectionType
RegionVectorType GetUpdatedBufferedRegions() const
typename TImageType::PointType PointType
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
typename TImageType::SpacingType SpacingType
Base class for filters that take an image as input and overwrite that image as the output...
typename TImageType::Pointer InputImagePointer
Base class for all data objects in ITK.