Skip to content
Merged
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
30 changes: 30 additions & 0 deletions Modules/Core/Common/include/itkGaussianOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,33 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel,
os << indent << "MaximumKernelWidth: " << m_MaximumKernelWidth << std::endl;
}

/** Get the value of the debug flag.
* Mimics the itk::Object interface so that itkDebugMacro
* can be used in selective printouts from Gaussian kernel generation.*/
bool
GetDebug() const
{
return m_Debug;
}
/** Turn debugging output on. */
void
DebugOn() const
{
m_Debug = true;
}
/** Turn debugging output off. */
void
DebugOff() const
{
m_Debug = false;
}
/** Set the value of the debug flag. A non-zero value turns debugging on. */
void
SetDebug(bool debugFlag) const
{
m_Debug = debugFlag;
}

public:
/** Returns the value of the modified Bessel function I0(x) at a point x >= 0.
*/
Expand Down Expand Up @@ -185,6 +212,9 @@ class ITK_TEMPLATE_EXPORT GaussianOperator : public NeighborhoodOperator<TPixel,
* that has grown too large. A warning is given when the specified maximum
* error causes the kernel to exceed this size. */
unsigned int m_MaximumKernelWidth{ 30 };

/** Enable/disable kernel generation debug warnings */
mutable bool m_Debug{ false };
};
} // namespace itk

Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkMacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ OutputWindowDisplayDebugText(const char *);

// The itkDebugStatement is to be used to protect code that is only used in the itkDebugMacro
/** This macro is used to print debug (or other information). They are
* also used to catch errors, etc. Example usage looks like:
* also used to catch errors, etc. Requires that the caller implements
* the GetDebug() method (see itk::Object). Example usage looks like:
* itkDebugMacro(<< "this is debug info" << this->SomeVariable); */
#if defined(NDEBUG)
# define itkDebugMacro(x) ITK_NOOP_STATEMENT
Expand Down