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 __itkLevelSetEvolutionUpdateLevelSetsThreader_h 00019 #define __itkLevelSetEvolutionUpdateLevelSetsThreader_h 00020 00021 #include "itkCompensatedSummation.h" 00022 #include "itkDomainThreader.h" 00023 #include "itkLevelSetDenseImageBase.h" 00024 #include "itkThreadedImageRegionPartitioner.h" 00025 00026 namespace itk 00027 { 00028 00036 template< class TLevelSet, class TDomainPartitioner, class TLevelSetEvolution > 00037 class LevelSetEvolutionUpdateLevelSetsThreader 00038 {}; 00039 00040 // For dense image level set. 00041 template< class TImage, class TLevelSetEvolution > 00042 class LevelSetEvolutionUpdateLevelSetsThreader< LevelSetDenseImageBase< TImage >, ThreadedImageRegionPartitioner< TImage::ImageDimension >, TLevelSetEvolution > 00043 : public DomainThreader< ThreadedImageRegionPartitioner< TImage::ImageDimension >, TLevelSetEvolution > 00044 { 00045 public: 00047 typedef LevelSetEvolutionUpdateLevelSetsThreader Self; 00048 typedef DomainThreader< ThreadedImageRegionPartitioner< TImage::ImageDimension >, TLevelSetEvolution > Superclass; 00049 typedef SmartPointer< Self > Pointer; 00050 typedef SmartPointer< const Self > ConstPointer; 00051 00053 itkTypeMacro( LevelSetEvolutionUpdateLevelSetsThreader, DomainThreader ); 00054 00056 itkNewMacro( Self ); 00057 00059 typedef typename Superclass::DomainType DomainType; 00060 typedef typename Superclass::AssociateType AssociateType; 00061 00063 typedef TLevelSetEvolution LevelSetEvolutionType; 00064 typedef typename LevelSetEvolutionType::LevelSetContainerType LevelSetContainerType; 00065 typedef typename LevelSetEvolutionType::LevelSetType LevelSetType; 00066 typedef typename LevelSetEvolutionType::LevelSetImageType LevelSetImageType; 00067 typedef typename LevelSetEvolutionType::LevelSetOutputRealType LevelSetOutputRealType; 00068 00069 protected: 00070 LevelSetEvolutionUpdateLevelSetsThreader(); 00071 00072 virtual void BeforeThreadedExecution(); 00073 00074 virtual void ThreadedExecution( const DomainType & imageSubRegion, const ThreadIdType threadId ); 00075 00076 virtual void AfterThreadedExecution(); 00077 00078 typedef CompensatedSummation< LevelSetOutputRealType > RMSChangeAccumulatorType; 00079 typedef std::vector< RMSChangeAccumulatorType > RMSChangeAccumulatorPerThreadType; 00080 00081 RMSChangeAccumulatorPerThreadType m_RMSChangeAccumulatorPerThread; 00082 00083 private: 00084 LevelSetEvolutionUpdateLevelSetsThreader( const Self & ); // purposely not implemented 00085 void operator=( const Self & ); // purposely not implemented 00086 }; 00087 00088 } // end namespace itk 00089 00090 #ifndef ITK_MANUAL_INSTANTIATION 00091 #include "itkLevelSetEvolutionUpdateLevelSetsThreader.hxx" 00092 #endif 00093 00094 #endif 00095