ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkPipelineMonitorImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkPipelineMonitorImageFilter_h
00019 #define __itkPipelineMonitorImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 
00023 namespace itk {
00024 
00064  template <class TImageType>
00065    class PipelineMonitorImageFilter :
00066     public ImageToImageFilter< TImageType, TImageType>
00067  {
00068  public:
00069 
00070    typedef PipelineMonitorImageFilter                  Self;
00071    typedef ImageToImageFilter<TImageType, TImageType>  Superclass;
00072    typedef SmartPointer<Self>                          Pointer;
00073    typedef SmartPointer<const Self>                    ConstPointer;
00074 
00075    typedef typename TImageType::PointType             PointType;
00076    typedef typename TImageType::DirectionType         DirectionType;
00077    typedef typename TImageType::SpacingType           SpacingType;
00078    typedef typename TImageType::Pointer               InputImagePointer;
00079    typedef typename TImageType::ConstPointer          InputImageConstPointer;
00080    typedef typename Superclass::InputImageRegionType  ImageRegionType;
00081 
00082    typedef std::vector<typename TImageType::RegionType> RegionVectorType;
00083 
00085    itkNewMacro(Self);
00086 
00088    itkTypeMacro(PipelineMonitorImageFilter,InPlaceImageFilter);
00089 
00099    itkSetMacro( ClearPipelineOnGenerateOutputInformation, bool );
00100    itkGetMacro( ClearPipelineOnGenerateOutputInformation, bool );
00101    itkBooleanMacro( ClearPipelineOnGenerateOutputInformation );
00103 
00104 
00110    bool VerifyAllInputCanStream(int expectedNumber);
00111 
00112 
00116    bool VerifyAllInputCanNotStream(void);
00117 
00121    bool VerifyAllNoUpdate(void);
00122 
00123    bool VerifyDownStreamFilterExecutedPropagation(void);
00124 
00134    bool VerifyInputFilterExecutedStreaming(int expectedNumber);
00135 
00140    bool VerifyInputFilterMatchedUpdateOutputInformation(void);
00141 
00143    bool VerifyInputFilterBufferedRequestedRegions(void);
00144 
00145    bool VerifyInputFilterMatchedRequestedRegions(void);
00146 
00147    bool VerifyInputFilterRequestedLargestRegion(void);
00148 
00149 
00150    unsigned int GetNumberOfUpdates(void) const { return m_NumberOfUpdates; }
00151    RegionVectorType GetOutputRequestedRegions(void) const {return m_OutputRequestedRegions;}
00152    RegionVectorType GetInputRequestedRegions(void) const {return m_InputRequestedRegions;}
00153    RegionVectorType GetUpdatedBufferedRegions(void) const {return m_UpdatedBufferedRegions; }
00154    RegionVectorType GetUpdatedRequestedRegions(void) const {return m_UpdatedRequestedRegions; }
00155 
00156 
00159    void ClearPipelineSavedInformation(void);
00160 
00161 
00165    virtual void GenerateOutputInformation(void);
00166    virtual void PropagateRequestedRegion(DataObject *output);
00167    virtual void EnlargeOutputRequestedRegion( DataObject *output);
00168    virtual void GenerateInputRequestedRegion(void);
00169    virtual void GenerateData(void);
00171 
00172  protected:
00173 
00174    PipelineMonitorImageFilter(void);
00175 
00176    // ~PipelineMonitorImageFilter() { } default implementation OK
00177 
00178    void PrintSelf(std::ostream &os, Indent indent) const;
00179  private:
00180 
00181    PipelineMonitorImageFilter(const PipelineMonitorImageFilter &); // not implemented
00182    void operator=(const PipelineMonitorImageFilter &); // not implemented
00183 
00184    bool m_ClearPipelineOnGenerateOutputInformation;
00185 
00186    unsigned int m_NumberOfUpdates;
00187 
00188    unsigned int m_NumberOfClearPipeline;
00189 
00190    RegionVectorType m_OutputRequestedRegions;
00191    RegionVectorType m_InputRequestedRegions;
00192    RegionVectorType m_UpdatedBufferedRegions;
00193    RegionVectorType m_UpdatedRequestedRegions;
00194 
00195    PointType       m_UpdatedOutputOrigin;
00196    DirectionType   m_UpdatedOutputDirection;
00197    SpacingType     m_UpdatedOutputSpacing;
00198    ImageRegionType m_UpdatedOutputLargestPossibleRegion;
00199  };
00200 
00201 } // end namespace itk
00202 
00203 #ifndef ITK_MANUAL_INSTANTIATION
00204 #include "itkPipelineMonitorImageFilter.hxx"
00205 #endif
00206 
00207 #endif //__itkPipelineMonitorImageFilter_hxx
00208