ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageRegionSplitter.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 __itkImageRegionSplitter_h
00019 #define __itkImageRegionSplitter_h
00020 
00021 #include "itkImageRegion.h"
00022 #include "itkObjectFactory.h"
00023 
00024 namespace itk
00025 {
00062 template< unsigned int VImageDimension >
00063 class ITK_EXPORT ImageRegionSplitter:public Object
00064 {
00065 public:
00067   typedef ImageRegionSplitter        Self;
00068   typedef Object                     Superclass;
00069   typedef SmartPointer< Self >       Pointer;
00070   typedef SmartPointer< const Self > ConstPointer;
00071 
00073   itkNewMacro(Self);
00074 
00076   itkTypeMacro(ImageRegionSplitter, Object);
00077 
00079   itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);
00080 
00082   static unsigned int GetImageDimension()
00083   { return VImageDimension; }
00084 
00086   typedef Index< VImageDimension >           IndexType;
00087 
00089   typedef Size< VImageDimension >          SizeType;
00090   typedef typename SizeType::SizeValueType SizeValueType;
00091 
00093   typedef ImageRegion< VImageDimension > RegionType;
00094 
00101   virtual unsigned int GetNumberOfSplits(const RegionType & region,
00102                                          unsigned int requestedNumber);
00103 
00107   virtual RegionType GetSplit(unsigned int i, unsigned int numberOfPieces,
00108                               const RegionType & region);
00109 
00110 protected:
00111   ImageRegionSplitter() {}
00112   ~ImageRegionSplitter() {}
00113   void PrintSelf(std::ostream & os, Indent indent) const;
00114 
00115 private:
00116   ImageRegionSplitter(const ImageRegionSplitter &); //purposely not implemented
00117   void operator=(const ImageRegionSplitter &);      //purposely not implemented
00118 };
00119 } // end namespace itk
00120 
00121 // Define instantiation macro for this template.
00122 #define ITK_TEMPLATE_ImageRegionSplitter(_, EXPORT, TypeX, TypeY)                   \
00123   namespace itk                                                                     \
00124   {                                                                                 \
00125   _( 1 ( class EXPORT ImageRegionSplitter< ITK_TEMPLATE_1 TypeX > ) )               \
00126   namespace Templates                                                               \
00127   {                                                                                 \
00128   typedef ImageRegionSplitter< ITK_TEMPLATE_1 TypeX > ImageRegionSplitter##TypeY; \
00129   }                                                                                 \
00130   }
00131 
00132 #if ITK_TEMPLATE_EXPLICIT
00133 #include "Templates/itkImageRegionSplitter+-.h"
00134 #endif
00135 
00136 #if ITK_TEMPLATE_TXX
00137 #include "itkImageRegionSplitter.hxx"
00138 #endif
00139 
00140 #endif
00141