ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkStreamingImageFilter.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 __itkStreamingImageFilter_h
00019 #define __itkStreamingImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkImageRegionSplitter.h"
00023 
00024 namespace itk
00025 {
00043 template< class TInputImage, class TOutputImage >
00044 class ITK_EXPORT StreamingImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
00045 {
00046 public:
00048   typedef StreamingImageFilter                            Self;
00049   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00050   typedef SmartPointer< Self >                            Pointer;
00051   typedef SmartPointer< const Self >                      ConstPointer;
00052 
00054   itkNewMacro(Self);
00055 
00057   itkTypeMacro(StreamingImageFilter, ImageToImageFilter);
00058 
00060   typedef TInputImage                         InputImageType;
00061   typedef typename InputImageType::Pointer    InputImagePointer;
00062   typedef typename InputImageType::RegionType InputImageRegionType;
00063   typedef typename InputImageType::PixelType  InputImagePixelType;
00064 
00065   typedef TOutputImage                           OutputImageType;
00066   typedef typename OutputImageType::Pointer      OutputImagePointer;
00067   typedef typename OutputImageType::RegionType   OutputImageRegionType;
00068   typedef typename OutputImageType::PixelType    OutputImagePixelType;
00069   typedef typename Superclass::DataObjectPointer DataObjectPointer;
00070 
00072   itkStaticConstMacro(InputImageDimension, unsigned int,
00073                       InputImageType::ImageDimension);
00074   itkStaticConstMacro(OutputImageDimension, unsigned int,
00075                       OutputImageType::ImageDimension);
00077 
00079   typedef ImageRegionSplitter< itkGetStaticConstMacro(InputImageDimension) >
00080   SplitterType;
00081   typedef typename SplitterType::Pointer RegionSplitterPointer;
00082 
00085   itkSetMacro(NumberOfStreamDivisions, unsigned int);
00086 
00089   itkGetConstReferenceMacro(NumberOfStreamDivisions, unsigned int);
00090 
00092   itkSetObjectMacro(RegionSplitter, SplitterType);
00093 
00095   itkGetObjectMacro(RegionSplitter, SplitterType);
00096 
00102   virtual void UpdateOutputData(DataObject *output);
00103 
00108   virtual void PropagateRequestedRegion(DataObject *output);
00109 
00110 #ifdef ITK_USE_CONCEPT_CHECKING
00111 
00112   itkConceptMacro( SameDimensionCheck,
00113                    ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) );
00114   itkConceptMacro( InputConvertibleToOutputCheck,
00115                    ( Concept::Convertible< InputImagePixelType, OutputImagePixelType > ) );
00116 
00118 #endif
00119 protected:
00120   StreamingImageFilter();
00121   ~StreamingImageFilter();
00122   void PrintSelf(std::ostream & os, Indent indent) const;
00124 
00125 private:
00126   StreamingImageFilter(const StreamingImageFilter &); //purposely not
00127                                                       // implemented
00128   void operator=(const StreamingImageFilter &);       //purposely not
00129 
00130   // implemented
00131 
00132   unsigned int          m_NumberOfStreamDivisions;
00133   RegionSplitterPointer m_RegionSplitter;
00134 };
00135 } // end namespace itk
00136 
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkStreamingImageFilter.hxx"
00139 #endif
00140 
00141 #endif
00142