18 #ifndef itkRegionBasedLevelSetFunction_h
19 #define itkRegionBasedLevelSetFunction_h
23 #include "vnl/vnl_matrix_fixed.h"
64 template<
typename TInput,
66 typename TSharedData >
79 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
105 m_MaxCurvatureChange = null_value;
106 m_MaxAdvectionChange = null_value;
107 m_MaxGlobalChange = null_value;
113 Self::ImageDimension,
155 this->m_DomainFunction = f;
167 m_Center = it.
Size() / 2;
170 for (
unsigned int i = 0; i < ImageDimension; i++ )
176 #if !defined( ITK_WRAPPING_PARSER )
179 this->m_SharedData = sharedDataIn;
183 void UpdateSharedData(
bool forceUpdate);
187 return new GlobalDataStruct;
190 TimeStepType ComputeGlobalTimeStep(
void *GlobalData)
const override;
193 PixelType ComputeUpdate(
const NeighborhoodType & neighborhood,
194 void *globalData,
const FloatOffsetType & = FloatOffsetType(0.0) )
override;
202 {
return m_FeatureImage.GetPointer(); }
208 for (
unsigned int i = 0; i < ImageDimension; i++ )
210 this->m_InvSpacing[i] = 1 / spacing[i];
217 {
return this->m_ZeroVectorConstant; }
221 { this->m_AreaWeight = nu; }
223 {
return this->m_AreaWeight; }
228 { this->m_Lambda1 = lambda1; }
230 {
return this->m_Lambda1; }
235 { this->m_Lambda2 = lambda2; }
237 {
return this->m_Lambda2; }
242 { this->m_OverlapPenaltyWeight = gamma; }
244 {
return this->m_OverlapPenaltyWeight; }
249 { m_CurvatureWeight = c; }
251 {
return m_CurvatureWeight; }
255 { this->m_AdvectionWeight = iA; }
257 {
return this->m_AdvectionWeight; }
261 { m_ReinitializationSmoothingWeight = c; }
263 {
return m_ReinitializationSmoothingWeight; }
268 { this->m_VolumeMatchingWeight = tau; }
270 {
return this->m_VolumeMatchingWeight; }
275 { this->m_Volume = volume; }
277 {
return this->m_Volume; }
282 { this->m_FunctionId = iFid; }
285 {
delete (GlobalDataStruct *)GlobalData; }
287 virtual ScalarValueType ComputeCurvature(
const NeighborhoodType &,
288 const FloatOffsetType &, GlobalDataStruct *gd);
353 std::slice x_slice[Self::ImageDimension];
356 double m_InvSpacing[Self::ImageDimension];
361 void ComputeHImage();
411 GlobalDataStruct *globalData);
414 virtual void ComputeParameters() = 0;
418 virtual void UpdateSharedDataParameters() = 0;
424 static VectorType InitializeZeroVectorConstant();
431 #ifndef ITK_MANUAL_INSTANTIATION
432 #include "itkRegionBasedLevelSetFunction.hxx"
ScalarValueType GetOverlapPenaltyWeight() const
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
Light weight base class for most itk classes.
typename FeatureImageType::OffsetType FeatureOffsetType
typename HeavisideFunctionType::ConstPointer HeavisideFunctionConstPointer
typename InputImageType::PixelType InputPixelType
ScalarValueType GetCurvatureWeight() const
SharedDataPointer m_SharedData
typename InputImageType::IndexValueType InputIndexValueType
Define numeric traits for std::vector.
unsigned long SizeValueType
ScalarValueType m_OverlapPenaltyWeight
ScalarValueType m_VolumeMatchingWeight
void SetVolume(const ScalarValueType &volume)
TFeatureImage FeatureImageType
OffsetValueType GetStride(DimensionValueType axis) const
void SetAreaWeight(const ScalarValueType &nu)
void SetReinitializationSmoothingWeight(const ScalarValueType c)
PixelType ScalarValueType
virtual void SetCurvatureWeight(const ScalarValueType c)
virtual const FeatureImageType * GetFeatureImage() const
typename InputImageType::Pointer InputImagePointer
ScalarValueType m_MaxCurvatureChange
typename FeatureImageType::ConstPointer FeatureImageConstPointer
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
FeatureImageConstPointer m_FeatureImage
void SetInitialImage(InputImageType *f)
void SetAdvectionWeight(const ScalarValueType &iA)
ScalarValueType m_Lambda2
ScalarValueType GetLambda1() const
ScalarValueType GetLambda2() const
Simulate a standard C array with copy semnatics.
typename InputImageType::ConstPointer InputImageConstPointer
typename ImageType::PixelType PixelType
TInputImage InputImageType
NeighborIndexType Size() const
typename FeatureImageType::IndexType FeatureIndexType
typename SharedDataType::Pointer SharedDataPointer
unsigned int m_FunctionId
typename ConstNeighborhoodIterator< TInputImage >::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
ScalarValueType m_Lambda1
ScalarValueType m_MaxGlobalChange
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
void * GetGlobalDataPointer() const override
signed long IndexValueType
typename InputImageType::IndexType InputIndexType
~RegionBasedLevelSetFunction() override
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...
typename InputImageType::RegionType InputRegionType
ScalarValueType m_AdvectionWeight
HeavisideFunctionConstPointer m_DomainFunction
void SetSharedData(SharedDataPointer sharedDataIn)
typename InputImageType::SizeValueType InputSizeValueType
ScalarValueType m_AreaWeight
virtual void Initialize(const RadiusType &r)
ScalarValueType m_CurvatureWeight
typename FeatureImageType::SpacingType FeatureSpacingType
void SetVolumeMatchingWeight(const ScalarValueType &tau)
virtual void SetFeatureImage(const FeatureImageType *f)
ImageBaseType::PointType PointType
vnl_matrix_fixed< ScalarValueType, Self::ImageDimension, Self::ImageDimension > m_dxy
ScalarValueType GetAreaWeight() const
typename InputImageType::PointType InputPointType
void SetLambda2(const ScalarValueType &lambda2)
void SetFunctionId(const unsigned int &iFid)
typename InputImageType::SizeType InputSizeType
virtual VectorType AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
void ReleaseGlobalDataPointer(void *GlobalData) const override
TSharedData SharedDataType
void SetDomainFunction(const HeavisideFunctionType *f)
typename FeatureImageType::PixelType FeaturePixelType
ImageBaseType::RegionType RegionType
void SetRadius(const SizeType &)
ScalarValueType m_ReinitializationSmoothingWeight
ScalarValueType m_GradMag
void SetOverlapPenaltyWeight(const ScalarValueType &gamma)
InputImageConstPointer m_InitialImage
ScalarValueType m_GradMagSqr
signed long OffsetValueType
ScalarValueType GetReinitializationSmoothingWeight() const
ScalarValueType GetVolumeMatchingWeight() const
LevelSet function that computes a speed image based on regional integrals.
ScalarValueType GetVolume() const
static VectorType m_ZeroVectorConstant
Base class of the Heaviside function.