ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkJointHistogramMutualInformationComputeJointPDFThreaderBase.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 __itkJointHistogramMutualInformationComputeJointPDFThreaderBase_h
00019 #define __itkJointHistogramMutualInformationComputeJointPDFThreaderBase_h
00020 
00021 #include "itkDomainThreader.h"
00022 #include "itkImage.h"
00023 
00024 namespace itk
00025 {
00026 
00035 template < class TDomainPartitioner, class TJointHistogramMetric >
00036 class JointHistogramMutualInformationComputeJointPDFThreaderBase
00037   : public DomainThreader< TDomainPartitioner, TJointHistogramMetric >
00038 {
00039 public:
00041   typedef JointHistogramMutualInformationComputeJointPDFThreaderBase  Self;
00042   typedef DomainThreader< TDomainPartitioner, TJointHistogramMetric > Superclass;
00043   typedef SmartPointer< Self >                                        Pointer;
00044   typedef SmartPointer< const Self >                                  ConstPointer;
00045 
00046   itkTypeMacro( JointHistogramMutualInformationComputeJointPDFThreaderBase, DomainThreader );
00047 
00049   typedef typename Superclass::DomainType    DomainType;
00050   typedef typename Superclass::AssociateType AssociateType;
00051 
00053   typedef TJointHistogramMetric                                JointHistogramMetricType;
00054   typedef typename JointHistogramMetricType::VirtualImageType  VirtualImageType;
00055   typedef typename JointHistogramMetricType::VirtualIndexType  VirtualIndexType;
00056   typedef typename JointHistogramMetricType::VirtualPointType  VirtualPointType;
00057   typedef typename JointHistogramMetricType::JointPDFType      JointPDFType;
00058   typedef typename JointHistogramMetricType::JointPDFIndexType JointPDFIndexType;
00059   typedef typename JointHistogramMetricType::JointPDFPointType JointPDFPointType;
00060   typedef typename JointHistogramMetricType::JointPDFValueType JointPDFValueType;
00061 
00062   typedef typename JointHistogramMetricType::InternalComputationValueType InternalComputationValueType;
00063 
00064 protected:
00065   JointHistogramMutualInformationComputeJointPDFThreaderBase();
00066 
00068   virtual void BeforeThreadedExecution();
00069 
00071   virtual void ProcessPoint( const VirtualIndexType & virtualIndex,
00072                              const VirtualPointType & virtualPoint,
00073                              const ThreadIdType threadId );
00074 
00076   virtual void AfterThreadedExecution();
00077 
00078   typedef Image< SizeValueType, 2 >                   JointHistogramType;
00079   std::vector< typename JointHistogramType::Pointer > m_JointHistogramPerThread;
00080   std::vector< SizeValueType >                        m_JointHistogramCountPerThread;
00081 
00082 private:
00083   JointHistogramMutualInformationComputeJointPDFThreaderBase( const Self & ); // purposely not implemented
00084   void operator=( const Self & ); // purposely not implemented
00085 };
00086 
00087 } // end namespace itk
00088 
00089 #endif
00090 
00091 #ifndef ITK_MANUAL_INSTANTIATION
00092 #include "itkJointHistogramMutualInformationComputeJointPDFThreaderBase.hxx"
00093 #endif
00094