Commit 93fcba52 authored by Antoine Regimbeau's avatar Antoine Regimbeau

ENH: add condition to avoid creating new objects

parent 8308d540
Pipeline #1478 failed with stages
in 27 seconds
......@@ -158,6 +158,20 @@ InputImageParameter::GetImage()
{
return nullptr;
}
// Check if the image type asked here is the same as m_image
else if ( dynamic_cast < TImageType* > ( m_Image.GetPointer() ) )
{
return dynamic_cast < TImageType* > ( m_Image.GetPointer() );
}
// check if we already done this cast
else if ( dynamic_cast <
ClampImageFilter < DoubleVectorImageType , TImageType >* >
( m_OutputCaster.GetPointer() ) )
{
return dynamic_cast <
ClampImageFilter < DoubleVectorImageType , TImageType >* >
( m_OutputCaster.GetPointer() )->GetOutput();
}
else
CLAMP_IMAGE_BASE( TImageType, m_Image.GetPointer() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment