32 #include "dcmtk/config/osconfig.h" 34 #include "dcmtk/ofstd/ofcond.h" 35 #include "dcmtk/dcmdata/dctagkey.h" 36 #include "dcmtk/dcmdata/dcxfer.h" 68 const E_FileReadMode readMode = ERM_autoDetect,
69 const E_TransferSyntax xfer = EXS_Unknown);
88 const OFBool &only_modify,
89 const OFBool update_metaheader = OFTrue,
90 const OFBool ignore_missing_tags = OFFalse,
91 const OFBool no_reservation_checks = OFFalse);
110 const OFBool &only_modify,
111 const OFBool update_metaheader = OFTrue,
112 const OFBool ignore_missing_tags = OFFalse,
113 const OFBool no_reservation_checks = OFFalse);
128 const OFBool update_metaheader,
130 const OFBool ignore_missing_tags = OFFalse);
142 const OFBool all_tags,
143 const OFBool ignore_missing_tags);
173 E_TransferSyntax opt_xfer = EXS_Unknown,
174 E_EncodingType opt_enctype = EET_UndefinedLength,
175 E_GrpLenEncoding opt_glenc = EGL_recalcGL,
176 E_PaddingEncoding opt_padenc = EPD_noChange,
177 OFCmdUnsignedInt opt_filepad = 0,
178 OFCmdUnsignedInt opt_itempad = 0,
179 OFBool opt_dataset = OFFalse);
DcmFileFormat * dfile
will hold file to modify
OFBool isTagInDictionary(const DcmTagKey &search_key)
Returns true, if given tag key can be found in dictionary.
class maintaining a attribute tag (group and element number)
OFCondition deletePrivateData()
Deletes all private data from file, ie.
void deleteRelatedMetaheaderTag(const DcmTagKey &key)
If key is the tag for SOPInstanceUID or SOPClassUID, then this function removes the related MediaStor...
OFString getFilename() const
Returns filename of the file, that's loaded currently.
DcmFileFormat * getFileFormat()
Returns the DcmFileFormat, that this MdfDatasetManager handles.
abstract base class for all DICOM elements
OFCondition modifyAllTags(OFString tag_path, const OFString &value, const OFBool update_metaheader, int &count, const OFBool ignore_missing_tags=OFFalse)
Modifies all matching tags in dataset to a new value.
~MdfDatasetManager()
Destructor.
OFCondition generateAndInsertUID(const DcmTagKey &uidKey)
Inserts new Study, Series or SOP Instance UID.
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 modifyOrInsertFromFile(OFString tag_path, const OFString &filename, const OFBool &only_modify, const OFBool update_metaheader=OFTrue, const OFBool ignore_missing_tags=OFFalse, const OFBool no_reservation_checks=OFFalse)
Modifies/Inserts a path with a specific value read from file.
MdfDatasetManager()
Constructor, initializes member-variables.
OFString current_file
name of file, that is loaded currently
void setModifyUNValues(OFBool modifyUNValues)
Sets whether attributes with VR of UN should be modified or left alone.
This class encapsulates data structures and operations for modifying Dicom files. ...
DcmDataset * dset
will hold the dataset, that should be modified
OFBool ignore_un_modifies
if enabled, no value modifications on attributes having VR of UN are not executed ...
MdfDatasetManager & operator=(const MdfDatasetManager &)
private undefined assignment operator
a class handling the DICOM dataset format (files without meta header)
OFCondition modifyOrInsertPath(OFString tag_path, const OFString &value, const OFBool &only_modify, const OFBool update_metaheader=OFTrue, const OFBool ignore_missing_tags=OFFalse, const OFBool no_reservation_checks=OFFalse)
Modifies/Inserts a path (with a specific value if desired).
DcmDataset * getDataset()
Returns the dataset, that this MdfDatasetManager handles.
a simple string class that implements a subset of std::string.
OFCondition deleteTag(OFString tag_path, const OFBool all_tags, const OFBool ignore_missing_tags)
Deletes tag in dataset.
OFCondition startModify(DcmElement *elem, const OFString &value)
modifies element to a specific value
OFCondition saveFile()
Saves current dataset back to file using original filename and original parameters like transfer synt...
General purpose class for condition codes.