Commit 9ddebfcb authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: Mantis-1182: avoid crash due to extended filenames

parent 39e0b855
......@@ -52,10 +52,10 @@ ComplexInputImageParameter::SetFromFileName(const std::string& filename)
if (!filename.empty())
{
ComplexFloatVectorReaderType::Pointer reader = ComplexFloatVectorReaderType::New();
reader->SetFileName(filename);
try
{
reader->SetFileName(filename);
reader->UpdateOutputInformation();
}
catch(itk::ExceptionObject & /*err*/)
......
......@@ -51,9 +51,9 @@ InputImageListParameter::SetListFromFileName(const std::vector<std::string> & fi
if (!filename.empty())
{
ImageFileReaderType::Pointer reader = ImageFileReaderType::New();
reader->SetFileName(filename);
try
{
reader->SetFileName(filename);
reader->UpdateOutputInformation();
}
catch(itk::ExceptionObject & /*err*/)
......
......@@ -53,10 +53,10 @@ InputImageParameter::SetFromFileName(const std::string& filename)
if (!filename.empty())
{
FloatVectorReaderType::Pointer reader = FloatVectorReaderType::New();
reader->SetFileName(filename);
try
{
reader->SetFileName(filename);
reader->UpdateOutputInformation();
}
catch(itk::ExceptionObject & /*err*/)
......
......@@ -52,9 +52,9 @@ InputVectorDataListParameter::SetListFromFileName(const std::vector<std::string>
if (!filename.empty())
{
VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New();
reader->SetFileName(filename);
try
{
reader->SetFileName(filename);
reader->UpdateOutputInformation();
}
catch(itk::ExceptionObject & /*err*/)
......
......@@ -46,9 +46,9 @@ InputVectorDataParameter::SetFromFileName(const std::string& filename)
&& itksys::SystemTools::FileExists(filename.c_str()))
{
VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New();
reader->SetFileName(filename);
try
{
reader->SetFileName(filename);
reader->UpdateOutputInformation();
}
catch(itk::ExceptionObject & /*err*/)
......
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