Skip to content
Snippets Groups Projects
Commit 90138f20 authored by Julien Malik's avatar Julien Malik
Browse files

BUG: fix crash in QL generation when input image size is inferior to ShrinkFactor

parent f3825f88
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,9 @@ StreamingShrinkImageRegionSplitter
m_SplitsPerDimension[0] = (regionSize[0] + m_TileDimension - 1) / m_TileDimension;
m_SplitsPerDimension[1] = regionSize[1] / m_TileSizeAlignment;
if (m_SplitsPerDimension[1] == 0)
m_SplitsPerDimension[1] = 1;
unsigned int numPieces = 1;
for (unsigned int j = 0; j < ImageDimension; ++j)
{
......
......@@ -133,7 +133,7 @@ PersistentShrinkImageFilter<TInputImage, TOutputImage>
for (unsigned int i = 0; i < OutputImageType::ImageDimension; ++i)
{
shrinkedOutputSpacing[i] = inputSpacing[i] * static_cast<double>(m_ShrinkFactor);
shrinkedOutputSize[i] = inputSize[i] / m_ShrinkFactor;
shrinkedOutputSize[i] = inputSize[i] > m_ShrinkFactor ? inputSize[i] / m_ShrinkFactor : 1;
// TODO : don't know what to do here.
// dividing the input index by the shrink factor does not make a lot of sense...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment