Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 12 additions & 62 deletions Modules/Core/Common/include/itkAnnulusOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel,
{
m_InnerRadius = r;
}
double
GetInnerRadius() const
{
return m_InnerRadius;
}
itkGetConstNonVirtualMacro(InnerRadius, double);

/** Set/Get the thickness of the annulus. The outer radius of the
* annulus is defined as r = InnerRadius + Thickness. Thickness is
Expand All @@ -110,47 +106,26 @@ class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel,
{
m_Thickness = t;
}
double
GetThickness() const
{
return m_Thickness;
}
itkGetConstNonVirtualMacro(Thickness, double);

/** Set/Get the pixel spacings. Setting these ensures the annulus
/** Set/Get the pixel spacings. Setting these ensures the annulus
* is round in physical space. Defaults to 1. */
void
SetSpacing(SpacingType & s)
{
m_Spacing = s;
}
const SpacingType &
GetSpacing() const
{
return m_Spacing;
}
itkGetConstNonVirtualReferenceMacro(Spacing, SpacingType);

/** Set/Get whether kernel values are computed automatically or
* specified manually */
* specified manually. */
void
SetNormalize(bool b)
{
m_Normalize = b;
}
bool
GetNormalize() const
{
return m_Normalize;
}
void
NormalizeOn()
{
this->SetNormalize(true);
}
void
NormalizeOff()
{
this->SetNormalize(false);
}
itkGetConstNonVirtualMacro(Normalize, bool);
itkBooleanNonVirtualMacro(Normalize);

/** If Normalize is on, you define the annulus to have a bright
* center or a dark center. */
Expand All @@ -159,21 +134,8 @@ class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel,
{
m_BrightCenter = b;
}
bool
GetBrightCenter() const
{
return m_BrightCenter;
}
void
BrightCenterOn()
{
this->SetBrightCenter(true);
}
void
BrightCenterOff()
{
this->SetBrightCenter(false);
}
itkGetConstNonVirtualMacro(BrightCenter, bool);
itkBooleanNonVirtualMacro(BrightCenter);

/** If Normalize is off, the interior to annulus, the
* annulus (region between the two circles), and the region exterior to the
Expand All @@ -184,31 +146,19 @@ class ITK_TEMPLATE_EXPORT AnnulusOperator : public NeighborhoodOperator<TPixel,
{
m_InteriorValue = v;
}
TPixel
GetInteriorValue() const
{
return m_InteriorValue;
}
itkGetConstNonVirtualMacro(InteriorValue, TPixel);
void
SetAnnulusValue(TPixel v)
{
m_AnnulusValue = v;
}
TPixel
GetAnnulusValue() const
{
return m_AnnulusValue;
}
itkGetConstNonVirtualMacro(AnnulusValue, TPixel);
void
SetExteriorValue(TPixel v)
{
m_ExteriorValue = v;
}
TPixel
GetExteriorValue() const
{
return m_ExteriorValue;
}
itkGetConstNonVirtualMacro(ExteriorValue, TPixel);

void
PrintSelf(std::ostream & os, Indent indent) const override
Expand Down
11 changes: 2 additions & 9 deletions Modules/Core/Common/include/itkDerivativeOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,13 @@ class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixe
/** Type alias support for pixel real type.*/
using typename Superclass::PixelRealType;

/** Sets the order of the derivative. */
/** Set/Get the order of the derivative. */
void
SetOrder(const unsigned int order)
{
this->m_Order = order;
}

/** Returns the order of the derivative. */
unsigned int
GetOrder() const
{
return m_Order;
}
itkGetConstNonVirtualMacro(Order, unsigned int);

void
PrintSelf(std::ostream & os, Indent indent) const override
Expand All @@ -116,7 +110,6 @@ class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixe
}

private:
/** Order of the derivative. */
unsigned int m_Order{ 1 };
};
} // namespace itk
Expand Down
75 changes: 20 additions & 55 deletions Modules/Core/Common/include/itkGaussianDerivativeOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,43 +130,30 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeOperator : public NeighborhoodOperat
{
m_NormalizeAcrossScale = flag;
}
bool
GetNormalizeAcrossScale() const
{
return m_NormalizeAcrossScale;
}
itkGetConstNonVirtualMacro(NormalizeAcrossScale, bool);
itkBooleanMacro(NormalizeAcrossScale);

