//static bool GradientsBase::loadFile(const String& rsFilePath_p, std::size_t index_p, imageType_t &rImage_p) { // open read only FileFormat format( pcl::File::ExtractExtension( rsFilePath_p ), true, false ); FileFormatInstance file(format); ImageDescriptionArray images; if ( !file.Open( images, rsFilePath_p)) //, inputHints ) ) throw CatchedException(); if(images.Length()<=index_p) { //image with this index does not exist return false; } TimeMessage startLoad("Loading image "+rsFilePath_p+" "+String(index_p)); file.SelectImage(index_p); if (!file.ReadImage(rImage_p)) throw CatchedException(); return true; }