18 #ifndef itkRegionBasedLevelSetFunction_h
19 #define itkRegionBasedLevelSetFunction_h
23 #include "vnl/vnl_matrix_fixed.h"
64 template<
typename TInput,
66 typename TSharedData >
77 itkStaticConstMacro(ImageDimension,
unsigned int, Superclass::ImageDimension);
103 m_MaxCurvatureChange = null_value;
104 m_MaxAdvectionChange = null_value;
105 m_MaxGlobalChange = null_value;
111 itkGetStaticConstMacro(ImageDimension),
112 itkGetStaticConstMacro(ImageDimension) >
m_dxy;
153 this->m_DomainFunction = f;
165 m_Center = it.
Size() / 2;
168 for (
unsigned int i = 0; i < ImageDimension; i++ )
174 #if !defined( ITK_WRAPPING_PARSER )
177 this->m_SharedData = sharedDataIn;
181 void UpdateSharedData(
bool forceUpdate);
185 return new GlobalDataStruct;
188 TimeStepType ComputeGlobalTimeStep(
void *GlobalData)
const ITK_OVERRIDE;
191 virtual PixelType ComputeUpdate(
const NeighborhoodType & neighborhood,
192 void *globalData,
const FloatOffsetType & = FloatOffsetType(0.0) ) ITK_OVERRIDE;
200 {
return m_FeatureImage.GetPointer(); }
206 for (
unsigned int i = 0; i < ImageDimension; i++ )
208 this->m_InvSpacing[i] = 1 / spacing[i];
215 {
return this->m_ZeroVectorConstant; }
219 { this->m_AreaWeight = nu; }
221 {
return this->m_AreaWeight; }
226 { this->m_Lambda1 = lambda1; }
228 {
return this->m_Lambda1; }
233 { this->m_Lambda2 = lambda2; }
235 {
return this->m_Lambda2; }
240 { this->m_OverlapPenaltyWeight = gamma; }
242 {
return this->m_OverlapPenaltyWeight; }
247 { m_CurvatureWeight = c; }
249 {
return m_CurvatureWeight; }
253 { this->m_AdvectionWeight = iA; }
255 {
return this->m_AdvectionWeight; }
259 { m_ReinitializationSmoothingWeight = c; }
261 {
return m_ReinitializationSmoothingWeight; }
266 { this->m_VolumeMatchingWeight = tau; }
268 {
return this->m_VolumeMatchingWeight; }
273 { this->m_Volume = volume; }
275 {
return this->m_Volume; }
280 { this->m_FunctionId = iFid; }
283 {
delete (GlobalDataStruct *)GlobalData; }
285 virtual ScalarValueType ComputeCurvature(
const NeighborhoodType &,
286 const FloatOffsetType &, GlobalDataStruct *gd);
351 std::slice x_slice[itkGetStaticConstMacro(ImageDimension)];
354 double m_InvSpacing[itkGetStaticConstMacro(ImageDimension)];
359 void ComputeHImage();
409 GlobalDataStruct *globalData);
412 virtual void ComputeParameters() = 0;
416 virtual void UpdateSharedDataParameters() = 0;
422 static VectorType InitializeZeroVectorConstant();
432 #ifndef ITK_MANUAL_INSTANTIATION
433 #include "itkRegionBasedLevelSetFunction.hxx"
SharedDataType::Pointer SharedDataPointer
PixelType ScalarValueType
ScalarValueType GetOverlapPenaltyWeight() const
RegionBasedLevelSetFunction Self
virtual ScalarValueType LaplacianSmoothingSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
Laplacian smoothing speed can be used to spatially modify the effects of laplacian smoothing of the l...
ScalarValueType m_MaxAdvectionChange
virtual void ReleaseGlobalDataPointer(void *GlobalData) const override
Superclass::NeighborhoodType NeighborhoodType
FeatureImageType::OffsetType FeatureOffsetType
SmartPointer< const Self > ConstPointer
FeatureImageType::ConstPointer FeatureImageConstPointer
InputImageType::ConstPointer InputImageConstPointer
ScalarValueType GetCurvatureWeight() const
SharedDataPointer m_SharedData
signed long OffsetValueType
InputImageType::PixelType InputPixelType
Superclass::PixelType PixelType
HeavisideStepFunctionBase< InputPixelType, InputPixelType > HeavisideFunctionType
ScalarValueType m_OverlapPenaltyWeight
signed long IndexValueType
ScalarValueType m_VolumeMatchingWeight
void SetVolume(const ScalarValueType &volume)
InputImageType::SizeType InputSizeType
OffsetValueType GetStride(DimensionValueType axis) const
void SetAreaWeight(const ScalarValueType &nu)
virtual ~RegionBasedLevelSetFunction()
void SetReinitializationSmoothingWeight(const ScalarValueType c)
ConstNeighborhoodIterator< TInputImage >::RadiusType RadiusType
virtual void SetCurvatureWeight(const ScalarValueType c)
virtual const FeatureImageType * GetFeatureImage() const
ScalarValueType m_MaxCurvatureChange
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
FeatureImageConstPointer m_FeatureImage
unsigned long SizeValueType
SmartPointer< Self > Pointer
void SetAdvectionWeight(const ScalarValueType &iA)
ScalarValueType m_Lambda2
InputImageType::IndexType InputIndexType
ScalarValueType GetLambda1() const
HeavisideFunctionType::ConstPointer HeavisideFunctionConstPointer
ScalarValueType GetLambda2() const
Simulate a standard C array with copy semnatics.
NeighborIndexType Size() const
FeatureImageType::IndexType FeatureIndexType
TSharedData SharedDataType
unsigned int m_FunctionId
InputImageType::IndexValueType InputIndexValueType
Superclass::NeighborhoodScalesType NeighborhoodScalesType
A templated class holding a n-Dimensional vector.
ScalarValueType m_Lambda1
ScalarValueType m_MaxGlobalChange
Superclass::FloatOffsetType FloatOffsetType
Superclass::ImageType ImageType
ImageBaseType::PointType PointType
void * GetGlobalDataPointer() const override
FeatureImageType::PixelType FeaturePixelType
InputImageType::Pointer InputImagePointer
ImageType::PixelType PixelType
vnl_matrix_fixed< ScalarValueType, itkGetStaticConstMacro(ImageDimension), itkGetStaticConstMacro(ImageDimension) > m_dxy
virtual void CalculateAdvectionImage()
void SetLambda1(const ScalarValueType &lambda1)
ScalarValueType GetAdvectionWeight() const
virtual ScalarValueType CurvatureSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
Curvature speed can be used to spatially modify the effects of curvature . The default implementation...
ScalarValueType m_AdvectionWeight
HeavisideFunctionConstPointer m_DomainFunction
void SetSharedData(SharedDataPointer sharedDataIn)
InputImageType::RegionType InputRegionType
ScalarValueType m_AreaWeight
InputImageType::SizeValueType InputSizeValueType
virtual void Initialize(const RadiusType &r)
ScalarValueType m_CurvatureWeight
FixedArray< ScalarValueType, itkGetStaticConstMacro(ImageDimension) > VectorType
void SetVolumeMatchingWeight(const ScalarValueType &tau)
virtual void SetFeatureImage(const FeatureImageType *f)
FiniteDifferenceFunction< TInput > Superclass
ScalarValueType GetAreaWeight() const
TFeature FeatureImageType
ImageBaseType::SizeType SizeType
void SetLambda2(const ScalarValueType &lambda2)
void SetFunctionId(const unsigned int &iFid)
virtual VectorType AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
void SetDomainFunction(const HeavisideFunctionType *f)
void SetRadius(const SizeType &)
FeatureImageType::SpacingType FeatureSpacingType
ScalarValueType m_ReinitializationSmoothingWeight
ScalarValueType m_GradMag
void SetOverlapPenaltyWeight(const ScalarValueType &gamma)
InputImageConstPointer m_InitialImage
ScalarValueType m_GradMagSqr
ScalarValueType GetReinitializationSmoothingWeight() const
ScalarValueType GetVolumeMatchingWeight() const
LevelSet function that computes a speed image based on regional integrals.
ScalarValueType GetVolume() const
ImageBaseType::IndexType IndexType
InputImageType::PointType InputPointType
static VectorType m_ZeroVectorConstant
Base class of the Heaviside function.
Superclass::RadiusType RadiusType