Skip to content

Commit

Permalink
ENH: Clamp STAPLEImageFilter maximum iterations
Browse files Browse the repository at this point in the history
Clamp `STAPLEImageFilter` maximum iterations to avoid setting a 0 value,
and thus giving rise dynamic memory defects when querying about
non-existing vector indices for the sensitivity and specifity.

Related to commit 5b5d85e.
  • Loading branch information
jhlegarreta authored and dzenanz committed Sep 26, 2022
1 parent 7539b50 commit a7546b6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -204,7 +204,7 @@ class ITK_TEMPLATE_EXPORT STAPLEImageFilter : public ImageToImageFilter<TInputIm
/** Set/Get the maximum number of iterations after which the STAPLE algorithm
* will be considered to have converged. In general this SHOULD NOT be set and
* the algorithm should be allowed to converge on its own. */
itkSetMacro(MaximumIterations, unsigned int);
itkSetClampMacro(MaximumIterations, unsigned int, 1, NumericTraits<unsigned int>::max());
itkGetConstMacro(MaximumIterations, unsigned int);

/** Scales the estimated prior probability that a pixel will be inside the
Expand Down

0 comments on commit a7546b6

Please sign in to comment.