/** Set/Get the variance of the Gaussian kernel.
*
*/
/** Set/Get the variance of the Gaussian kernel. */
void
SetVariance(const double variance)
{
m_Variance = variance;
}
double
GetVariance() const
{
return m_Variance;
}
itkGetConstNonVirtualMacro(Variance, double);

/** Set/Get the spacing for the direction of this kernel. */
void
SetSpacing(const double spacing)
{
m_Spacing = spacing;
}
double
GetSpacing() const
{
return m_Spacing;
}
itkGetConstNonVirtualMacro(Spacing, double);

/** Set/Get the desired maximum error of the gaussian approximation. Maximum
* error is the difference between the area under the discrete Gaussian curve
* and the area under the continuous Gaussian. Maximum error affects the
* Gaussian operator size. The value is clamped between 0.00001 and 0.99999. */
/** Set/Get the desired maximum error of the Gaussian approximation.
* The maximum error is the difference between the area under the discrete
* Gaussian curve and the area under the continuous Gaussian. Maximum error
* affects the Gaussian operator size. The value is clamped between 0.00001
* and 0.99999. */
void
SetMaximumError(const double maxerror)
{
Expand All @@ -175,34 +162,26 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeOperator : public NeighborhoodOperat

m_MaximumError = std::clamp(maxerror, Min, Max);
}
double
GetMaximumError()
{
return m_MaximumError;
}
itkGetNonVirtualMacro(MaximumError, double);

/** Sets/Get a limit for growth of the kernel. Small maximum error values with
* large variances will yield very large kernel sizes. This value can be
* used to truncate a kernel in such instances. A warning will be given on
* truncation of the kernel. */
/** Set/Get a limit for growth of the kernel. Small maximum error values with
* large variances will yield very large kernel sizes. This value can be
* used to truncate a kernel in such instances. A warning will be given when
* the specified maximum error causes the kernel to exceed this size. */
void
SetMaximumKernelWidth(unsigned int n)
{
m_MaximumKernelWidth = n;
}
itkGetConstMacro(MaximumKernelWidth, unsigned int);

/** Sets/Get the order of the derivative. */
/** Set/Get the order of the derivative. */
void
SetOrder(const unsigned int order)
{
m_Order = order;
}
unsigned int
GetOrder() const
{
return m_Order;
}
itkGetConstNonVirtualMacro(Order, unsigned int);

void
PrintSelf(std::ostream & os, Indent indent) const override;
Expand Down Expand Up @@ -243,26 +222,12 @@ class ITK_TEMPLATE_EXPORT GaussianDerivativeOperator : public NeighborhoodOperat
CoefficientVector
GenerateGaussianCoefficients() const;

/** Normalize derivatives across scale space */
bool m_NormalizeAcrossScale{ true };

/** Desired variance of the discrete Gaussian function. */
double m_Variance{ 1.0 };

/** Difference between the areas under the curves of the continuous and
* discrete Gaussian functions. */
double m_MaximumError{ 0.005 };

/** Maximum kernel size allowed. This value is used to truncate a kernel
* that has grown too large. A warning is given when the specified maximum
* error causes the kernel to exceed this size. */
bool m_NormalizeAcrossScale{ true };
double m_Variance{ 1.0 };
double m_MaximumError{ 0.005 };
unsigned int m_MaximumKernelWidth{ 30 };

/** Order of the derivative. */
unsigned int m_Order{ 1 };

/** Spacing in the direction of this kernel. */
double m_Spacing{ 1.0 };
double m_Spacing{ 1.0 };
};

} // namespace itk
Expand Down
53 changes: 12 additions & 41 deletions Modules/Core/Common/include/itkGaussianOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,17 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel,
/** \see LightObject::GetNameOfClass() */
itkOverrideGetNameOfClassMacro(GaussianOperator);

