本文整理汇总了C++中FileName::removeLastExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ FileName::removeLastExtension方法的具体用法?C++ FileName::removeLastExtension怎么用?C++ FileName::removeLastExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileName
的用法示例。
在下文中一共展示了FileName::removeLastExtension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkImageFileSize
bool checkImageFileSize(const FileName &name, const ImageInfo &imgInfo, bool error)
{
FileName ext = name.getExtension();
FileName dataFname;
if ( ext.contains("hed"))
dataFname = name.removeLastExtension().addExtension("img");
else if (ext.contains("inf"))
dataFname = name.removeLastExtension();
else if (ext.contains("tif") || ext.contains("jpg") || ext.contains("hdf") || ext.contains("h5"))
return true;
else
dataFname = name;
size_t expectedSize = imgInfo.adim.nzyxdim*gettypesize(imgInfo.datatype) + imgInfo.offset;
size_t actualSize = dataFname.removeAllPrefixes().removeFileFormat().getFileSize();
bool result = (actualSize >= expectedSize);
if (error && !result)
REPORT_ERROR(ERR_IO_SIZE, formatString("Image Extension: File %s has wrong size.\n"
"Expected size (at least) %u bytes. Actual size %u bytes.", name.c_str(), expectedSize, actualSize));
return result;
}
示例2: setDevice
//.........这里部分代码省略.........
YY(shiftMatrix)=YY(shiftVector[i]);
translate(BSPLINE3, preImg, frameImage, shiftMatrix, WRAP);
}
else
{
movieStack.readMapped(fname,fstFrame+i);
movieStack().getImage(preImg);
if (darkImageCorr)
preImg-=darkImage;
if (gainImageCorr)
preImg/=gainImage;
}
xmipp2Opencv(preImg, preimg);
}
else
{
if (i==cnt-1)
computeAvg(fname, i*div+fstFrame, lstFrame, preImg);
else
computeAvg(fname, i*div+fstFrame, (i+1)*div+fstFrame-1, preImg);
}
xmipp2Opencv(preImg, preimg);
// Note: we should use the OpenCV conversion to use it in optical flow
convert2Uint8(avgcurr,avgcurr8);
convert2Uint8(preimg,preimg8);
#ifdef GPU
d_avgcurr.upload(avgcurr8);
d_preimg.upload(preimg8);
if (cnt==2)
d_calc(d_avgcurr, d_preimg, d_flowx, d_flowy);
else
{
flowXFileName=foname.removeLastExtension()+formatString("flowx%d%d.txt",div*2,flowCounter);
flowYFileName=foname.removeLastExtension()+formatString("flowy%d%d.txt",div*2,flowCounter);
readMat(flowXFileName.c_str(), flowx);
readMat(flowYFileName.c_str(), flowy);
d_flowx.upload(flowx);
d_flowy.upload(flowy);
d_calc.flags=cv::OPTFLOW_USE_INITIAL_FLOW;
d_calc(d_avgcurr, d_preimg, d_flowx, d_flowy);
}
d_flowx.download(planes[0]);
d_flowy.download(planes[1]);
d_avgcurr.release();
d_preimg.release();
d_flowx.release();
d_flowy.release();
#else
if (cnt==2)
calcOpticalFlowFarneback(avgcurr8, preimg8, flow, 0.5, 6, winSize, 1, 5, 1.1, 0);
else
{
flowFileName=foname.removeLastExtension()+formatString("flow%d%d.txt",div*2,flowCounter);
readMat(flowFileName.c_str(), flow);
calcOpticalFlowFarneback(avgcurr8, preimg8, flow, 0.5, 6, winSize, 1, 5, 1.1, cv::OPTFLOW_USE_INITIAL_FLOW);
}
split(flow, planes);
#endif
// Save the flows if we are in the last step
if (div==groupSize)
{
if (i > 0)
{