ITK
4.0.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 __itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader_h 00019 #define __itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader_h 00020 00021 #include "itkImageToImageMetricv4GetValueAndDerivativeThreader.h" 00022 #include "itkThreadedImageRegionPartitioner.h" 00023 00024 namespace itk 00025 { 00026 00032 template< class TImageToImageMetric, class TNeighborhoodCorrelationMetric > 00033 class ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader 00034 : public ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetric::VirtualImageDimension >, TImageToImageMetric > 00035 { 00036 public: 00038 typedef ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader Self; 00039 typedef ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedImageRegionPartitioner< TImageToImageMetric::VirtualImageDimension >, TImageToImageMetric > 00040 Superclass; 00041 typedef SmartPointer< Self > Pointer; 00042 typedef SmartPointer< const Self > ConstPointer; 00043 00044 itkTypeMacro( ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader, ImageToImageMetricv4GetValueAndDerivativeThreader ); 00045 00046 itkNewMacro( Self ); 00047 00048 typedef typename Superclass::DomainType DomainType; 00049 typedef typename Superclass::AssociateType AssociateType; 00050 00051 typedef typename Superclass::VirtualImageType VirtualImageType; 00052 typedef typename Superclass::VirtualPointType VirtualPointType; 00053 typedef typename Superclass::FixedImagePointType FixedImagePointType; 00054 typedef typename Superclass::FixedImagePixelType FixedImagePixelType; 00055 typedef typename Superclass::FixedImageGradientType FixedImageGradientType; 00056 typedef typename Superclass::MovingImagePointType MovingImagePointType; 00057 typedef typename Superclass::MovingImagePixelType MovingImagePixelType; 00058 typedef typename Superclass::MovingImageGradientType MovingImageGradientType; 00059 typedef typename Superclass::MeasureType MeasureType; 00060 typedef typename Superclass::DerivativeType DerivativeType; 00061 typedef typename Superclass::DerivativeValueType DerivativeValueType; 00062 00063 typedef TNeighborhoodCorrelationMetric NeighborhoodCorrelationMetricType; 00064 typedef typename NeighborhoodCorrelationMetricType::ScanIteratorType ScanIteratorType; 00065 typedef typename NeighborhoodCorrelationMetricType::ScanMemType ScanMemType; 00066 typedef typename NeighborhoodCorrelationMetricType::ScanParametersType ScanParametersType; 00067 typedef typename NeighborhoodCorrelationMetricType::ImageRegionType ImageRegionType; 00068 typedef typename NeighborhoodCorrelationMetricType::InternalComputationValueType InternalComputationValueType; 00069 typedef typename NeighborhoodCorrelationMetricType::SumQueueType SumQueueType; 00070 typedef typename NeighborhoodCorrelationMetricType::ImageDimensionType ImageDimensionType; 00071 typedef typename NeighborhoodCorrelationMetricType::JacobianType JacobianType; 00072 typedef typename NeighborhoodCorrelationMetricType::NumberOfParametersType NumberOfParametersType; 00073 00074 protected: 00075 ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader() {} 00076 00080 virtual bool ProcessPoint( 00081 const VirtualPointType & itkNotUsed(virtualPoint), 00082 const FixedImagePointType & itkNotUsed(mappedFixedPoint), 00083 const FixedImagePixelType & itkNotUsed(mappedFixedPixelValue), 00084 const FixedImageGradientType & itkNotUsed(mappedFixedImageGradient), 00085 const MovingImagePointType & itkNotUsed(mappedMovingPoint), 00086 const MovingImagePixelType & itkNotUsed(mappedMovingPixelValue), 00087 const MovingImageGradientType & itkNotUsed(mappedMovingImageGradient), 00088 MeasureType & itkNotUsed(metricValueReturn), 00089 DerivativeType & itkNotUsed(localDerivativeReturn), 00090 const ThreadIdType itkNotUsed(threadID) ) const 00091 { 00092 return false; 00093 } 00094 00095 virtual void ThreadedExecution( const DomainType& domain, 00096 const ThreadIdType threadId ); 00097 00100 void UpdateQueues(const ScanIteratorType &scanIt, 00101 ScanMemType &scanMem, const ScanParametersType &scanParameters, 00102 const ThreadIdType threadID) const; 00103 00104 void UpdateQueuesAtBeginningOfLine( 00105 const ScanIteratorType &scanIt, ScanMemType &scanMem, 00106 const ScanParametersType &scanParameters, 00107 const ThreadIdType threadID) const; 00108 00112 void UpdateQueuesToNextScanWindow( 00113 const ScanIteratorType &scanIt, ScanMemType &scanMem, 00114 const ScanParametersType &scanParameters, 00115 const ThreadIdType threadID) const; 00116 00119 bool ComputeInformationFromQueues( 00120 const ScanIteratorType &scanIt, ScanMemType &scanMem, 00121 const ScanParametersType &scanParameters, 00122 const ThreadIdType threadID) const; 00123 00124 void ComputeMovingTransformDerivative( 00125 const ScanIteratorType &scanIt, ScanMemType &scanMem, 00126 const ScanParametersType &scanParameters, DerivativeType &deriv, 00127 MeasureType &local_cc, const ThreadIdType threadID) const; 00128 00129 private: 00130 ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader( const Self & ); // purposely not implemented 00131 void operator=( const Self & ); // purposely not implemented 00132 }; 00133 00134 } // end namespace itk 00135 00136 #ifndef ITK_MANUAL_INSTANTIATION 00137 #include "itkANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreader.hxx" 00138 #endif 00139 00140 #endif 00141