/** Sets the desired variance of the Gaussian kernel. */
/** Set/Get the desired variance of the Gaussian kernel. */
void
SetVariance(const double variance)
{
m_Variance = variance;
}
itkGetNonVirtualMacro(Variance, double);

/** Sets the desired maximum error of the gaussian approximation. Maximum
/** Set/Get the desired maximum error of the Gaussian approximation. The maximum
* error is the difference between the area under the discrete Gaussian curve
* and the area under the continuous Gaussian. Maximum error affects the
* and the area under the continuous Gaussian. The maximum error affects the
* Gaussian operator size. The value must be between 0.0 and 1.0. */
void
SetMaximumError(const double max_error)
Expand All @@ -97,40 +98,18 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel,

m_MaximumError = max_error;
}
itkGetNonVirtualMacro(MaximumError, double);

/** Returns the variance of the Gaussian (scale) for the operator. */
double
GetVariance()
{
return m_Variance;
}

/** Returns the maximum error of the gaussian approximation. Maximum error is
* the difference between the area under the discrete Gaussian curve and the
* area under the continuous Gaussian. Maximum error affects the Gaussian
* operator size. */
double
GetMaximumError()
{
return m_MaximumError;
}

/** Sets a limit for growth of the kernel. Small maximum error values with
* large variances will yield very large kernel sizes. This value can be
* used to truncate a kernel in such instances. A warning will be given on
* truncation of the kernel. */
/** Set/Get a limit for growth of the kernel. Small maximum error values with
* large variances will yield very large kernel sizes. This value can be
* used to truncate a kernel in such instances. A warning will be given when
* the specified maximum error causes the kernel to exceed this size. */
void
SetMaximumKernelWidth(unsigned int n)
{
m_MaximumKernelWidth = n;
}

/** Returns the maximum allowed kernel width. */
unsigned int
GetMaximumKernelWidth() const
{
return m_MaximumKernelWidth;
}
itkGetConstNonVirtualMacro(MaximumKernelWidth, unsigned int);

void
PrintSelf(std::ostream & os, Indent indent) const override
Expand Down Expand Up @@ -201,16 +180,8 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel,
}

private:
/** Desired variance of the discrete Gaussian function. */
double m_Variance{ 1 };

/** Difference between the areas under the curves of the continuous and
* discrete Gaussian functions. */
double m_MaximumError{ .01 };

/** Maximum kernel size allowed. This value is used to truncate a kernel
* that has grown too large. A warning is given when the specified maximum
* error causes the kernel to exceed this size. */
double m_Variance{ 1 };
double m_MaximumError{ .01 };
unsigned int m_MaximumKernelWidth{ 30 };

/** Enable/disable kernel generation debug warnings */
Expand Down
4 changes: 1 addition & 3 deletions Modules/Core/Common/include/itkImageKernelOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ class ITK_TEMPLATE_EXPORT ImageKernelOperator : public NeighborhoodOperator<TPix
/** \see LightObject::GetNameOfClass() */
itkOverrideGetNameOfClassMacro(ImageKernelOperator);

/** Set the image kernel. Only images with odd size in all
/** Set/Get the image kernel. Only images with odd size in all
* dimensions are allowed. If an image with an even size is passed
* as an argument, an exception will be thrown. */
void
SetImageKernel(const ImageType * kernel);

/** Get the image kernel. */
const ImageType *
GetImageKernel() const;

Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkLaplacianOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ class ITK_TEMPLATE_EXPORT LaplacianOperator : public NeighborhoodOperator<TPixel
os << indent << "DerivativeScalings: " << m_DerivativeScalings << std::endl;
}

/** Sets the weights that are applied to the derivative in each axial
* direction when the kernel is computed. These weights are all 1.0 by
/** Set/Get the weights that are applied to the derivative in each axial
* direction when the kernel is computed. These weights are all 1.0 by
* default. This method must be called BEFORE CreateOperator */
void
SetDerivativeScalings(const double * s);
Comment thread
hjmjohnson marked this conversation as resolved.
Expand Down
Loading