CBICA / CaPTk

Cancer Imaging Phenomics Toolkit (CaPTk) is a software platform to perform image analysis and predictive modeling tasks. Documentation: https://cbica.github.io/CaPTk
https://www.cbica.upenn.edu/captk
Other
175 stars 63 forks source link

Update cbica::ReadImage to handle Vector Images #195

Open ludovenet opened 5 years ago

ludovenet commented 5 years ago

Try to make read a NIFTI image like that :

using PixelType = itk::Vector< float, 2 >; typedef itk::Image< PixelType, 3 > ExpectedImageType; std::string inputFileName = PATH_to_Image; ExpectedImageType::Pointer inputImage_2 = cbica::ReadImage< ExpectedImageType>(inputFileName, ".nii.gz");

error : CMakeFiles/HistoReg.dir/src/HistoReg.cxx.o: In function itk::ImageFileReader<itk::Image<itk::Vector<float, 2u>,3u>, itk::DefaultConvertPixelTraits<itk::Image<itk::Vector<float, 2u>, 3u>::IOPixelType> >::Pointer cbica::GetImageReader<itk::Image<itk::Vector<float, 2u>, 3u> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': HistoReg.cxx:(.text._ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESK_SK_[_ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESK_SK_]+0x2d8): undefined reference tocbica::ImageInfo::ImageInfo(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' HistoReg.cxx:(.text._ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESKSK[_ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESKSK]+0x5bc): undefined reference to `cbica::ImageInfo::~ImageInfo()' HistoReg.cxx:(.text._ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESKSK[_ZN5cbica14GetImageReaderIN3itk5ImageINS1_6VectorIfLj2EEELj3EEEEENS1_15ImageFileReaderIT_NS1_25DefaultConvertPixelTraitsINS7_11IOPixelTypeEEEE7PointerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESKSK]+0x749): undefined reference to `cbica::ImageInfo::~ImageInfo()' collect2: error: ld returned 1 exit status CMakeFiles/HistoReg.dir/build.make:404: recipe for target 'HistoReg' failed make[2]: [HistoReg] Error 1 CMakeFiles/Makefile2:109: recipe for target 'CMakeFiles/HistoReg.dir/all' failed make[1]: [CMakeFiles/HistoReg.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

sarthakpati commented 5 years ago

This functionality will be necessary for future projects and the core should be able to handle Vector images.