DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
This class encapsulates data structures and operations for modifying Dicom files from the commandline. More...
Public Member Functions | |
MdfConsoleEngine (int argc, char *argv[], const char *appl_name) | |
Constructor. | |
~MdfConsoleEngine () | |
Destructor. | |
int | startProvidingService () |
This function looks at commandline options and decides what to do. | |
Protected Member Functions | |
void | parseNonJobOptions () |
Checks for non-job commandline options like --debug etc. | |
void | parseCommandLine () |
Parses commandline options into corresponding file- and job lists and enables debug/verbose mode. | |
int | executeJob (const MdfJob &job, const char *filename=NULL) |
Executes given modify job. | |
OFCondition | loadFile (const char *filename) |
Backup and load file into internal MdfDatasetManager. | |
OFCondition | backupFile (const char *file_name) |
Backup given file from file to file.bak. | |
OFCondition | restoreFile (const char *filename) |
Restore given file from file.bak to original (without .bak) | |
Static Protected Member Functions | |
static OFBool | jobOptionExpectsParameters (const OFString &job) |
Checks whether given job expects more values on commandline, e. | |
static void | splitPathAndValue (const OFString &whole, OFString &path, OFString &value) |
This function splits a modify option (inclusive value) as found on commandline into to parts (path and value) e.g. | |
Private Member Functions | |
MdfConsoleEngine & | operator= (const MdfConsoleEngine &) |
private undefined assignment operator | |
MdfConsoleEngine (const MdfConsoleEngine &) | |
private undefined copy constructor | |
Private Attributes | |
OFConsoleApplication * | app |
helper class for console applications | |
OFCommandLine * | cmd |
helper class for commandline parsing | |
MdfDatasetManager * | ds_man |
dataset manager that is used for modify operations | |
OFBool | ignore_errors_option |
ignore errors option | |
OFBool | update_metaheader_uids_option |
if false, metaheader UIDs are not updated when related dataset UIDs change | |
OFBool | no_backup_option |
if true, no backup is made before modifying a file | |
E_FileReadMode | read_mode_option |
read file with or without metaheader | |
E_TransferSyntax | input_xfer_option |
denotes the expected transfersyntax | |
OFBool | output_dataset_option |
decides whether to with/without metaheader | |
E_TransferSyntax | output_xfer_option |
denotes the transfer syntax that should be written | |
E_GrpLenEncoding | glenc_option |
option for group length recalcing | |
E_EncodingType | enctype_option |
write explicit or implicit length encoding | |
E_PaddingEncoding | padenc_option |
padding output | |
OFCmdUnsignedInt | filepad_option |
internal padding variables | |
OFCmdUnsignedInt | itempad_option |
OFBool | ignore_missing_tags_option |
if true, 'tag not found' errors are treated as being successful for modify and erase operations | |
OFBool | no_reservation_checks |
If true, it is not checked whether there is a corresponding private reservation during insertion of private tags. | |
OFBool | ignore_un_modifies |
If enabled, any value modifications of UN leaf elements are not executed. | |
OFBool | create_if_necessary |
If enabled, a new dataset is created in memory if a file is not existing. | |
OFBool | was_created |
Used to remember, whether a file was newly created. | |
OFList< MdfJob > * | jobs |
list of jobs to be executed | |
OFList< OFString > * | files |
list of files to be modified |
This class encapsulates data structures and operations for modifying Dicom files from the commandline.
MdfConsoleEngine::MdfConsoleEngine | ( | int | argc, |
char * | argv[], | ||
const char * | appl_name | ||
) |
Constructor.
argc | Number of commandline arguments |
argv | Array holding the commandline arguments |
appl_name | Name of calling application, that instantiates this class |
OFCondition MdfConsoleEngine::backupFile | ( | const char * | file_name | ) | [protected] |
Backup given file from file to file.bak.
file_name | filename of file, that should be backuped |
int MdfConsoleEngine::executeJob | ( | const MdfJob & | job, |
const char * | filename = NULL |
||
) | [protected] |
Executes given modify job.
job | job to be executed |
filename | name of the file to be processed (optional) |
static OFBool MdfConsoleEngine::jobOptionExpectsParameters | ( | const OFString & | job | ) | [static, protected] |
Checks whether given job expects more values on commandline, e.
g. a a tag path or any kind of value.
job | [in] The job option to check (e. g. "i", "m", "ma"...) |
OFCondition MdfConsoleEngine::loadFile | ( | const char * | filename | ) | [protected] |
Backup and load file into internal MdfDatasetManager.
filename | name of file to load |
void MdfConsoleEngine::parseCommandLine | ( | ) | [protected] |
Parses commandline options into corresponding file- and job lists and enables debug/verbose mode.
The joblist is built in order of modify options on commandline
void MdfConsoleEngine::parseNonJobOptions | ( | ) | [protected] |
Checks for non-job commandline options like --debug etc.
and sets corresponding internal flags
OFCondition MdfConsoleEngine::restoreFile | ( | const char * | filename | ) | [protected] |
Restore given file from file.bak to original (without .bak)
filename | restore "filename".bak to original without .bak |
static void MdfConsoleEngine::splitPathAndValue | ( | const OFString & | whole, |
OFString & | path, | ||
OFString & | value | ||
) | [static, protected] |
This function splits a modify option (inclusive value) as found on commandline into to parts (path and value) e.g.
"(0010,0010)=value" into path "(0010,0010)" and "value"
whole | string to be splitted |
path | returns part containing the path |
value | returns part containing the value(if theres one) |
This function looks at commandline options and decides what to do.
It evaluates option values from commandline and prepares them for starting the corresponding private functions.