OFFIS DCMTK  Version 3.6.0
mdfdsman.h
1 /*
2  *
3  * Copyright (C) 2003-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Michael Onken
17  *
18  * Purpose: Class for modifying DICOM files
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:52 $
22  * CVS/RCS Revision: $Revision: 1.22 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef MDFDSMAN_H
30 #define MDFDSMAN_H
31 
32 #include "dcmtk/config/osconfig.h" // make sure OS specific configuration is included first
33 
34 #include "dcmtk/ofstd/ofcond.h"
35 #include "dcmtk/dcmdata/dctagkey.h"
36 #include "dcmtk/dcmdata/dcxfer.h"
37 
38 
39 // forward declarations
40 class DcmDataset;
41 class DcmFileFormat;
42 class DcmElement;
43 
44 
50 {
51 public:
52 
56 
60 
67  OFCondition loadFile(const char *file_name,
68  const E_FileReadMode readMode = ERM_autoDetect,
69  const E_TransferSyntax xfer = EXS_Unknown);
70 
87  const OFString &value,
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);
92 
109  const OFString &filename,
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);
114 
127  const OFString &value,
128  const OFBool update_metaheader,
129  int &count,
130  const OFBool ignore_missing_tags = OFFalse);
131 
141  OFCondition deleteTag(OFString tag_path,
142  const OFBool all_tags,
143  const OFBool ignore_missing_tags);
144 
150 
159 
172  OFCondition saveFile(const char *file_name,
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);
180 
186 
194 
195 
203 
207  OFString getFilename() const;
208 
213  void setModifyUNValues(OFBool modifyUNValues);
214 
215 protected:
216 
223  const OFString &value);
224 
231  void deleteRelatedMetaheaderTag(const DcmTagKey &key);
232 
237  OFBool isTagInDictionary(const DcmTagKey &search_key);
238 
239 private:
240 
243 
246 
249 
253 
257 
261 };
262 
263 #endif // MDFDSMAN_H
264 
265 
266 /*
267 ** CVS/RCS Log:
268 ** $Log: mdfdsman.h,v $
269 ** Revision 1.22 2010-10-14 13:17:52 joergr
270 ** Updated copyright header. Added reference to COPYRIGHT file.
271 **
272 ** Revision 1.21 2010-05-20 15:44:55 joergr
273 ** Added support for reading the value of insert/modify statements from a file.
274 ** Removed some unnecessary include directives.
275 **
276 ** Revision 1.20 2009-11-04 09:58:06 uli
277 ** Switched to logging mechanism provided by the "new" oflog module
278 **
279 ** Revision 1.19 2009-01-15 16:11:55 onken
280 ** Reworked dcmodify to work with the new DcmPath classes for supporting
281 ** wildcard paths and automatic insertion of missing attributes and items.
282 ** Added options for private tag handling and modification of UN values and
283 ** for ignoring errors resulting from missing tags during modify and erase
284 ** operations. Further cleanups.
285 **
286 ** Revision 1.18 2008-07-11 08:37:45 joergr
287 ** Fixed typo in API documentation.
288 **
289 ** Revision 1.17 2006/11/23 15:32:58 onken
290 ** Made member variables private (before: protected)
291 **
292 ** Revision 1.16 2005/12/08 15:46:50 meichel
293 ** Updated Makefiles to correctly install header files
294 **
295 ** Revision 1.15 2005/12/02 09:21:47 joergr
296 ** Added new file read mode that makes it possible to distinguish between DICOM
297 ** files, datasets and other non-DICOM files. For this reason, the last
298 ** parameter of method loadFile() changed from OFBool to E_FileReadMode.
299 **
300 ** Revision 1.14 2005/11/30 16:41:41 onken
301 ** Added standard parameter values for saveFile()
302 **
303 ** Revision 1.13 2005/11/14 15:00:14 joergr
304 ** Made method getFilename() const.
305 **
306 ** Revision 1.12 2004/11/05 17:17:24 onken
307 ** Added input and output options for dcmodify. minor code enhancements.
308 **
309 ** Revision 1.11 2004/10/22 16:53:26 onken
310 ** - fixed ignore-errors-option
311 ** - major enhancements for supporting private tags
312 ** - removed '0 Errors' output
313 ** - modifications to groups 0000,0001,0002,0003,0005 and 0007 are blocked,
314 ** removing tags with group 0001,0003,0005 and 0007 is still possible
315 ** - UID options:
316 ** - generate new study, series and instance UIDs
317 ** - When changing UIDs in dataset, related metaheader tags are updated
318 ** automatically
319 ** - minor code improvements
320 **
321 ** Revision 1.10 2004/05/14 12:08:36 onken
322 ** Additional documentation added.
323 **
324 ** Revision 1.9 2004/04/19 14:45:07 onken
325 ** Restructured code to avoid default parameter values for "complex types" like
326 ** OFString. Required for Sun CC 2.0.1.
327 **
328 ** Revision 1.8 2003/12/17 17:07:22 onken
329 ** MdfDatasetManager now remembers loaded filename. Additional save function
330 ** added.
331 **
332 ** Revision 1.7 2003/12/10 16:19:20 onken
333 ** Changed API of MdfDatasetManager, so that its transparent for user, whether
334 ** he wants to modify itemtags or tags at 1. level.
335 **
336 ** Complete rewrite of MdfConsoleEngine. It doesn't support a batchfile any more,
337 ** but now a user can give different modify-options at the same time on
338 ** commandline. Other purifications and simplifications were made.
339 **
340 ** Revision 1.6 2003/11/11 10:55:51 onken
341 ** - debug-mechanism doesn't use debug(..) any more
342 ** - comments purified
343 ** - headers adjustet to debug-modifications
344 **
345 ** Revision 1.5 2003/10/13 14:46:50 onken
346 ** startModify(...) simplified (uses only putString to put element-values),
347 ** this also allows now inserting and modifying of elements with VRM>1.
348 ** Method getDataset() added.
349 **
350 ** Revision 1.4 2003/10/01 14:04:03 onken
351 ** Corrected doxygen-information in headerfiles
352 **
353 ** Revision 1.3 2003/09/19 12:41:11 onken
354 ** major bugfixes, new code structure, better error-handling, corrections for "dcmtk-coding-style",Handling of VR's corrected
355 **
356 ** Revision 1.2 2003/07/09 12:13:13 meichel
357 ** Included dcmodify in MSVC build system, updated headers
358 **
359 ** Revision 1.1 2003/06/26 09:17:18 onken
360 ** Added commandline-application dcmodify.
361 **
362 **
363 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2