Skip to content
Snippets Groups Projects
Commit 54026d06 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: dynamic_cast fails when image is not of type OutputImageType. Replacing...

BUG: dynamic_cast fails when image is not of type OutputImageType. Replacing the GetProjectionRef() call since it is the only one requiring the dynamic cast
parent c0aa5564
No related branches found
No related tags found
No related merge requests found
......@@ -118,16 +118,13 @@ VectorDataToLabelImageFilter<TVectorData, TOutputImage>
template <class TVectorData, class TOutputImage>
void
VectorDataToLabelImageFilter<TVectorData, TOutputImage>
::SetOutputParametersFromImage(const ImageBaseType * image)
{
const OutputImageType * src = dynamic_cast<const OutputImageType*>(image);
::SetOutputParametersFromImage(const ImageBaseType * src)
{
this->SetOutputOrigin ( src->GetOrigin() );
this->SetOutputSpacing ( src->GetSpacing() );
//this->SetOutputStartIndex ( src->GetLargestPossibleRegion().GetIndex() );
this->SetOutputSize ( src->GetLargestPossibleRegion().GetSize() );
this->SetOutputProjectionRef(src->GetProjectionRef());
//this->SetOutputKeywordList(src->GetImageKeywordlist());
typename ImageMetadataInterfaceBase::Pointer imi = ImageMetadataInterfaceFactory::CreateIMI(src->GetMetaDataDictionary());
this->SetOutputProjectionRef(imi->GetProjectionRef());
}
template<class TVectorData, class TOutputImage>
......
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