Public Member Functions | |
MdfDatasetManager (const OFBool debug=OFFalse) | |
Constructor, initializes member-variables. | |
~MdfDatasetManager () | |
Destructor. | |
OFCondition | loadFile (const char *file_name, const E_FileReadMode readMode=ERM_autoDetect, const E_TransferSyntax xfer=EXS_Unknown) |
Loads a file into dataset manager. | |
OFCondition | modifyOrInsertTag (OFString tag_path, const OFString &value, const OFBool &only_modify, const OFBool update_metaheader=OFTrue) |
Modifies/Inserts a tag with a specific value. | |
OFCondition | modifyAllTags (OFString tag_path, const OFString &value, const OFBool update_metaheader, int &count) |
Modifies all matching tags in dataset to a new value. | |
OFCondition | deleteTag (OFString tag_path, const OFBool &all_tags) |
Deletes tag in dataset. | |
OFCondition | generateNewStudyUID () |
Generates new 'Study Instance UID' and inserts it into the dataset. | |
OFCondition | generateNewSeriesUID () |
Generates new 'Series Instance UID' and inserts it into the dataset. | |
OFCondition | generateNewInstanceUID () |
Generates new 'SOP Instance UID' and inserts it into the dataset. | |
OFCondition | saveFile (const char *file_name, E_TransferSyntax opt_xfer=EXS_Unknown, E_EncodingType opt_enctype=EET_UndefinedLength, E_GrpLenEncoding opt_glenc=EGL_recalcGL, E_PaddingEncoding opt_padenc=EPD_noChange, OFCmdUnsignedInt opt_filepad=0, OFCmdUnsignedInt opt_itempad=0, OFBool opt_dataset=OFFalse) |
Saves current dataset back to a file. | |
OFCondition | saveFile () |
Saves current dataset back to file using original filename and original parameters like transfer syntax, padding etc. | |
DcmDataset * | getDataset () |
Returns the dataset, that this MdfDatasetManager handles. | |
DcmFileFormat * | getFileFormat () |
Returns the DcmFileFormat, that this MdfDatasetManager handles. | |
OFString | getFilename () const |
Returns filename of the file, that's loaded currently. | |
Protected Member Functions | |
OFCondition | startModify (DcmElement *elem, const OFString &value) |
modifies element to a specific value | |
OFCondition | startInsert (DcmItem *item, DcmTagKey &search_key, const OFString &value) |
inserts tag into item with a specific value, overwrites existing tag | |
void | deleteRelatedMetaheaderTag (const DcmTagKey &key) |
If key is the tag for SOPInstanceUID or SOPClassUID, then this function removes the related MediaStorage UIDs from the metaheader. | |
OFCondition | hasValidGroupNumber (const DcmTagKey &key) |
Checks whether group number is 0,1,2,3,5 or 7. | |
OFBool | isPrivateTag (const DcmTagKey &tag_key) |
Returns true, if given tag is a private tag (odd group number). | |
OFBool | isPrivateReservationTag (const DcmTagKey &tag_key) |
Returns true, if given tag is a private reservation tag. | |
OFBool | hasPrivateReservationContext (const DcmTagKey &tag_key, DcmItem *item, OFString &priv_creator) |
Returns true, if given tag is reserved in given item. | |
DcmTagKey | calcPrivateReservationTag (const DcmTagKey &tag_key) |
Calculates from given private tag the reservation tag, that would make a reservation for this private tag. | |
OFBool | isTagInDictionary (const DcmTagKey &search_key) |
Returns true, if given tag key can be found in dictionary. | |
void | debugMsg (const OFBool &condition, const OFString &s1, const OFString &s2, const OFString &s3) |
The function handles three strings, that are directly printed after another. | |
Protected Attributes | |
OFString | act_file |
name of file, that is loaded currently | |
DcmFileFormat * | dfile |
will hold file to modify | |
DcmDataset * | dset |
will hold the dataset, that should be modified | |
OFBool | debug_option |
enable debug messages | |
Private Member Functions | |
MdfDatasetManager & | operator= (const MdfDatasetManager &) |
private undefined assignment operator | |
MdfDatasetManager (const MdfDatasetManager &) | |
private undefined copy constructor |
Therefore it allows the process of load->modify->save to provide this service.
Definition at line 48 of file mdfdsman.h.
|
Constructor, initializes member-variables.
|
|
Calculates from given private tag the reservation tag, that would make a reservation for this private tag.
|
|
The function handles three strings, that are directly printed after another.
The whole message is then terminated by
|
|
If key is the tag for SOPInstanceUID or SOPClassUID, then this function removes the related MediaStorage UIDs from the metaheader. The metaheader is then updated automagically when the file is saved back to disk.
|
|
Deletes tag in dataset.
|
|
Generates new 'SOP Instance UID' and inserts it into the dataset. The related metaheader tag ('Media Storage SOP Instance UID') is deleted from metaheader, so that it gets created correctly, if the file is saved to disk. |
|
Generates new 'Series Instance UID' and inserts it into the dataset. 'SOP Instance UID' is not affected. |
|
Generates new 'Study Instance UID' and inserts it into the dataset. 'Series Instance UID' and 'SOP Instance UID' are not affected. |
|
Returns the dataset, that this MdfDatasetManager handles. You should use the returned object with care to avoid sideeffects with other class methods, that modify this object, too.
|
|
Returns the DcmFileFormat, that this MdfDatasetManager handles. You should use the returned object with care to avoid sideeffects with other class methods, that modify this object, too.
|
|
Returns filename of the file, that's loaded currently.
|
|
Returns true, if given tag is reserved in given item. The private creator string is returned, too.
|
|
Checks whether group number is 0,1,2,3,5 or 7. Then an error is returned, because these groups are illegal or shouldn't be modified
|
|
Returns true, if given tag is a private reservation tag. Thats is the case, if tag has the form gggg,00ee (10<ee<FF)
|
|
Returns true, if given tag is a private tag (odd group number).
|
|
Returns true, if given tag key can be found in dictionary.
|
|
Loads a file into dataset manager.
|
|
Modifies all matching tags in dataset to a new value.
|
|
Modifies/Inserts a tag with a specific value.
|
|
Saves current dataset back to file using original filename and original parameters like transfer syntax, padding etc.
|
|
Saves current dataset back to a file. Caution: After saving MdfDatasetManager keeps working on old filename.
|
|
inserts tag into item with a specific value, overwrites existing tag
|
|
modifies element to a specific value
|