Skip to content
Snippets Groups Projects
Commit 02f45c83 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

ENH: change the way the size is treated

parent 344a0b3b
Branches
Tags
No related merge requests found
...@@ -117,13 +117,23 @@ public: ...@@ -117,13 +117,23 @@ public:
} }
Clamp( vPixel ); Clamp( vPixel );
OutputPixelType out; OutputPixelType out;
int hack = 1; unsigned int compOut = m_CompOut;
if ( m_cOutPix && m_CompOut == 1 ) unsigned int size =
hack += 1; // needed in case we have OutputPixelType == complex<t> as itk::NumericTraits < OutputPixelType > :: GetLength( out );
if ( size == 0 ) // That means it is a variable size container
{
int hack = 1;
if ( m_cOutPix && m_CompOut == 1 )
hack += 1; // needed in case we have OutputPixelType == complex<t> as
// itk::NumericTraits::SetLength() will ask a length of 2! // itk::NumericTraits::SetLength() will ask a length of 2!
itk::NumericTraits < OutputPixelType > :: SetLength( out , itk::NumericTraits < OutputPixelType > :: SetLength( out ,
hack * m_CompOut ); hack * m_CompOut );
for ( unsigned int i = 0 ; i < m_CompOut ; i ++) }
else if ( m_cOutPix )// It is a fixed size container, m_CompOut should be equal to its size
compOut = size / 2;
else
compOut = size;
for ( unsigned int i = 0 ; i < compOut ; i ++)
FillOut < OutputPixelType > ( i , out , vPixel ); FillOut < OutputPixelType > ( i , out , vPixel );
return out; return out;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment