17 #ifndef __itkShapePriorSegmentationLevelSetFunction_txx
18 #define __itkShapePriorSegmentationLevelSetFunction_txx
28 template <
class TImageType,
class TFeatureImageType>
32 m_ShapeFunction =
NULL;
33 m_ShapePriorWeight = NumericTraits<ScalarValueType>::Zero;
39 template <
class TImageType,
class TFeatureImageType>
44 Superclass::PrintSelf( os, indent );
45 os << indent <<
"ShapeFunction: " << m_ShapeFunction.GetPointer() << std::endl;
46 os << indent <<
"ShapePriorWeight: " << m_ShapePriorWeight << std::endl;
52 template <
class TImageType,
class TFeatureImageType>
62 PixelType value = this->Superclass::ComputeUpdate( neighborhood, gd, offset );
65 if ( m_ShapeFunction && m_ShapePriorWeight != NumericTraits<ScalarValueType>::Zero )
69 for(
unsigned int i = 0; i < ImageDimension; ++i )
71 cdx[i] =
static_cast<double>( idx[i] ) - offset[i];
74 this->GetFeatureImage()->TransformContinuousIndexToPhysicalPoint( cdx, point );
77 ( m_ShapeFunction->Evaluate( point ) - neighborhood.GetCenterPixel() );
95 template <
class TImageType,
class TFeatureImageType>
131 double maxScaleCoefficient = 0.0;
132 for (
unsigned int i=0; i<ImageDimension; i++)
134 maxScaleCoefficient = vnl_math_max(this->m_ScaleCoefficients[i],maxScaleCoefficient);
136 dt /= maxScaleCoefficient;