From a93ca65723ca734e851f775d8b04f616f9492c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 20 Jul 2018 17:57:24 -0400 Subject: [PATCH] ENH: emit a useful error message with small threaded regions --- include/itkRecursiveLineYvvGaussianImageFilter.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/itkRecursiveLineYvvGaussianImageFilter.hxx b/include/itkRecursiveLineYvvGaussianImageFilter.hxx index 9892a3f..6a37d86 100644 --- a/include/itkRecursiveLineYvvGaussianImageFilter.hxx +++ b/include/itkRecursiveLineYvvGaussianImageFilter.hxx @@ -331,6 +331,14 @@ RecursiveLineYvvGaussianImageFilter< TInputImage, TOutputImage > const unsigned int ln = region.GetSize()[this->m_Direction]; + if ( ln < 4 ) + { + itkExceptionMacro( "The number of pixels along direction " + << this->m_Direction + << " in this work-unit image region is less than 4." + << " Note: TBBMultiThreader can divide small regions into really small pieces."); + } + RealType *inps = nullptr; RealType *outs = nullptr; RealType *scratch = nullptr;