29 #include <boost/lexical_cast.hpp> 75 bck_model_logger.
debug() <<
"\tMask image with size: (" << mask->getWidth() <<
"," << mask->getHeight() <<
")";
78 if (image->getWidth()!=mask->getWidth())
79 throw Elements::Exception() <<
"X-dims do not match: image=" << image->getWidth() <<
" mask=" << mask->getWidth();
80 if (image->getHeight()!=mask->getHeight())
81 throw Elements::Exception() <<
"Y-dims do not match: image=" << image->getHeight() <<
" mask=" << mask->getHeight();
84 if (variance_map!=
nullptr)
86 bck_model_logger.
debug() <<
"\tVariance image with size: (" << variance_map->getWidth() <<
"," << variance_map->getHeight() <<
")";
88 if (image->getWidth()!=variance_map->getWidth())
89 throw Elements::Exception() <<
"X-dims do not match: image=" << image->getWidth() <<
" variance=" << variance_map->getWidth();
90 if (image->getHeight()!=variance_map->getHeight())
91 throw Elements::Exception() <<
"Y-dims do not match: image=" << image->getHeight() <<
" variance=" << variance_map->getHeight();
97 auto bck_model =
fromSE2Modeller(image, variance_map, mask, variance_threshold, bck_median, var_median);
100 bck_model_logger.
info() <<
"Background for image: " << image->getRepr() <<
" median: " << bck_median <<
" rms: " <<
sqrt(var_median) <<
"!";
118 bck_modeller->createSE2Models(splModelBckPtr, splModelVarPtr, sigFac, bckCellSize, variance_threshold, filterBoxSize);
121 bck_median = splModelBckPtr->getMedian();
122 var_median = splModelVarPtr->getMedian();
158 for (
size_t index=0; index<stringVec.
size(); index++)
161 first = stringVec[index].find_first_not_of(
' ');
162 last = stringVec[index].find_last_not_of(
' ');
167 anInt = boost::lexical_cast<size_t>(stringVec[index].substr(first, last-first+1));
170 catch (
const boost::bad_lexical_cast &exc )
172 throw Elements::Exception() <<
"Can not convert to 'int': '" << stringVec[index].substr(first, last-first+1) <<
"'";
192 if (first == std::string::npos)
195 trimString = inString.
substr(first, last-first+1);
204 while (
next != std::string::npos);
T find_first_not_of(T... args)
void info(const std::string &logMessage)
void debug(const std::string &logMessage)
T find_first_of(T... args)
T find_last_not_of(T... args)