Skip to content

Commit

Permalink
Merge pull request InsightSoftwareConsortium#4511 from blowekamp/clar…
Browse files Browse the repository at this point in the history
…ify_threshold_doc

DOC: Clarify ThresholdImageFilter behavior
  • Loading branch information
blowekamp authored Mar 15, 2024
2 parents be79ceb + e67365a commit 6c2fe38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Modules/Filtering/Thresholding/include/itkThresholdImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ namespace itk
/**
* \class ThresholdImageFilter
* \brief Set image values to a user-specified value if they are below,
* above, or between simple threshold values.
* above, or outside threshold values.
*
* ThresholdImageFilter sets image values to a user-specified "outside"
* value (by default, "black") if the image values are below, above, or
* between simple threshold values.
* value (by default, zero) if the image values are below, above, or
* outside threshold values.
*
* The available methods are:
*
Expand Down Expand Up @@ -103,15 +103,15 @@ class ITK_TEMPLATE_EXPORT ThresholdImageFilter : public InPlaceImageFilter<TImag
/** Get the "outside" pixel value. */
itkGetConstMacro(OutsideValue, PixelType);

/** The values greater than or equal to the value are set to OutsideValue. */
/** The values greater than `threshold` are set to OutsideValue. */
void
ThresholdAbove(const PixelType & thresh);
ThresholdAbove(const PixelType & threshold);

/** The values less than or equal to the value are set to OutsideValue. */
/** The values less than `threshold` are set to OutsideValue. */
void
ThresholdBelow(const PixelType & thresh);
ThresholdBelow(const PixelType & threshold);

/** The values outside the range are set to OutsideValue. */
/** The values outside the closed range are set to OutsideValue. */
void
ThresholdOutside(const PixelType & lower, const PixelType & upper);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ ThresholdImageFilter<TImage>::ThresholdImageFilter()

template <typename TImage>
void
ThresholdImageFilter<TImage>::ThresholdAbove(const PixelType & thresh)
ThresholdImageFilter<TImage>::ThresholdAbove(const PixelType & threshold)
{
if (Math::NotExactlyEquals(m_Upper, thresh) || m_Lower > NumericTraits<PixelType>::NonpositiveMin())
if (Math::NotExactlyEquals(m_Upper, threshold) || m_Lower > NumericTraits<PixelType>::NonpositiveMin())
{
m_Lower = NumericTraits<PixelType>::NonpositiveMin();
m_Upper = thresh;
m_Upper = threshold;
this->Modified();
}
}

template <typename TImage>
void
ThresholdImageFilter<TImage>::ThresholdBelow(const PixelType & thresh)
ThresholdImageFilter<TImage>::ThresholdBelow(const PixelType & threshold)
{
if (Math::NotExactlyEquals(m_Lower, thresh) || m_Upper < NumericTraits<PixelType>::max())
if (Math::NotExactlyEquals(m_Lower, threshold) || m_Upper < NumericTraits<PixelType>::max())
{
m_Lower = thresh;
m_Lower = threshold;
m_Upper = NumericTraits<PixelType>::max();
this->Modified();
}
Expand Down

0 comments on commit 6c2fe38

Please sign in to comment.