MeVisLab Toolbox Reference
|
A collection of some IO tools. More...
#include "MLReleaseToolsSystem.h"
#include <mlModuleIncludes.h>
#include <mlAPI.h>
#include "mlDirectoryMatching.h"
#include <list>
Go to the source code of this file.
Namespaces | |
namespace | ml |
Main documentation file for ML users and developers. | |
namespace | ml::ReleaseToolsIO |
A collection of static IO tool functions. | |
Functions | |
MLRELEASE_TOOLS_EXPORT bool | ml::ReleaseToolsIO::isDICOMTiffPair (const std::string &oneFile, std::string *otherFile=nullptr, std::string *dcmFile=nullptr, std::string *tiffFile=nullptr) |
Returns true if oneFile is one of two files of a DICOM/Tiff pair, otherwise false. | |
MLRELEASE_TOOLS_EXPORT bool | ml::ReleaseToolsIO::hasMLImageSuffix (const std::string &filePathWithName) ML_RETURN_VALUE_SHOULD_BE_USED |
Returns true if the if filePathWithName ends with a string compatible with the .mlimage file format, otherwise false. | |
MLRELEASE_TOOLS_EXPORT bool | ml::ReleaseToolsIO::isFileOrSuffixInList (const std::string &fileNamePath, const std::vector< std::string > sufList) ML_RETURN_VALUE_SHOULD_BE_USED |
Returns true if fileNamePath ends with a string in sufList which has a leading dot, or if it is the same with an entry without leading dot. | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::searchFileTypeInBinaryHeader (const std::string &fullFilePath) ML_RETURN_VALUE_SHOULD_BE_USED |
If a known one is found then it returns the suffix corresponding to the format, otherwise an empty string is returned. | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::buildRelativePath (bool useRelativePaths, const std::string &fileRootDirPath, const std::string &fNamePath, bool allowBranchedSubDirs=false, bool allowMultiFrameHandles=false) ML_RETURN_VALUE_SHOULD_BE_USED |
Helper function to make a path relative if it matches a passed parent path. | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::removeRedundantPathComponents (const std::string &pathAndFileNameStr) ML_RETURN_VALUE_SHOULD_BE_USED |
Removes ".."/ components from pathAndFileNameStr's such as "abc/xyz/../def" by reducing it to "abc/def" if possible. | |
MLRELEASE_TOOLS_EXPORT void | ml::ReleaseToolsIO::removeRedundantPathComponents (const std::string &pathToSimplify, std::string &simplifiedPath) |
Same as removeRedundantPathComponents(const std::string &pathAndFileNameStr) but returning value in simplifiedPath. | |
MLRELEASE_TOOLS_EXPORT void | ml::ReleaseToolsIO::removeRedundantPathComponentsInPlace (std::string &pathToSimplify) |
Same as removeRedundantPathComponents(const std::string &pathAndFileNameStr) but passing input into into and getting out result in pathToSimplifysimplifiedPath. | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::buildAbsolutePath (bool allowMakeAbsolute, const std::string &fileRootDirPath, const std::string &relativeFileNameStr, bool simplifyPaths=false, bool allowMultiFrameHandles=false) ML_RETURN_VALUE_SHOULD_BE_USED |
Helper function to make a relative path name absolute under some circumstances. | |
MLRELEASE_TOOLS_EXPORT void | ml::ReleaseToolsIO::buildAbsolutePath (bool allowMakeAbsolute, const std::string fileRootDirPath, const std::string &relativeFileNameStrIn, bool simplifyPaths, bool allowMultiFrameHandles, std::string &relPathFileName) |
Same as std::string buildAbsolutePath(...) but returning result in relPathFileName. | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::appendSingleSlash (const std::string &srcStr) ML_RETURN_VALUE_SHOULD_BE_USED |
Appends a single forward slash to srcStr if it still does not end with one, however, in case of empty strings nothing is appended. | |
MLRELEASE_TOOLS_EXPORT std::vector< std::string > | ml::ReleaseToolsIO::splitFilePath (const std::string &pathLikeString) ML_RETURN_VALUE_SHOULD_BE_USED |
Splits a (path) string into its components. | |
MLRELEASE_TOOLS_EXPORT void | ml::ReleaseToolsIO::splitFilePath (const std::string &pathLikeString, std::vector< std::string > &retPath) |
Same as splitFilePath(const std::string &pathLikeString), only returning the result in retVal;. | |
MLRELEASE_TOOLS_EXPORT void | ml::ReleaseToolsIO::splitPathAndName (std::string fullPathAndName, std::string &fPath, std::string &fName) |
Splits the full path with file fullPathAndName into two components, the base path and the fileName at its end (redundant path components are removed). | |
MLRELEASE_TOOLS_EXPORT std::string | ml::ReleaseToolsIO::substituteNonPathLikeChars (std::string strToCorrect) ML_RETURN_VALUE_SHOULD_BE_USED |
Small helper function to replace some characters not suitable for paths by '-' or '. | |
MLRELEASE_TOOLS_EXPORT MLErrorCode | ml::ReleaseToolsIO::loadStringFile (const std::string &strFileName, std::string &readString) ML_RETURN_VALUE_SHOULD_BE_USED |
Load a binary file into readString and return ML_RESULT_OK on success, ML_FILE_IO_ERROR on other file IO errors or ML_NO_MEMORY on allocation failures. | |
MLRELEASE_TOOLS_EXPORT MLErrorCode | ml::ReleaseToolsIO::reformatColorChannels (const std::vector< SubImage > &frameSubImgs, MLint frameOffset, SubImage &outSubImg, size_t dimIdx, bool isInterleaved, MLint timeUnrollSteps) ML_RETURN_VALUE_SHOULD_BE_USED |
Helper function to copy data from frameSubImages into outSubImg into the dimension given by dimIdx. | |
MLRELEASE_TOOLS_EXPORT bool | ml::ReleaseToolsIO::scanDirectoriesForFiles (ProgressLogger *progressLogger, const std::string &sourceDir, const std::vector< std::string > *suppressedFilesAndSuffixes, bool recursively, std::vector< std::string > &resultFileVector, std::vector< std::string > *resultDirVector=nullptr, bool returnRelativePaths=false, bool alsoSuppressDirectories=false, bool warnNoSourceSourceDir=false, float progressMinimum=0.0, float progressMaximum=1.0, std::vector< std::string > *checkForFileExtensions=nullptr, bool *checkForFileExtensionsFound=nullptr) |
Searches files and directories optionally recursively in sourceDir; if suppressedFilesAndSuffixes is passed non-nullptr then files and/or directories can be suppressed if they match or terminate with any of the elements. | |
MLRELEASE_TOOLS_EXPORT MLErrorCode | ml::ReleaseToolsIO::deleteListOfFiles (std::list< std::string > *fileNameList, ProgressLogger *progressLogger=nullptr) |
Tool function that deletes files for a given list of filenames. | |