本文整理汇总了C++中FileListType::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ FileListType::push_back方法的具体用法?C++ FileListType::push_back怎么用?C++ FileListType::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileListType
的用法示例。
在下文中一共展示了FileListType::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateDerivedFileList
/// Build a derived file name from moving images e.g. xxx_T2.nrrd becomes xxx_GTV.nrrd
static FileListType CreateDerivedFileList(std::string baseFN, std::string baseSuffix, std::vector<std::string> derivedPatterns)
{
FileListType files;
for (unsigned int i=0; i < derivedPatterns.size(); i++)
{
std::string derResourceSuffix = derivedPatterns.at(i);
std::string derivedResourceFilename = baseFN.substr(0,baseFN.length() -baseSuffix.length()) + derResourceSuffix;
MITK_INFO <<" Looking for file: " << derivedResourceFilename;
if (!itksys::SystemTools::FileExists(derivedResourceFilename.c_str()))
{
MITK_INFO << "CreateDerivedFileList: File does not exit. Skipping entry.";
continue;
}
files.push_back(derivedResourceFilename);
}
return files;
}
示例2: CreateFileList
/// Create list of all files in provided folder ending with same postfix
static FileListType CreateFileList(std::string folder , std::string postfix)
{
itk::Directory::Pointer dir = itk::Directory::New();
FileListType fileList;
if( dir->Load(folder.c_str() ) )
{
int n = dir->GetNumberOfFiles();
for(int r=0;r<n;r++)
{
std::string filename = dir->GetFile( r );
if (filename == "." || filename == "..")
continue;
filename = folder + filename;
if (!itksys::SystemTools::FileExists( filename.c_str()))
continue;
if (filename.substr(filename.length() -postfix.length() ) == postfix)
fileList.push_back(filename);
}
}
return fileList;
}