ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkThreadedImageRegionPartitioner.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 __itkThreadedImageRegionPartitioner_h
00019 #define __itkThreadedImageRegionPartitioner_h
00020 
00021 #include "itkThreadedDomainPartitioner.h"
00022 #include "itkImageRegion.h"
00023 
00024 namespace itk
00025 {
00026 
00062 template <unsigned int VDimension>
00063 class ITK_EXPORT ThreadedImageRegionPartitioner
00064   : public ThreadedDomainPartitioner< ImageRegion<VDimension> >
00065 {
00066 public:
00068   typedef ThreadedImageRegionPartitioner                                   Self;
00069   typedef ThreadedDomainPartitioner<ImageRegion<VDimension> >              Superclass;
00070   typedef SmartPointer<Self>                                               Pointer;
00071   typedef SmartPointer<const Self>                                         ConstPointer;
00072 
00074   itkNewMacro(Self);
00075 
00077   itkTypeMacro(ThreadedImageRegionPartitioner, ThreadedDomainPartitioner);
00078 
00080   typedef typename Superclass::DomainType  DomainType;
00081 
00083   // typedef TImageRegion ImageRegionType;
00084   itkStaticConstMacro(ImageDimension, unsigned int, VDimension);
00085 
00086   typedef ImageRegion<VDimension>   ImageRegionType;
00087   typedef Size<VDimension>          SizeType;
00088   typedef Index<VDimension>         IndexType;
00089 
00096   virtual
00097   ThreadIdType PartitionDomain(const ThreadIdType i,
00098                            const ThreadIdType requestedTotal,
00099                            const DomainType& completeRegion,
00100                            DomainType& subRegion) const;
00101 
00102 protected:
00103   ThreadedImageRegionPartitioner();
00104   virtual ~ThreadedImageRegionPartitioner();
00105 
00106 private:
00107   ThreadedImageRegionPartitioner(const Self&); //purposely not implemented
00108   void operator=(const Self&); //purposely not implemented
00109 };
00110 
00111 } // end namespace itk
00112 
00113 #ifndef ITK_MANUAL_INSTANTIATION
00114 # include "itkThreadedImageRegionPartitioner.hxx"
00115 #endif
00116 
00117 #endif
00118