|
MeVisLab Toolbox Reference
|
Class defining a list of tags used in the MLImageFormat class. More...
#include <mlImageFormatTagList.h>
Public Member Functions | |
Basic class elements, constructor, destructor, assignment, etc. | |
| MLImageFormatTagList () | |
| Default constructor that is setting name and value to empty strings. | |
| MLuint | getTagListSizeInBytes () const |
| void | tagListOut (std::ostream &ostr) const |
| Passes the tag list into the stream ostr. | |
| std::string | getTagListAsString () const |
| Passes the tag list into the string str. | |
| const MLImageFormatTag * | findConstTag (const std::string &tagName) const |
| MLint | findTagIdx (const std::string &tagName) const |
| bool | checkTag (const std::string &tagName, MLint &val) const |
| bool | checkTag (const std::string &tagName, std::string &val) const |
| bool | checkTag (const std::string &tagName, MLdouble &val) const |
| bool | checkTag (const std::string &tagName, MLldouble &val) const |
| MLuint | getExpectedHeaderAndListSizeAsBinary () const |
| char * | getHeaderAndListAsBinary (size_t &memSize, MLuint32 saveModeBits) const |
| MLErrorCode | save (MLImageFormatAbstractFileHandle *fileHandle, MLuint filePos, MLuint32 saveModeBits) const |
| MLErrorCode | load (MLImageFormatAbstractFileHandle *fileHandle, MLint filePos=0) |
| MLErrorCode | appendImageProperties (const PagedImage &props, const DataCompressor *compressor, const MLImageFormatTagList &compressionTagList, const MLImageFormatTagList &userTagList, const MLImageFormatTagList &privateTagList, const std::string &defaultVoxelValue, MLuint32 saveModeBits) |
| MLErrorCode | extractImageProperties (PagedImage &props, MLint &endianness, std::string &compressorName, std::string &compressorVersion, MLImageFormatTagList &compressionTagList, MLImageFormatTagList &userTagList, MLImageFormatTagList &privateTagList, std::string &defaultVoxelValue, MLint &usesCheckSum, MLint &usesPartialPages) |
| MLErrorCode | extractImageProperties (MLImageFormatInfos &infos) |
| void | appendSpecialTags (const std::string &numTagsTagName, const std::string &tagNamePrefix, const MLImageFormatTagList &sourceTagList) |
| MLErrorCode | extractSpecialTags (const std::string &numTagsTagName, const std::string &tagNamePrefix, MLImageFormatTagList &targetTagList) const |
Static Public Member Functions | |
| static const MLImageFormatTagList & | getDefaultEmptyTagList () |
| Returns a default empty tags list. Must be called first time in DLL initialization. | |
Static Public Attributes | |
| static const MLint | ML_LITTLE_ENDIAN |
| Little endian. | |
| static const MLint | ML_BIG_ENDIAN |
| Big endian. | |
| static const std::string | ML_DICOM_TAG_PREFIX |
| Name prefix for all stored DICOM tags. | |
| 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. | |
Class defining a list of tags used in the MLImageFormat class.
Definition at line 39 of file mlImageFormatTagList.h.
| ml::MLImageFormatTagList::MLImageFormatTagList | ( | ) |
Default constructor that is setting name and value to empty strings.
Referenced by appendImageProperties(), appendSpecialTags(), extractImageProperties(), extractSpecialTags(), and getDefaultEmptyTagList().
| 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 ) |
Appends image properties and other information to tagList. Convenience function that is independent of open files.
| props | The properties to be stored in the tag list. |
| compressor | Name of the data compressor stored in the tag list. |
| compressionTagList | Additional arguments for compressor to be stored in the tag list. |
| userTagList | User tags to be added to the tag list. |
| privateTagList | Private tags to be added to the tag list. |
| defaultVoxelValue | Default voxel value for unstored pages to be stored in the tag list. |
| saveModeBits | Bit combination that is setting special save options: See MLImageFormatTools::SaveModeBits for possible options. |
References MLImageFormatTagList().
| 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 that 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. |
References MLImageFormatTagList().
| bool ml::MLImageFormatTagList::checkTag | ( | const std::string & | tagName, |
| MLdouble & | val ) const |
Searches the tag with the name tagName in the 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 the tag with the name tagName in the 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 the tag with the name tagName in the 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 the tag with the name tagName in the 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 | ) |
Returns 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 & | endianness, | ||
| std::string & | compressorName, | ||
| std::string & | compressorVersion, | ||
| MLImageFormatTagList & | compressionTagList, | ||
| MLImageFormatTagList & | userTagList, | ||
| MLImageFormatTagList & | privateTagList, | ||
| std::string & | defaultVoxelValue, | ||
| MLint & | usesCheckSum, | ||
| MLint & | usesPartialPages ) |
Returns image properties from a non-empty tag list, empty lists are considered okay. Only safely found settings are changed in the return values.
| props | Filled with the properties of the stored file. |
| endianness | Returns the endianness 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, 0 otherwise. |
| usesPartialPages | Returns non-zero if pages are potentially only stored partially, 0 otherwise. |
References MLImageFormatTagList().
| 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 the symmetric function appendSpecialTagsToTagList().
| numTagsTagName | The name of the tag that 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. |
References MLImageFormatTagList().
| const MLImageFormatTag * ml::MLImageFormatTagList::findConstTag | ( | const std::string & | tagName | ) | const |
Returns a pointer to the first tag in the list with the name tagName or NULL if not found.
| MLint ml::MLImageFormatTagList::findTagIdx | ( | const std::string & | tagName | ) | const |
Returns the index to the first tag in the list with the name tagName or -1 if not found or on failure.
|
static |
Returns a default empty tags list. Must be called first time in DLL initialization.
References MLImageFormatTagList().
Referenced by ml::MLImageFormat::open(), ml::MLImageFormatTools::open(), and ml::MLImageFormatTools::open().
| MLuint ml::MLImageFormatTagList::getExpectedHeaderAndListSizeAsBinary | ( | ) | const |
Returns the number of bytes that 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 |
Creates 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 the string str.
| MLuint ml::MLImageFormatTagList::getTagListSizeInBytes | ( | ) | const |
Returns the 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 the start of the open file given by a 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 that is opened for reading. |
| filePos | The position in the 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 | 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 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.