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 __itkRegistrationParameterScalesFromShift_h 00019 #define __itkRegistrationParameterScalesFromShift_h 00020 00021 #include "itkRegistrationParameterScalesEstimator.h" 00022 00023 namespace itk 00024 { 00025 00042 template < class TMetric > 00043 class ITK_EXPORT RegistrationParameterScalesFromShift : 00044 public RegistrationParameterScalesEstimator< TMetric > 00045 { 00046 public: 00048 typedef RegistrationParameterScalesFromShift Self; 00049 typedef RegistrationParameterScalesEstimator< TMetric > Superclass; 00050 typedef SmartPointer<Self> Pointer; 00051 typedef SmartPointer<const Self> ConstPointer; 00052 00054 itkNewMacro( Self ); 00055 00057 itkTypeMacro( RegistrationParameterScalesFromShift, RegistrationParameterScalesEstimator ); 00058 00060 typedef typename Superclass::ScalesType ScalesType; 00061 00063 typedef typename Superclass::ParametersType ParametersType; 00064 00066 typedef typename Superclass::FloatType FloatType; 00067 00068 typedef typename Superclass::VirtualPointType VirtualPointType; 00069 typedef typename Superclass::VirtualIndexType VirtualIndexType; 00070 typedef typename Superclass::MovingTransformType MovingTransformType; 00071 typedef typename Superclass::FixedTransformType FixedTransformType; 00072 typedef typename Superclass::JacobianType JacobianType; 00073 typedef typename Superclass::VirtualImageConstPointer VirtualImageConstPointer; 00074 00076 itkSetMacro(UsePhysicalSpaceForShift, bool); 00077 itkGetConstMacro(UsePhysicalSpaceForShift, bool); 00079 00081 virtual void EstimateScales(ScalesType &scales); 00082 00084 virtual FloatType EstimateStepScale(const ParametersType &step); 00085 00087 virtual void EstimateLocalStepScales(const ParametersType &step, 00088 ScalesType &localStepScales); 00089 00090 protected: 00091 RegistrationParameterScalesFromShift(); 00092 ~RegistrationParameterScalesFromShift(){}; 00093 00094 virtual void PrintSelf(std::ostream &os, Indent indent) const; 00095 00098 virtual FloatType ComputeMaximumVoxelShift(const ParametersType &deltaParameters); 00099 00104 template <class TTransform> void 00105 ComputeSampleIndexShifts(const ParametersType &deltaParameters, 00106 ScalesType &localShifts); 00107 00112 template <class TTransform> void 00113 ComputeSamplePhysicalShifts(const ParametersType &deltaParameters, 00114 ScalesType &localShifts); 00115 00116 private: 00117 RegistrationParameterScalesFromShift(const Self&); //purposely not implemented 00118 void operator=(const Self&); //purposely not implemented 00119 00120 //A small variation of parameters 00121 typename ParametersType::ValueType m_SmallParameterVariation; 00122 00123 //A switch for using physical space for shift computation or continuous index space 00124 bool m_UsePhysicalSpaceForShift; 00125 }; //class RegistrationParameterScalesFromShift 00126 00127 00128 } // namespace itk 00129 00130 00131 #ifndef ITK_MANUAL_INSTANTIATION 00132 #include "itkRegistrationParameterScalesFromShift.hxx" 00133 #endif 00134 00135 #endif /* __itkRegistrationParameterScalesFromShift_h */ 00136