Hi everyone,
I’m trying to read an image with 5 components with itk::ImageFileReader, but it crashes with the following message:
terminate called after throwing an instance of ‘itk::ExceptionObject’
what(): /home/mory/sources/itk/ITK/Modules/IO/ImageBase/include/itkConvertPixelBuffer.hxx:171:
itk::ERROR: No conversion available from 5 components to: 5 components
It works fine with 3 components, but crashes with 5. Is it the expected behaviour ? I’m using ITK v4.13.0, but I would see no problem in upgrading to a newer version if necessary.
Here is the code I use:
#include <itkImage.h>
#include <itkVector.h>
#include <itkImageFileReader.h>
#include <itkImageFileWriter.h>
int main(){
typedef itk::Image<itk::Vector<float, 5>, 3> ImageOfVectorsType;
typedef itk::ImageFileReader ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName("/home/mory/ThreeDimensionsFiveComponents.mha");
reader->Update();
return EXIT_SUCCESS;
}