Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __cmtkAffineMultiChannelRegistrationFunctional_h_included_
00034 #define __cmtkAffineMultiChannelRegistrationFunctional_h_included_
00035
00036 #include <cmtkconfig.h>
00037
00038 #include <Registration/cmtkTemplateMultiChannelRegistrationFunctional.h>
00039
00040 #include <Base/cmtkAffineXform.h>
00041 #include <Base/cmtkVolumeClipping.h>
00042 #include <Base/cmtkTransformedVolumeAxes.h>
00043
00044 #include <System/cmtkThreads.h>
00045 #include <System/cmtkMutexLock.h>
00046
00047 namespace
00048 cmtk
00049 {
00050
00053
00055 template<class MetricFunctionalClass>
00056 class SplineWarpMultiChannelRegistrationFunctional;
00057
00059 template<class TMultiChannelMetricFunctional>
00060 class AffineMultiChannelRegistrationFunctional :
00062 public TemplateMultiChannelRegistrationFunctional<AffineXform,TMultiChannelMetricFunctional>
00063 {
00064 public:
00066 typedef AffineMultiChannelRegistrationFunctional<TMultiChannelMetricFunctional> Self;
00067
00069 typedef SmartPointer<Self> SmartPtr;
00070
00072 typedef TemplateMultiChannelRegistrationFunctional<AffineXform,TMultiChannelMetricFunctional> Superclass;
00073
00075 AffineMultiChannelRegistrationFunctional()
00076 : m_NumberOfThreads( Threads::GetNumberOfThreads() )
00077 {
00078 }
00079
00081 void InitTransformation( const bool alignCenters );
00082
00095 virtual typename Self::ReturnType Evaluate();
00096
00097 private:
00099 VolumeClipping m_VolumeClipper;
00100
00117 bool ClipZ ( const VolumeClipping& clipper, const Vector3D& origin, int& start, int& end ) const;
00118
00145 bool ClipX( const VolumeClipping& clipper, const Vector3D& origin, int& start, int &end ) const;
00146
00163 bool ClipY( const VolumeClipping& clipper, const Vector3D& origin, int& start, int& end ) const;
00164
00166 const size_t m_NumberOfThreads;
00167
00169 class EvaluateThreadParameters :
00171 public ThreadParameters<Self>
00172 {
00173 public:
00175 const TransformedVolumeAxes* m_TransformedAxes;
00176
00178 int m_StartZ;
00179
00181 int m_EndZ;
00182 };
00183
00185 static void EvaluateThreadFunction( void* args, const size_t taskIdx, const size_t taskCnt, const size_t threadIdx, const size_t );
00186
00187 #ifdef CMTK_BUILD_SMP
00188
00189 MutexLock m_MetricDataMutex;
00190 #endif
00191
00193 template<class MetricFunctionalClass> friend class SplineWarpMultiChannelRegistrationFunctional;
00194 };
00195
00197
00198 }
00199
00200 #include "cmtkAffineMultiChannelRegistrationFunctional.txx"
00201
00202 #endif // #ifndef __cmtkAffineMultiChannelRegistrationFunctional_h_included_