open_iA 2021.08
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Enumerations | Functions
iAFileUtils.h File Reference
#include "iAbase_export.h"
#include <QFlags>
#include <QStringList>
#include <string>

Enumerations

enum  FilesFolders { Files , Folders , FilesAndFolders }
 

Functions

iAbase_API void determineStackParameters (QString const &fullFileName, QString &prefix, QString &suffix, int range[2], int &digits)
 Determine parameters for (image) stacks from a given filename. More...
 
iAbase_API QString fileNameOnly (QString const &fileName)
 
iAbase_API void FindFiles (QString const &directory, QStringList const &filters, bool recurse, QStringList &filesOut, QFlags< FilesFolders > filesFolders)
 
iAbase_API std::string getLocalEncodingFileName (QString const &fileName)
 
iAbase_API QString MakeAbsolute (QString const &baseDir, QString const &fileName)
 
iAbase_API QString MakeRelative (QString const &baseDir, QString const &fileName)
 
iAbase_API QString pathFileBaseName (QFileInfo const &fi)
 returns the full path of the given file along with the file's basename. More...
 

Enumeration Type Documentation

◆ FilesFolders

Enumerator
Files 
Folders 
FilesAndFolders 

Function Documentation

◆ determineStackParameters()

iAbase_API void determineStackParameters ( QString const &  fullFileName,
QString &  prefix,
QString &  suffix,
int  range[2],
int &  digits 
)

Determine parameters for (image) stacks from a given filename.

Takes a filename, and checks the folder containing this file for similarly named files; it determines a common prefix and suffix, and the range of numbers contained in the part of the filename that varies. If multiple files exist in the same folder, with different parts varying, then the values for first of these will be contained in the returned variables. example: content of folder: file1-1.tif file1-2.tif file1-3.tif file2-1.tif file2-2.tif filename: file1-1.tif result: prefix="file1-", suffix=".tif", range=[1,3], digits=1 (note that prefix="file", suffix="-1.tif", range=[1,2], digits=1 would also be a valid "solution")

Parameters
[in]fullFileNamefull file name (including path)
[out]prefixthe prefix that all files which were determined to belong to the stack share
[out]suffixthe suffix that all files which were determined to belong to the stack share
[out]rangethe minimum (index 0) and maximum (index 1) number occurring in the string part not shared between the filenames belonging to the stack
[out]digitsthe number of digits in the numbers of the filenames belonging to the stack (typically padded by zeros)

◆ fileNameOnly()

iAbase_API QString fileNameOnly ( QString const &  fileName)

◆ FindFiles()

iAbase_API void FindFiles ( QString const &  directory,
QStringList const &  filters,
bool  recurse,
QStringList &  filesOut,
QFlags< FilesFolders filesFolders 
)

◆ getLocalEncodingFileName()

iAbase_API std::string getLocalEncodingFileName ( QString const &  fileName)

◆ MakeAbsolute()

iAbase_API QString MakeAbsolute ( QString const &  baseDir,
QString const &  fileName 
)

◆ MakeRelative()

iAbase_API QString MakeRelative ( QString const &  baseDir,
QString const &  fileName 
)

◆ pathFileBaseName()

iAbase_API QString pathFileBaseName ( QFileInfo const &  fi)

returns the full path of the given file along with the file's basename.

e.g. if the given QFileInfo points to C:/test/data.mhd, the function would return C:/test/data