Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

MdfDatasetManager Class Reference

This class encapsulates data structures and operations for modifying Dicom-files. More...

List of all members.

Public Member Functions

 MdfDatasetManager (const OFBool debug)
 Constructor, initializes member-variables.
 ~MdfDatasetManager ()
 Destructor.
OFCondition loadFile (const char *file_name)
 Loads a file into Datasetmanager.
OFCondition modifyOrInsertTag (OFString tag_path, const OFString &value, const OFBool &only_modify)
 Modifies/Inserts a tag with a specific value.
OFCondition modifyAllTags (OFString tag_path, const OFString &value, 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 saveFile (const char *file)
 Saves current Dataset back to a file.
OFCondition saveFile ()
 Saves current Dataset back to file using original filename.
DcmDataset * getDataset ()
 Returns the Dataset, that this MdfDatasetManager handles.
DcmFileFormat * getFileFormat ()
 Returns the DcmFileFormat, that this MdfDatasetManager handles.
OFString getFilename ()
 Returns filename of the file, that's loaded actually.

Static Public Member Functions

static void debugMsg (const OFString &s1, const OFString &s2, const OFString &s3)
 The function handles three strings, that are directly printed after another to CERR.

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

Protected Attributes

OFString act_file
 name of file, that is loaded actually
DcmFileFormat * dfile
 will hold file to modify
DcmDataset * dset
 will hold dset, we want to modify
OFBool debug_option
 enable debug-messages

Private Member Functions

MdfDatasetManager & operator= (const MdfDatasetManager &)
 private undefined assignment operator
 MdfDatasetManager (const MdfDatasetManager &)
 private undefined copy constructor


Detailed Description

This class encapsulates data structures and operations for modifying Dicom-files.

Therefore it allows the process of load->modify->save to provide this service.

Definition at line 49 of file mdfdsman.h.


Constructor & Destructor Documentation

MdfDatasetManager::MdfDatasetManager (  const OFBool  debug  ) 
 

Constructor, initializes member-variables.

Parameters:
debug enables/disables debug-messages (off per default)


Member Function Documentation

static void MdfDatasetManager::debugMsg (  const OFString &  s1,
const OFString &  s2,
const OFString &  s3
)  [static]
 

The function handles three strings, that are directly printed after another to CERR.

The whole message is then terminated by

Parameters:
s1 first message string
s2 second message string
s2 third message string

OFCondition MdfDatasetManager::deleteTag (  OFString  tag_path,
const OFBool &  all_tags
) 
 

Deletes tag in Dataset.

Parameters:
tag_path holds complete path to tag
all_tags If true, tag is deleted at all levels of Dataset, else only 1. level is accessed
Returns:
returns EC_normal if everything is ok, else an error

DcmDataset* MdfDatasetManager::getDataset (   ) 
 

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:
returns the Dataset, this MdfDatasetManager manages and NULL, if no Dataset is loaded

DcmFileFormat* MdfDatasetManager::getFileFormat (   ) 
 

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:
returns the DcmFileFormat, this MdfDatasetManager manages and NULL, if no file is loaded

OFString MdfDatasetManager::getFilename (   ) 
 

Returns filename of the file, that's loaded actually.

Returns:
returns filename and "" if no file is loaded.

OFCondition MdfDatasetManager::loadFile (  const char *  file_name  ) 
 

Loads a file into Datasetmanager.

Parameters:
file_name file to be loaded
Returns:
returns EC_normal if everything is ok, else an error

OFCondition MdfDatasetManager::modifyAllTags (  OFString  tag_path,
const OFString &  value,
int &  count
) 
 

Modifies all matching tags in Dataset to a new value.

Parameters:
tag_path denotes, which tag to modify
value denotes new value of tag
count returns holds the number of tags, that were affected
Returns:
returns EC_normal if everything is ok, else an error

OFCondition MdfDatasetManager::modifyOrInsertTag (  OFString  tag_path,
const OFString &  value,
const OFBool &  only_modify
) 
 

Modifies/Inserts a tag with a specific value.

Parameters:
tag_path holds complete path to tag
value denotes new value of tag
only_modify if true, only existing tags are processed. If false, not existing tag is inserted
Returns:
returns EC_normal if everything is ok, else an error

OFCondition MdfDatasetManager::saveFile (   ) 
 

Saves current Dataset back to file using original filename.

Returns:
returns EC_normal if everything is ok, else an error

OFCondition MdfDatasetManager::saveFile (  const char *  file  ) 
 

Saves current Dataset back to a file.

Caution: After saving MdfDatasetManager keeps working on old filename.

Parameters:
file filename to save to
Returns:
returns EC_normal if everything is ok, else an error

OFCondition MdfDatasetManager::startInsert (  DcmItem *  item,
DcmTagKey &  search_key,
const OFString &  value
)  [protected]
 

inserts tag into item with a specific value

Parameters:
item - item, where tag is inserted
search_key specifies tag to be inserted
value value that should be inserted in item
Returns:
returns an error-code as OFCondition, if an error occurs

OFCondition MdfDatasetManager::startModify (  DcmElement *  elem,
const OFString &  value
)  [protected]
 

modifies element to a specific value

Parameters:
elem element, that should be changed
value the value, the element should be changed to
Returns:
OFCondition, which returns an error-code if an error occurs


The documentation for this class was generated from the following file:


Generated on 26 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2