ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkImageRegionMultidimensionalSplitter_h 00019 #define __itkImageRegionMultidimensionalSplitter_h 00020 00021 #include "itkRegion.h" 00022 #include "itkIndex.h" 00023 #include "itkImageRegionSplitter.h" 00024 00025 namespace itk 00026 { 00058 template< unsigned int VImageDimension > 00059 class ITK_EXPORT ImageRegionMultidimensionalSplitter:public ImageRegionSplitter< VImageDimension > 00060 { 00061 public: 00063 typedef ImageRegionMultidimensionalSplitter Self; 00064 typedef ImageRegionSplitter< VImageDimension > Superclass; 00065 typedef SmartPointer< Self > Pointer; 00066 typedef SmartPointer< const Self > ConstPointer; 00067 00069 itkNewMacro(Self); 00070 00072 itkTypeMacro(ImageRegionMultidimensionalSplitter, ImageRegionSplitter); 00073 00075 itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension); 00076 00078 typedef Index< VImageDimension > IndexType; 00079 00081 typedef Size< VImageDimension > SizeType; 00082 00084 typedef ImageRegion< VImageDimension > RegionType; 00085 00092 virtual unsigned int GetNumberOfSplits(const RegionType & region, 00093 unsigned int requestedNumber); 00094 00098 virtual RegionType GetSplit(unsigned int i, unsigned int numberOfPieces, 00099 const RegionType & region); 00100 00101 protected: 00102 ImageRegionMultidimensionalSplitter() {} 00103 ~ImageRegionMultidimensionalSplitter() {} 00104 void PrintSelf(std::ostream & os, Indent indent) const; 00105 00106 private: 00107 ImageRegionMultidimensionalSplitter(const Self &); //purposely not implemented 00108 void operator=(const Self &); //purposely not implemented 00109 00110 static unsigned int ComputeSplits(unsigned int numberOfPieces, 00111 const RegionType ®ion, 00112 unsigned int splits[]); 00113 00114 }; 00115 } // end namespace itk 00116 00117 // Define instantiation macro for this template. 00118 #define ITK_TEMPLATE_ImageRegionMultidimensionalSplitter(_, EXPORT, TypeX, TypeY) \ 00119 namespace itk \ 00120 { \ 00121 _( 1 ( class EXPORT ImageRegionMultidimensionalSplitter< ITK_TEMPLATE_1 TypeX > ) ) \ 00122 namespace Templates \ 00123 { \ 00124 typedef ImageRegionMultidimensionalSplitter< ITK_TEMPLATE_1 TypeX > \ 00125 ImageRegionMultidimensionalSplitter##TypeY; \ 00126 } \ 00127 } 00128 00129 #if ITK_TEMPLATE_EXPLICIT 00130 #include "Templates/itkImageRegionMultidimensionalSplitter+-.h" 00131 #endif 00132 00133 #if ITK_TEMPLATE_TXX 00134 #include "itkImageRegionMultidimensionalSplitter.hxx" 00135 #endif 00136 00137 #endif 00138