本文整理汇总了C++中FileList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::at方法的具体用法?C++ FileList::at怎么用?C++ FileList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadPreprocessedFiles
static ImageList LoadPreprocessedFiles(FileList files)
{
ImageList images;
for (unsigned int i=0; i < files.size() ; ++i)
{
images.push_back(mitk::IOUtil::LoadImage(files.at(i)));
}
return images;
}
示例2: main
int main( int argc, char* argv[] )
{
// Parse Command-Line Arguments
mitkCommandLineParser parser;
parser.setArgumentPrefix("--","-");
parser.setTitle("Tumor Progression Mapping");
parser.setCategory("Preprocessing Tools");
parser.setContributor("MBI");
parser.setDescription("Convert a set of co-registered and resampled follow-up images into a 2D png overview (and optionally in a 4D NRRD Volume).\nNaming convecntion of files is IDENTIFIER_YYYY-MM-DD_MODALITY.nrrd");
parser.setArgumentPrefix("--","-");
parser.addArgument("input", "i", mitkCommandLineParser::InputDirectory, "Input folder containing all follow ups");
parser.addArgument("output", "o", mitkCommandLineParser::OutputFile,"Output file (PNG)");
parser.addArgument("blanked", "b", mitkCommandLineParser::Bool, "Only Display Morphology");
parser.addArgument("morphology", "m", mitkCommandLineParser::String, "Morphology postfix.", "_T2.nrrd");
parser.addArgument("segmentation", "s", mitkCommandLineParser::String, "Segmentation postfix. Default: _GTV.nrrd", "_GTV.nrrd");
parser.addArgument("4dVolume", "v", mitkCommandLineParser::OutputFile, "Filepath to merged 4d NRRD Volume.");
parser.addArgument("skip", "k", mitkCommandLineParser::Int, "Number of slices to be skipped from top and from button (Default 0)");
parser.addArgument("interval", "n", mitkCommandLineParser::Int, "1 - for all slices, 2 - every second, 3 - every third ...");
parser.addArgument("opacity", "c", mitkCommandLineParser::Float, "Opacity of overlay [0,1] invisible -> visible");
map<string, us::Any> parsedArgs = parser.parseArguments(argc, argv);
if ( parsedArgs.size()==0 )
return EXIT_SUCCESS;
// Show a help message
if (parsedArgs.count("help") || parsedArgs.count("h"))
{
std::cout << parser.helpText();
return EXIT_SUCCESS;
}
std::string outputFile;
std::string inputFolder;
if (parsedArgs.count("input") || parsedArgs.count("i") )
{
inputFolder = us::any_cast<string> (parsedArgs["input"]) + "/";
}
if (parsedArgs.count("output") || parsedArgs.count("o") )
{
outputFile = us::any_cast<string> (parsedArgs["output"]);
}
int skip = 0;
int interval = 1;
float opacity = .3;
if (parsedArgs.count("skip") || parsedArgs.count("k") )
{
skip = us::any_cast<int>(parsedArgs["skip"]);
}
if (parsedArgs.count("interval") || parsedArgs.count("n") )
{
interval = us::any_cast<int>(parsedArgs["interval"]);
}
if (parsedArgs.count("opacity") || parsedArgs.count("c") )
{
opacity = us::any_cast<float>(parsedArgs["opacity"]);
}
FileList morphFiles;
FileList segFiles;
std::string refPattern;
std::string segPattern;
if (parsedArgs.count("morphology") || parsedArgs.count("m") )
{
refPattern = us::any_cast<std::string>(parsedArgs["morphology"]);
}
else
return EXIT_FAILURE;
if (parsedArgs.count("segmentation") || parsedArgs.count("s") )
{
segPattern = us::any_cast<std::string>(parsedArgs["segmentation"]);
}
bool blank = false;
if (parsedArgs.count("blanked") || parsedArgs.count("b"))
{
blank = true;
}
/// END Parsing CL Options
typedef itk::Image<RGBPixelType, 2> OutputImageType;
typedef itk::Image<RGBPixelType, 3> InputImageType;
mitkProgressionVisualization progressVis;
morphFiles = CreateFileList(inputFolder,refPattern);
segFiles = CreateFileList(inputFolder,segPattern);
//.........这里部分代码省略.........
示例3: IsisMain
void IsisMain() {
// Get the list of cubes to process
FileList imageList;
UserInterface &ui = Application::GetUserInterface();
imageList.Read(ui.GetFilename("FROMLIST"));
// Read to list if one was entered
FileList outList;
if (ui.WasEntered("TOLIST")) {
outList.Read(ui.GetFilename("TOLIST"));
}
// Check for user input errors and return the file list sorted by CCD numbers
ErrorCheck(imageList, outList);
// Adds statistics for whole and side regions of every cube
for (int img=0; img<(int)imageList.size(); img++) {
g_s.Reset();
g_sl.Reset();
g_sr.Reset();
iString maxCube ((int)imageList.size());
iString curCube (img+1);
ProcessByLine p;
p.Progress()->SetText("Gathering Statistics for Cube " +
curCube + " of " + maxCube);
CubeAttributeInput att;
const std::string inp = imageList[img];
p.SetInputCube(inp, att);
p.StartProcess(GatherStatistics);
p.EndProcess();
g_allStats.push_back(g_s);
g_leftStats.push_back(g_sl);
g_rightStats.push_back(g_sr);
}
// Initialize the object that will calculate the gains and offsets
g_oNorm = new OverlapNormalization(g_allStats);
// Add the known overlaps between two cubes, and apply a weight to each
// overlap equal the number of pixels in the overlapping area
for (int i=0; i<(int)imageList.size()-1; i++) {
int j = i+1;
g_oNorm->AddOverlap(g_rightStats[i], i, g_leftStats[j], j,
g_rightStats[i].ValidPixels());
}
// Read in and then set the holdlist
FileList holdList;
holdList.Read(ui.GetFilename("HOLD"));
for (unsigned i=0; i<holdList.size(); i++) {
int index = -1;
for (unsigned j=0; j<imageList.size(); j++) {
std::string curName = imageList.at(j);
if (curName.compare(holdList[i]) == 0) {
index = j;
g_oNorm->AddHold(index);
}
}
}
// Attempt to solve the least squares equation
g_oNorm->Solve(OverlapNormalization::Both);
// Apply correction to the cubes if desired
bool applyopt = ui.GetBoolean("APPLY");
if (applyopt) {
// Loop through correcting the gains and offsets by line for every cube
for (int img=0; img<(int)imageList.size(); img++) {
g_imageNum = img;
ProcessByLine p;
iString max_cube ((int)imageList.size());
iString cur_cube (img+1);
p.Progress()->SetText("Equalizing Cube " + cur_cube + " of " + max_cube);
CubeAttributeInput att;
const std::string inp = imageList[img];
Cube *icube = p.SetInputCube(inp, att);
Filename file = imageList[img];
// Establish the output file depending upon whether or not a to list
// was entered
std::string out;
if (ui.WasEntered("TOLIST")) {
out = outList[img];
}
else {
Filename file = imageList[img];
out = file.Path() + "/" + file.Basename() + ".equ." + file.Extension();
}
CubeAttributeOutput outAtt;
p.SetOutputCube(out,outAtt,icube->Samples(),icube->Lines(),icube->Bands());
p.StartProcess(Apply);
p.EndProcess();
}
}
//.........这里部分代码省略.........