1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef itkANTSNeighborhoodCorrelationImageToImageMetricv4_hxx
19 #define itkANTSNeighborhoodCorrelationImageToImageMetricv4_hxx
20
21 #include "itkANTSNeighborhoodCorrelationImageToImageMetricv4.h"
22 #include "itkNumericTraits.h"
23
24 namespace itk
25 {
26
27 template<typename TFixedImage, typename TMovingImage, typename TVirtualImage, typename TInternalComputationValueType, typename TMetricTraits>
28 ANTSNeighborhoodCorrelationImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
ANTSNeighborhoodCorrelationImageToImageMetricv4()29 ::ANTSNeighborhoodCorrelationImageToImageMetricv4()
30 {
31 // initialize radius. note that a radius of 1 can be unstable
32 using RadiusValueType = typename RadiusType::SizeValueType;
33 this->m_Radius.Fill( static_cast<RadiusValueType>(2) );
34 // We have our own GetValueAndDerivativeThreader's that we want
35 // ImageToImageMetricv4 to use.
36 this->m_DenseGetValueAndDerivativeThreader = ANTSNeighborhoodCorrelationImageToImageMetricv4DenseGetValueAndDerivativeThreaderType::New();
37 this->m_SparseGetValueAndDerivativeThreader = ANTSNeighborhoodCorrelationImageToImageMetricv4SparseGetValueAndDerivativeThreaderType::New();
38 }
39
40 template<typename TFixedImage, typename TMovingImage, typename TVirtualImage, typename TInternalComputationValueType, typename TMetricTraits>
41 void
42 ANTSNeighborhoodCorrelationImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
Initialize()43 ::Initialize()
44 {
45 Superclass::Initialize();
46 }
47
48 template<typename TFixedImage, typename TMovingImage, typename TVirtualImage, typename TInternalComputationValueType, typename TMetricTraits>
49 void
50 ANTSNeighborhoodCorrelationImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
PrintSelf(std::ostream & os,Indent indent) const51 ::PrintSelf(std::ostream & os, Indent indent) const
52 {
53 Superclass::PrintSelf(os, indent);
54 os << indent << "Correlation window radius: " << m_Radius << std::endl;
55 }
56
57 } // end namespace itk
58
59 #endif
60