MeVisLab Toolbox Reference
|
Class defining a list of tags used in the MLImageFormat class. More...
#include <mlImageFormatTagList.h>
Public Member Functions | |
Basic class stuff, constructor, destructor, assignment etc. | |
MLImageFormatTagList () | |
Default constructor, setting name and value to empty strings. More... | |
MLuint | getTagListSizeInBytes () const |
Returns sum of sizes of all tag names and values of all tags including their terminating 0 characters or 0 on failure. More... | |
void | tagListOut (std::ostream &ostr) const |
Passes the tag list into a the stream ostr. More... | |
std::string | getTagListAsString () const |
Passes the tag list into a the string str. More... | |
const MLImageFormatTag * | findConstTag (const std::string &tagName) const |
Returns pointer to first tag in list with name tagName or NULL if not found. More... | |
MLint | findTagIdx (const std::string &tagName) const |
Returns index to first tag in list with name tagName or -1 if not found or on failure. More... | |
bool | checkTag (const std::string &tagName, MLint &val) const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned. More... | |
bool | checkTag (const std::string &tagName, std::string &val) const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned. More... | |
bool | checkTag (const std::string &tagName, MLdouble &val) const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned. More... | |
bool | checkTag (const std::string &tagName, MLldouble &val) const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned. More... | |
MLuint | getExpectedHeaderAndListSizeAsBinary () const |
Returns the number of bytes which would be needed to store the header and tag list in memory before writing it to the file. More... | |
char * | getHeaderAndListAsBinary (size_t &memSize, MLuint32 saveModeBits) const |
Create a memory buffer and fill if first with a null-terminated versionStr followed by all tagNames and values from the list. More... | |
MLErrorCode | save (MLImageFormatAbstractFileHandle *fileHandle, MLuint filePos, MLuint32 saveModeBits) const |
Writes the tag list into an open and writable file to position filePos or to the current file position. More... | |
MLErrorCode | load (MLImageFormatAbstractFileHandle *fileHandle, MLint filePos=0) |
Reads the tag list from start of open file given by valid file handle for a readable and open file. More... | |
MLErrorCode | appendImageProperties (const PagedImage &props, const DataCompressor *compressor, const MLImageFormatTagList &compressionTagList, const MLImageFormatTagList &userTagList, const MLImageFormatTagList &privateTagList, const std::string &defaultVoxelValue, MLuint32 saveModeBits) |
Append image properties and other information to tagList. More... | |
MLErrorCode | extractImageProperties (PagedImage &props, MLint &endianess, std::string &compressorName, std::string &compressorVersion, MLImageFormatTagList &compressionTagList, MLImageFormatTagList &userTagList, MLImageFormatTagList &privateTagList, std::string &defaultVoxelValue, MLint &usesCheckSum, MLint &usesPartialPages) |
Gets image properties from a non empty tag list, empty lists are considered okay, only safely found settings are changed in the return values. More... | |
MLErrorCode | extractImageProperties (MLImageFormatInfos &infos) |
Gets all image properties of infos except of the. More... | |
void | appendSpecialTags (const std::string &numTagsTagName, const std::string &tagNamePrefix, const MLImageFormatTagList &sourceTagList) |
Helper function to special tags in a standardized way to the tag list. More... | |
MLErrorCode | extractSpecialTags (const std::string &numTagsTagName, const std::string &tagNamePrefix, MLImageFormatTagList &targetTagList) const |
Helper function to extract special tags in a standardized way from this tag list into a target tag list. More... | |
Static Public Member Functions | |
static const MLImageFormatTagList & | getDefaultEmptyTagList () |
Returns a default empty tags list. Must be called cfirst time in dll-init. More... | |
Static Public Attributes | |
static const MLint | ML_LITTLE_ENDIAN |
Little endian. More... | |
static const MLint | ML_BIG_ENDIAN |
Big endian. More... | |
static const std::string | ML_DICOM_TAG_PREFIX |
Name prefix for all stored DICOM tags. More... | |
static const std::string | ML_TAG_LIST_SIZE_IN_BYTES_TAG |
Name of first tag whose value denotes the size of the entire tag list size. More... | |
Class defining a list of tags used in the MLImageFormat class.
Definition at line 39 of file mlImageFormatTagList.h.
ml::MLImageFormatTagList::MLImageFormatTagList | ( | ) |
Default constructor, setting name and value to empty strings.
MLErrorCode ml::MLImageFormatTagList::appendImageProperties | ( | const PagedImage & | props, |
const DataCompressor * | compressor, | ||
const MLImageFormatTagList & | compressionTagList, | ||
const MLImageFormatTagList & | userTagList, | ||
const MLImageFormatTagList & | privateTagList, | ||
const std::string & | defaultVoxelValue, | ||
MLuint32 | saveModeBits | ||
) |
Append image properties and other information to tagList.
Convenience function, independent of open files etc.
props | the properties to be stored in tag list. |
compressor | name of the data compressor stored in tag list. |
compressionTagList | additional arguments for compressor to be stored in list. |
userTagList | user tags to be added to tag list. |
privateTagList | private tags to be added to tag list. |
defaultVoxelValue | default voxel value for unstored pages to be stored in list. |
saveModeBits | Bit combination setting special save options: See MLImageFormatTools::SaveModeBits for possible options. |
void ml::MLImageFormatTagList::appendSpecialTags | ( | const std::string & | numTagsTagName, |
const std::string & | tagNamePrefix, | ||
const MLImageFormatTagList & | sourceTagList | ||
) |
Helper function to special tags in a standardized way to the tag list.
numTagsTagName | The name of the tag which will store the of added tags. |
tagNamePrefix | Prefix added before each name of added tags. tagNamePrefix must not contain ":" characters. |
sourceTagList | List of special tags to be added. |
bool ml::MLImageFormatTagList::checkTag | ( | const std::string & | tagName, |
MLdouble & | val | ||
) | const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned.
On failure false is returned and val is left unchanged.
bool ml::MLImageFormatTagList::checkTag | ( | const std::string & | tagName, |
MLint & | val | ||
) | const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned.
On failure false is returned and val is left unchanged.
bool ml::MLImageFormatTagList::checkTag | ( | const std::string & | tagName, |
MLldouble & | val | ||
) | const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned.
On failure false is returned and val is left unchanged.
bool ml::MLImageFormatTagList::checkTag | ( | const std::string & | tagName, |
std::string & | val | ||
) | const |
Searches tag with name tagName in list and if it exists then its value is read into val and true is returned.
On failure false is returned and val is left unchanged.
MLErrorCode ml::MLImageFormatTagList::extractImageProperties | ( | MLImageFormatInfos & | infos | ) |
Gets all image properties of infos except of the.
infos | The information object to be filled with extracted information. |
MLErrorCode ml::MLImageFormatTagList::extractImageProperties | ( | PagedImage & | props, |
MLint & | endianess, | ||
std::string & | compressorName, | ||
std::string & | compressorVersion, | ||
MLImageFormatTagList & | compressionTagList, | ||
MLImageFormatTagList & | userTagList, | ||
MLImageFormatTagList & | privateTagList, | ||
std::string & | defaultVoxelValue, | ||
MLint & | usesCheckSum, | ||
MLint & | usesPartialPages | ||
) |
Gets image properties from a non empty tag list, empty lists are considered okay, only safely found settings are changed in the return values.
props | is filled with the properties of the stored file. |
endianess | returns the endianess of the data in the file. |
compressorName | returns the name of the data compressor used for that file. |
compressorVersion | returns the version of the data compressor used for that file. |
compressionTagList | returns compressionScheme and additional arguments. |
userTagList | returns the list with user defined tags. |
privateTagList | returns the list with private tags. |
defaultVoxelValue | returns the default voxel value for non stored pages. |
usesCheckSum | returns non zero if data is stored with check sum, otherwise 0. |
usesPartialPages | returns non zero if pages are potentially only stored partially, otherwise 0. |
MLErrorCode ml::MLImageFormatTagList::extractSpecialTags | ( | const std::string & | numTagsTagName, |
const std::string & | tagNamePrefix, | ||
MLImageFormatTagList & | targetTagList | ||
) | const |
Helper function to extract special tags in a standardized way from this tag list into a target tag list.
See symmetric function appendSpecialTagsToTagList().
numTagsTagName | The name of the tag which contains the number of added tags. |
tagNamePrefix | Prefix added before each name of added tags. tagNamePrefix must not contain ":" characters. |
targetTagList | List in which to store the extracted tags. |
const MLImageFormatTag* ml::MLImageFormatTagList::findConstTag | ( | const std::string & | tagName | ) | const |
Returns pointer to first tag in list with name tagName or NULL if not found.
MLint ml::MLImageFormatTagList::findTagIdx | ( | const std::string & | tagName | ) | const |
Returns index to first tag in list with name tagName or -1 if not found or on failure.
|
static |
Returns a default empty tags list. Must be called cfirst time in dll-init.
MLuint ml::MLImageFormatTagList::getExpectedHeaderAndListSizeAsBinary | ( | ) | const |
Returns the number of bytes which would be needed to store the header and tag list in memory before writing it to the file.
char* ml::MLImageFormatTagList::getHeaderAndListAsBinary | ( | size_t & | memSize, |
MLuint32 | saveModeBits | ||
) | const |
Create a memory buffer and fill if first with a null-terminated versionStr followed by all tagNames and values from the list.
memSize | returns the size of the allocated memory or 0 on failure. |
saveModeBits | Bit combination setting special save options: See MLImageFormatTools::SaveModeBits for possible options. |
std::string ml::MLImageFormatTagList::getTagListAsString | ( | ) | const |
Passes the tag list into a the string str.
MLuint ml::MLImageFormatTagList::getTagListSizeInBytes | ( | ) | const |
Returns sum of sizes of all tag names and values of all tags including their terminating 0 characters or 0 on failure.
MLErrorCode ml::MLImageFormatTagList::load | ( | MLImageFormatAbstractFileHandle * | fileHandle, |
MLint | filePos = 0 |
||
) |
Reads the tag list from start of open file given by valid file handle for a readable and open file.
The tagList will be reset always on start of call. On failure the tag list is reset/emptied.
fileHandle | The handle for the file opened for reading. |
filePos | The position in file where to read the table from. Should normally be 0, the default. |
MLErrorCode ml::MLImageFormatTagList::save | ( | MLImageFormatAbstractFileHandle * | fileHandle, |
MLuint | filePos, | ||
MLuint32 | saveModeBits | ||
) | const |
Writes the tag list into an open and writable file to position filePos or to the current file position.
fileHandle | must be a valid file handle of an open and writable file. |
filePos | is the position where to write the data. |
saveModeBits | Bit combination setting special save options: See MLImageFormatTools::SaveModeBits for possible options. |
void ml::MLImageFormatTagList::tagListOut | ( | std::ostream & | ostr | ) | const |
Passes the tag list into a the stream ostr.
|
static |
Big endian.
Definition at line 46 of file mlImageFormatTagList.h.
|
static |
Name prefix for all stored DICOM tags.
Definition at line 51 of file mlImageFormatTagList.h.
|
static |
Little endian.
Definition at line 45 of file mlImageFormatTagList.h.
|
static |
Name of first tag whose value denotes the size of the entire tag list size.
Definition at line 56 of file mlImageFormatTagList.h.