OFFIS DCMTK  Version 3.6.0
dcddirif.h
1 /*
2  *
3  * Copyright (C) 2002-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: Joerg Riesmeier
17  *
18  * Purpose: Interface class for simplified creation of a DICOMDIR
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-11-05 13:11:11 $
22  * CVS/RCS Revision: $Revision: 1.23 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DCDDIRIF_H
31 #define DCDDIRIF_H
32 
33 #include "dcmtk/config/osconfig.h"
34 
35 #include "dcmtk/dcmdata/dcdicdir.h"
36 
37 
38 /*-----------------------------------*
39  * contant declarations and macros *
40  *-----------------------------------*/
41 
42 // default fileset ID
43 #define DEFAULT_FILESETID "DCMTK_MEDIA_DEMO"
44 // default specific character set of fileset descriptor file
45 #define DEFAULT_DESCRIPTOR_CHARSET "ISO_IR 100"
46 
47 
48 /*----------------------*
49  * class declarations *
50  *----------------------*/
51 
58 {
59  public:
60 
63  virtual ~DicomDirImagePlugin() {}
64 
75  virtual OFBool scaleData(const Uint8 *srcData,
76  const unsigned int srcWidth,
77  const unsigned int srcHeight,
78  Uint8 *dstData,
79  const unsigned int dstWidth,
80  const unsigned int dstHeight) const = 0;
81 
93  virtual OFBool scaleImage(DcmItem *dataset,
94  Uint8 *pixel,
95  const unsigned long count,
96  const unsigned long frame,
97  const unsigned int width,
98  const unsigned int height,
99  const OFBool decompressAll = OFFalse) const = 0;
100 
101  protected:
102 
106 };
107 
108 
112 {
113 
114  public:
115 
119  {
158  };
159 
165 
169  virtual ~DicomDirInterface();
170 
174  void cleanup();
175 
180  OFBool isDicomDirValid() const;
181 
194  const char *filename = DEFAULT_DICOMDIR_NAME,
195  const char *filesetID = DEFAULT_FILESETID);
196 
209  const char *filename);
210 
223  const char *filename);
224 
231  OFCondition writeDicomDir(const E_EncodingType encodingType = EET_UndefinedLength,
232  const E_GrpLenEncoding groupLength = EGL_withoutGL);
233 
243  OFBool isFilenameValid(const char *filename,
244  const OFBool allowEmpty = OFFalse);
245 
253  OFBool isCharsetValid(const char *charset);
254 
265  OFCondition checkDicomFile(const char *filename,
266  const char *directory = NULL);
267 
277  OFCondition addDicomFile(const char *filename,
278  const char *directory = NULL);
279 
289  OFCondition setFilesetDescriptor(const char *filename,
290  const char *charset = DEFAULT_DESCRIPTOR_CHARSET);
291 
298  OFCondition setIconSize(const unsigned int size);
299 
308  OFCondition setIconPrefix(const char *prefix);
309 
317  OFCondition setDefaultIcon(const char *filename);
318 
323  OFBool abortMode() const
324  {
325  return AbortMode;
326  }
327 
332  OFBool mapFilenamesMode() const
333  {
334  return MapFilenamesMode;
335  }
336 
341  OFBool inventMode() const
342  {
343  return InventMode;
344  }
345 
350  OFBool inventPatientIDMode() const
351  {
352  return InventPatientIDMode;
353  }
354 
359  OFBool retiredSOPClassSupport() const
360  {
361  return RetiredSOPClassSupport;
362  }
363 
368  OFBool iconImageMode() const
369  {
370  return IconImageMode;
371  }
372 
377  OFBool backupMode() const
378  {
379  return BackupMode;
380  }
381 
386  OFBool encodingCheck() const
387  {
388  return EncodingCheck;
389  }
390 
395  OFBool resolutionCheck() const
396  {
397  return ResolutionCheck;
398  }
399 
404  OFBool transferSyntaxCheck() const
405  {
406  return TransferSyntaxCheck;
407  }
408 
413  OFBool consistencyCheck() const
414  {
415  return ConsistencyCheck;
416  }
417 
425  OFBool enableAbortMode(const OFBool newMode = OFTrue);
426 
434  OFBool enableMapFilenamesMode(const OFBool newMode = OFTrue);
435 
443  OFBool enableInventMode(const OFBool newMode = OFTrue);
444 
453  OFBool enableInventPatientIDMode(const OFBool newMode = OFTrue);
454 
462  OFBool enableRetiredSOPClassSupport(const OFBool newMode = OFTrue);
463 
473  OFBool enableIconImageMode(const OFBool newMode = OFTrue);
474 
483  OFBool disableBackupMode(const OFBool newMode = OFFalse);
484 
494  OFBool disableEncodingCheck(const OFBool newMode = OFFalse);
495 
505  OFBool disableResolutionCheck(const OFBool newMode = OFFalse);
506 
516  OFBool disableTransferSyntaxCheck(const OFBool newMode = OFFalse);
517 
526  OFBool disableConsistencyCheck(const OFBool newMode = OFFalse);
527 
534  OFBool addImageSupport(DicomDirImagePlugin *plugin);
535 
536  /* -- static function -- */
537 
542  static const char *getProfileName(const E_ApplicationProfile profile);
543 
544 
545  protected:
546 
552 
559  OFCondition loadAndCheckDicomFile(const char *filename,
560  const char *directory,
561  DcmFileFormat &fileformat);
562 
570  DcmItem *dataset,
571  const char *filename);
572 
579  const char *filename);
580 
588  const OFString &sopClass,
589  const char *filename);
590 
597  const char *filename);
598 
606  const OFString &sopClass,
607  const char *filename);
608 
616  const OFString &transferSyntax,
617  const char *filename);
618 
626  DcmItem *dataset,
627  const char *filename);
628 
639  DcmItem *dataset);
640 
648  const E_DirRecType recordType,
649  DcmItem* dataset);
650 
658  DcmItem *dataset,
659  const OFString &sourceFilename);
660 
668  DcmItem *dataset,
669  const OFString &sourceFilename);
670 
678  DcmItem *dataset,
679  const OFString &sourceFilename);
680 
689  DcmItem *dataset,
690  const OFString &referencedFileID,
691  const OFString &sourceFilename);
692 
701  DcmItem *dataset,
702  const OFString &referencedFileID,
703  const OFString &sourceFilename);
704 
713  DcmItem *dataset,
714  const OFString &referencedFileID,
715  const OFString &sourceFilename);
716 
725  DcmItem *dataset,
726  const OFString &referencedFileID,
727  const OFString &sourceFilename);
728 
737  DcmItem *dataset,
738  const OFString &referencedFileID,
739  const OFString &sourceFilename);
740 
749  DcmItem *dataset,
750  const OFString &referencedFileID,
751  const OFString &sourceFilename);
752 
761  DcmItem *dataset,
762  const OFString &referencedFileID,
763  const OFString &sourceFilename);
764 
773  DcmItem *dataset,
774  const OFString &referencedFileID,
775  const OFString &sourceFilename);
776 
785  DcmItem *dataset,
786  const OFString &referencedFileID,
787  const OFString &sourceFilename);
788 
797  DcmItem *dataset,
798  const OFString &referencedFileID,
799  const OFString &sourceFilename);
800 
809  DcmItem *dataset,
810  const OFString &referencedFileID,
811  const OFString &sourceFilename);
812 
821  DcmItem *dataset,
822  const OFString &referencedFileID,
823  const OFString &sourceFilename);
824 
833  DcmItem *dataset,
834  const OFString &referencedFileID,
835  const OFString &sourceFilename);
836 
845  DcmItem *dataset,
846  const OFString &referencedFileID,
847  const OFString &sourceFilename);
848 
857  DcmItem *dataset,
858  const OFString &referencedFileID,
859  const OFString &sourceFilename);
860 
869  DcmItem *dataset,
870  const OFString &referencedFileID,
871  const OFString &sourceFilename);
872 
881  DcmItem *dataset,
882  const OFString &referencedFileID,
883  const OFString &sourceFilename);
884 
893  DcmItem *dataset,
894  const OFString &referencedFileID,
895  const OFString &sourceFilename);
896 
905  DcmItem *dataset,
906  const OFString &referencedFileID,
907  const OFString &sourceFilename);
908 
917  DcmItem *dataset,
918  const OFString &referencedFileID,
919  const OFString &sourceFilename);
920 
929  DcmItem *dataset,
930  const OFString &referencedFileID,
931  const OFString &sourceFilename);
932 
941  DcmItem *dataset,
942  const OFString &referencedFileID,
943  const OFString &sourceFilename);
944 
953  DcmItem *dataset,
954  const OFString &referencedFileID,
955  const OFString &sourceFilename);
956 
965  DcmItem *dataset,
966  const OFString &referencedFileID,
967  const OFString &sourceFilename);
968 
977  DcmItem *dataset,
978  const OFString &referencedFileID,
979  const OFString &sourceFilename);
980 
989  DcmItem *dataset,
990  const OFString &referencedFileID,
991  const OFString &sourceFilename);
992 
1001  DcmItem *dataset,
1002  const OFString &referencedFileID,
1003  const OFString &sourceFilename);
1004 
1013  DcmItem *dataset,
1014  const OFString &referencedFileID,
1015  const OFString &sourceFilename);
1016 
1027  OFBool getIconFromFile(const OFString &filename,
1028  Uint8 *pixel,
1029  const unsigned long count,
1030  const unsigned int width,
1031  const unsigned int height);
1032 
1042  OFBool getIconFromDataset(DcmItem *dataset,
1043  Uint8 *pixel,
1044  const unsigned long count,
1045  const unsigned int width,
1046  const unsigned int height);
1047 
1059  DcmItem *dataset,
1060  const unsigned int size,
1061  const OFString &sourceFilename);
1062 
1073  const E_DirRecType recordType,
1074  DcmItem *dataset,
1075  const OFString &referencedFileID,
1076  const OFString &sourceFilename);
1077 
1085  DcmItem *dataset,
1086  const OFString &referencedFileID,
1087  const OFString &sourceFilename);
1088 
1095  const OFBool recurse = OFTrue);
1096 
1101 
1106 
1111 
1115  void createDicomDirBackup(const char *filename);
1116 
1119  void deleteDicomDirBackup();
1120 
1128  void printUnexpectedValueMessage(const DcmTagKey &key,
1129  const char *filename = NULL,
1130  const OFBool errorMsg = OFTrue);
1131 
1139  void printRequiredAttributeMessage(const DcmTagKey &key,
1140  const char *filename = NULL,
1141  const OFBool emptyMsg = OFFalse);
1142 
1150  void printAttributeErrorMessage(const DcmTagKey &key,
1151  const OFCondition &error,
1152  const char *operation);
1153 
1161  void printRecordErrorMessage(const OFCondition &error,
1162  const E_DirRecType recordType,
1163  const char *operation);
1164 
1170  OFBool copyFile(const char *fromFilename,
1171  const char *toFilename);
1172 
1181  DcmItem *dataset,
1182  const OFString &sourceFilename,
1183  const OFBool abortCheck = OFFalse);
1184 
1189  OFBool checkFilesetID(const OFString &filesetID);
1190 
1197  OFBool checkExists(DcmItem *dataset,
1198  const DcmTagKey &key,
1199  const char *filename = NULL);
1200 
1207  OFBool checkExistsWithValue(DcmItem *dataset,
1208  const DcmTagKey &key,
1209  const char *filename = NULL);
1210 
1218  OFBool checkExistsWithStringValue(DcmItem *dataset,
1219  const DcmTagKey &key,
1220  const OFString &value,
1221  const char *filename = NULL);
1222 
1231  OFBool checkExistsWithIntegerValue(DcmItem *dataset,
1232  const DcmTagKey &key,
1233  const long value,
1234  const char *filename = NULL,
1235  const OFBool reject = OFTrue);
1236 
1246  OFBool checkExistsWithMinMaxValue(DcmItem *dataset,
1247  const DcmTagKey &key,
1248  const long min,
1249  const long max,
1250  const char *filename = NULL,
1251  const OFBool reject = OFTrue);
1252 
1261  const DcmTagKey &key,
1262  OFString &result,
1263  OFBool searchIntoSub = OFFalse);
1264 
1274  const DcmTagKey &key,
1275  OFString &result,
1276  const unsigned long pos,
1277  OFBool searchIntoSub = OFFalse);
1278 
1286  OFString &getStringFromFile(const char *filename,
1287  const DcmTagKey &key,
1288  OFString &result,
1289  OFBool searchIntoSub = OFFalse);
1290 
1299  void copyElement(DcmItem *dataset,
1300  const DcmTagKey &key,
1301  DcmDirectoryRecord *record,
1302  const OFString &sourceFilename,
1303  const OFBool optional = OFFalse,
1304  const OFBool copyEmpty = OFTrue);
1305 
1312  void copyElementType1(DcmItem *dataset,
1313  const DcmTagKey &key,
1314  DcmDirectoryRecord *record,
1315  const OFString &sourceFilename)
1316  {
1317  copyElement(dataset, key, record, sourceFilename, OFFalse /*optional*/, OFFalse /*copyEmpty*/);
1318  }
1319 
1327  const DcmTagKey &key,
1328  DcmDirectoryRecord *record,
1329  const OFString &sourceFilename)
1330  {
1331  copyElement(dataset, key, record, sourceFilename, OFTrue /*optional*/, OFFalse /*copyEmpty*/);
1332  }
1333 
1340  void copyElementType2(DcmItem *dataset,
1341  const DcmTagKey &key,
1342  DcmDirectoryRecord *record,
1343  const OFString &sourceFilename)
1344  {
1345  copyElement(dataset, key, record, sourceFilename, OFFalse /*optional*/, OFTrue /*copyEmpty*/);
1346  }
1347 
1354  void copyElementType3(DcmItem *dataset,
1355  const DcmTagKey &key,
1356  DcmDirectoryRecord *record,
1357  const OFString &sourceFilename)
1358  {
1359  copyElement(dataset, key, record, sourceFilename, OFTrue /*optional*/, OFTrue /*copyEmpty*/);
1360  }
1361 
1371  void copyStringWithDefault(DcmItem *dataset,
1372  const DcmTagKey &key,
1373  DcmDirectoryRecord *record,
1374  const OFString &sourceFilename,
1375  const char *defaultValue = "",
1376  const OFBool printWarning = OFFalse);
1377 
1387  OFBool compareStringAttributes(DcmItem *dataset,
1388  const DcmTagKey &datKey,
1389  DcmDirectoryRecord *record,
1390  const DcmTagKey &recKey,
1391  const OFString &sourceFilename,
1392  const OFBool errorMsg = OFFalse);
1393 
1401  OFBool compareSequenceAttributes(DcmItem *dataset,
1402  DcmTagKey &key,
1403  DcmDirectoryRecord *record,
1404  const OFString &sourceFilename);
1405 
1412  void setDefaultValue(DcmDirectoryRecord *record,
1413  const DcmTagKey &key,
1414  const unsigned long number,
1415  const char *prefix = NULL);
1416 
1417 
1418  private:
1419 
1422 
1425 
1428 
1430  OFBool BackupMode;
1432  OFBool AbortMode;
1436  OFBool InventMode;
1453 
1458 
1460  unsigned int IconSize;
1465 
1467  OFBool RLESupport;
1469  OFBool JPEGSupport;
1471  OFBool JP2KSupport;
1472 
1474  unsigned long AutoPatientNumber;
1476  unsigned long AutoStudyNumber;
1478  unsigned long AutoSeriesNumber;
1480  unsigned long AutoInstanceNumber;
1482  unsigned long AutoOverlayNumber;
1484  unsigned long AutoLutNumber;
1486  unsigned long AutoCurveNumber;
1487 
1490 
1493 };
1494 
1495 
1496 #endif
1497 
1498 
1499 /*
1500  *
1501  * CVS/RCS Log:
1502  * $Log: dcddirif.h,v $
1503  * Revision 1.23 2010-11-05 13:11:11 joergr
1504  * Added support for new directory record types IMPLANT, IMPLANT GROUP and
1505  * IMPLANT ASSY from Supplement 131 (Implant Templates).
1506  *
1507  * Revision 1.22 2010-10-14 13:15:40 joergr
1508  * Updated copyright header. Added reference to COPYRIGHT file.
1509  *
1510  * Revision 1.21 2010-10-04 16:14:53 joergr
1511  * Fixed various Doxygen API documentation issues.
1512  *
1513  * Revision 1.20 2010-10-01 08:09:31 joergr
1514  * Added support for new non-image Storage SOP Classes that require the new
1515  * directory record type MEASUREMENT. Also fixed issues with other record types.
1516  *
1517  * Revision 1.19 2010-09-30 17:18:10 joergr
1518  * Added support for new non-image Storage SOP Classes that require the new
1519  * directory record types PALETTE and SURFACE. Also updated existing records.
1520  *
1521  * Revision 1.18 2010-08-10 11:02:58 uli
1522  * Removed undefined function printFileErrorMessage().
1523  *
1524  * Revision 1.17 2010-08-09 13:02:56 joergr
1525  * Updated data dictionary to 2009 edition of the DICOM standard. From now on,
1526  * the official "keyword" is used for the attribute name which results in a
1527  * number of minor changes (e.g. "PatientsName" is now called "PatientName").
1528  *
1529  * Revision 1.16 2009-11-25 13:31:05 joergr
1530  * Adapted code for new approach to access individual frames of a DICOM image.
1531  *
1532  * Revision 1.15 2009-11-04 09:58:07 uli
1533  * Switched to logging mechanism provided by the "new" oflog module
1534  *
1535  * Revision 1.14 2009-01-15 10:16:40 joergr
1536  * Added check whether (possibly required) JPEG 2000 decoder is registered.
1537  *
1538  * Revision 1.13 2008-06-23 12:05:37 joergr
1539  * Added check on value representation of data elements copied from the
1540  * referenced DICOM file to the DICOMDIR (compare VR with data dictionary).
1541  *
1542  * Revision 1.12 2007/02/02 16:01:51 joergr
1543  * Added error message when existing SOP instance is inconsistent with new
1544  * directory record in update mode (e.g. different SOP class UID).
1545  * Fixed incomplete warning message in update mode (filename was missing).
1546  *
1547  * Revision 1.11 2007/01/10 13:02:59 joergr
1548  * Added new option that enables support for retired SOP classes.
1549  *
1550  * Revision 1.10 2006/12/15 14:56:57 joergr
1551  * Added new option that allows to update existing entries in a DICOMDIR. This
1552  * also adds support for mixed media stored application profiles.
1553  * Changed name of enum value for the MPEG2-DVD application profile in order to
1554  * be more consistent with other names.
1555  * Slightly revised handling of type 1, 1C and 2 elements in Directory Records.
1556  * Fixed small bug in cardiac application profiles when checking the ImageType
1557  * (0008,0008).
1558  *
1559  * Revision 1.9 2006/07/27 13:05:05 joergr
1560  * Added support for DICOMDIR record type "STEREOMETRIC" (CP 628).
1561  *
1562  * Revision 1.8 2005/12/15 15:40:48 joergr
1563  * Removed unsused parameter.
1564  *
1565  * Revision 1.7 2005/12/08 16:28:03 meichel
1566  * Changed include path schema for all DCMTK header files
1567  *
1568  * Revision 1.6 2005/10/27 13:31:21 joergr
1569  * Added support for Encapsulated Document, Real World Value Mapping and
1570  * Hanging Protocol objects to DICOMDIR tools.
1571  *
1572  * Revision 1.5 2005/06/13 14:36:41 joergr
1573  * Added new options to disable check on pixel encoding and transfer syntax.
1574  *
1575  * Revision 1.4 2005/03/09 17:53:34 joergr
1576  * Added support for new Media Storage Application Profiles according to DICOM
1577  * PS 3.12-2004. Removed support for non-standard conformant "No profile".
1578  * Added support for UTF-8 for the contents of the fileset descriptor file.
1579  *
1580  * Revision 1.3 2004/02/13 17:36:46 joergr
1581  * Added support for new directory records RAW DATA and SPECTROSCOPY introduced
1582  * with CP 343.
1583  *
1584  * Revision 1.2 2004/02/13 14:11:15 joergr
1585  * Added support for new directory records REGISTRATION and FIDUCIAL introduced
1586  * with supplement 73 (Spatial Registration Storage SOP Classes).
1587  *
1588  * Revision 1.1 2003/08/12 14:35:00 joergr
1589  * Added new interface class for simplified creation of a DICOMDIR.
1590  *
1591  *
1592  */
OFBool inventMode() const
get current status of the "invent missing values" mode.
Definition: dcddirif.h:341
An interface class for simplified creation of a DICOMDIR.
Definition: dcddirif.h:111
void copyElementType1C(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename)
copy type 1C element from dataset to directory record
Definition: dcddirif.h:1326
DcmDirectoryRecord * buildVoiLutRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update VOI LUT record and copy required values from dataset
OFString DefaultIcon
filename of the default icon (if any)
Definition: dcddirif.h:1464
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
OFCondition updateDicomDir(const E_ApplicationProfile profile, const char *filename)
create a DICOMDIR object based on an existing DICOMDIR file (update).
OFBool checkExistsWithIntegerValue(DcmItem *dataset, const DcmTagKey &key, const long value, const char *filename=NULL, const OFBool reject=OFTrue)
check whether given tag exists in the DICOM dataset and has the expected integer value ...
DicomDirImagePlugin * ImagePlugin
pointer to the optional image plugin (required for icon image support)
Definition: dcddirif.h:1424
Ultrasound Single Frame with Spatial Calibration (STD-US-SC-SF-xxxx)
Definition: dcddirif.h:145
class maintaining a attribute tag (group and element number)
Definition: dctagkey.h:46
DcmDirectoryRecord * buildImplantAssyRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update implant assy record and copy required values from dataset
a class representing a directory record dataset in a DICOMDIR.
Definition: dcdirrec.h:136
DcmDirectoryRecord * addRecord(DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
add child record to a given parent record.
OFBool RLESupport
flag indicating whether RLE decompression is supported
Definition: dcddirif.h:1467
void deleteDicomDirBackup()
delete backup file if one has been created
OFBool ConsistencyCheck
check consistency of newly added record
Definition: dcddirif.h:1448
OFBool isDicomDirValid() const
check whether current DICOMDIR is valid.
OFBool checkExistsWithStringValue(DcmItem *dataset, const DcmTagKey &key, const OFString &value, const char *filename=NULL)
check whether given tag exists in the DICOM dataset and has the expected string value ...
OFBool InventMode
invent missing attributes mode
Definition: dcddirif.h:1436
OFBool BackupMode
create DICOMDIR backup
Definition: dcddirif.h:1430
Abstract interface to plugable image support for the DICOMDIR class.
Definition: dcddirif.h:57
OFBool EncodingCheck
check pixel encoding
Definition: dcddirif.h:1442
Ultrasound Single & Multi-Frame with Combined Calibration (STD-UD-CC-MF-xxxx)
Definition: dcddirif.h:153
General Purpose DVD with Compression Interchange (STD-GEN-DVD)
Definition: dcddirif.h:125
OFString BackupFilename
name of the DICOMDIR backup file
Definition: dcddirif.h:1455
OFBool FilesetUpdateMode
update existing fileset
Definition: dcddirif.h:1452
void printAttributeErrorMessage(const DcmTagKey &key, const OFCondition &error, const char *operation)
print an error message that something went wrong with an attribute.
DcmDirectoryRecord * buildSpectroscopyRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update spectroscopy record and copy required values from dataset
DcmDirectoryRecord * buildEncapDocRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update encap doc record and copy required values from dataset
OFBool disableBackupMode(const OFBool newMode=OFFalse)
disable/enable the "create backup file" mode.
unsigned long AutoCurveNumber
current curve number used to invent missing attribute values
Definition: dcddirif.h:1486
DcmDirectoryRecord * buildValueMapRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update value map record and copy required values from dataset
static const char * getProfileName(const E_ApplicationProfile profile)
get name/identifier associated with the given application profile
OFBool disableConsistencyCheck(const OFBool newMode=OFFalse)
disable/enable the "consistency check".
void printRequiredAttributeMessage(const DcmTagKey &key, const char *filename=NULL, const OFBool emptyMsg=OFFalse)
print an error message that a required attribute is missing/empty.
Basic Cardiac X-Ray Angiographic Studies on CD-R Media (STD-XABC-CD)
Definition: dcddirif.h:133
DcmDirectoryRecord * buildImageRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update image record and copy required values from dataset
OFBool iconImageMode() const
get current status of the "create icon images" mode.
Definition: dcddirif.h:368
DcmDirectoryRecord * buildPresentationRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update presentation state record and copy required values from dataset
a class handling the DICOM file format (with meta header)
Definition: dcfilefo.h:48
OFBool checkExistsWithValue(DcmItem *dataset, const DcmTagKey &key, const char *filename=NULL)
check whether given tag exists with a value in the DICOM dataset
OFCondition checkMandatoryAttributes(DcmMetaInfo *metainfo, DcmItem *dataset, const char *filename)
check attributes for comliance with current application profile
DcmDirectoryRecord * buildOverlayRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update overlay record and copy required values from dataset
OFString & getStringComponentFromDataset(DcmItem *dataset, const DcmTagKey &key, OFString &result, const unsigned long pos, OFBool searchIntoSub=OFFalse)
get string value component from dataset and report an error (if any)
DcmDirectoryRecord * buildHangingProtocolRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update hanging protocol record and copy required values from dataset
OFBool checkExistsWithMinMaxValue(DcmItem *dataset, const DcmTagKey &key, const long min, const long max, const char *filename=NULL, const OFBool reject=OFTrue)
check whether given tag exists in the DICOM dataset and has an integer value in the expected range ...
Dental Radiograph Interchange (STD-DEN-CD)
Definition: dcddirif.h:139
OFBool BackupCreated
flag indicating whether a backup has been created
Definition: dcddirif.h:1457
unsigned long AutoLutNumber
current LUT number used to invent missing attribute values
Definition: dcddirif.h:1484
OFCondition appendToDicomDir(const E_ApplicationProfile profile, const char *filename)
create a DICOMDIR object based on an existing DICOMDIR file (append).
OFCondition addDicomFile(const char *filename, const char *directory=NULL)
add specified DICOM file to the current DICOMDIR.
DcmDirectoryRecord * buildSurfaceRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update surface record and copy required values from dataset
OFCondition checkDentalRadiographAttributes(DcmItem *dataset, const char *filename)
check attributes for compliance with dental radiograph application profile
OFString & getStringFromFile(const char *filename, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse)
get string value from file and report an error (if any)
default application profile: GeneralPurpose
Definition: dcddirif.h:123
unsigned long AutoInstanceNumber
current instance number used to invent missing attribute values
Definition: dcddirif.h:1480
OFCondition loadAndCheckDicomFile(const char *filename, const char *directory, DcmFileFormat &fileformat)
load and check DICOM file regarding the current application profile
DcmDirectoryRecord * buildRTPlanRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update RT plan record and copy required values from dataset
Hemodynamic Waveform Interchange on Diskette (STD-WVFM-HD-FD)
Definition: dcddirif.h:157
OFString & getStringFromDataset(DcmItem *dataset, const DcmTagKey &key, OFString &result, OFBool searchIntoSub=OFFalse)
get string value from dataset and report an error (if any)
OFCondition selectApplicationProfile(const E_ApplicationProfile profile)
select given application profile
Ultrasound Single & Multi-Frame for Image Display (STD-US-ID-MF-xxxx)
Definition: dcddirif.h:149
void inventMissingInstanceLevelAttributes(DcmDirectoryRecord *parent)
invent missing type 1 attributes for all child records (from instance level)
OFCondition checkBasicCardiacAttributes(DcmItem *dataset, const char *filename)
check attributes for compliance with Basic Cardiac application profile
OFBool retiredSOPClassSupport() const
get current status of the "retired SOP class support" mode.
Definition: dcddirif.h:359
OFBool disableTransferSyntaxCheck(const OFBool newMode=OFFalse)
disable/enable the "transfer syntax check".
OFCondition setIconSize(const unsigned int size)
set preferred size of the icon images.
OFCondition checkDicomFile(const char *filename, const char *directory=NULL)
check whether specified DICOM file is suitable to be included into the DICOMDIR.
OFBool AbortMode
abort on first inconsistent record
Definition: dcddirif.h:1432
DcmDirectoryRecord * findExistingRecord(DcmDirectoryRecord *parent, const E_DirRecType recordType, DcmItem *dataset)
search for a given directory record
void inventMissingAttributes(DcmDirectoryRecord *parent, const OFBool recurse=OFTrue)
invent missing type 1 attributes for all child records (from patient level)
1024 X-Ray Angiographic Studies on CD-R Media (STD-XA1K-CD)
Definition: dcddirif.h:135
OFBool addImageSupport(DicomDirImagePlugin *plugin)
add pluggable image support.
void copyElementType1(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename)
copy type 1 element from dataset to directory record
Definition: dcddirif.h:1312
this class implements support for DICOMDIR files, which are special DICOM files containing a list of ...
Definition: dcdicdir.h:58
DcmDirectoryRecord * buildRTDoseRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update RT dose record and copy required values from dataset
virtual ~DicomDirImagePlugin()
destructor (virtual)
Definition: dcddirif.h:63
OFCondition checkSOPClassAndXfer(DcmMetaInfo *metainfo, DcmItem *dataset, const char *filename)
check SOP class and transfer syntax for compliance with current profile
OFBool enableInventMode(const OFBool newMode=OFTrue)
enable/disable the "invent missing values" mode.
void setDefaultValue(DcmDirectoryRecord *record, const DcmTagKey &key, const unsigned long number, const char *prefix=NULL)
set default value (number or prefix and number) to a given tag
General Purpose Interchange on CD-R or DVD-RAM Media (STD-GEN-CD/DVD-RAM)
Definition: dcddirif.h:121
E_ApplicationProfile ApplicationProfile
currently selected application profile
Definition: dcddirif.h:1427
DcmDirectoryRecord * buildRTStructureSetRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update RT structure set record and copy required values from dataset
DcmDirectoryRecord * buildMeasurementRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update measurement record and copy required values from dataset
DcmDirectoryRecord * buildModalityLutRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update modality LUT record and copy required values from dataset
OFString IconPrefix
filename prefix for the external icon images
Definition: dcddirif.h:1462
DVD Interchange with MPEG2 MP@ML (STD-DVD-MPEG2-MPML)
Definition: dcddirif.h:131
OFCondition checkUltrasoundAttributes(DcmItem *dataset, const OFString &transferSyntax, const char *filename)
check attributes for compliance with Ultrasound application profiles
DcmDirectoryRecord * buildPatientRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename)
create or update patient record and copy required values from dataset
OFCondition setFilesetDescriptor(const char *filename, const char *charset=DEFAULT_DESCRIPTOR_CHARSET)
set the fileset descriptor file ID and character set.
OFBool ResolutionCheck
check image resolution
Definition: dcddirif.h:1444
OFBool checkExists(DcmItem *dataset, const DcmTagKey &key, const char *filename=NULL)
check whether given tag exists in the DICOM dataset
DicomDirInterface & operator=(const DicomDirInterface &obj)
private undefined assignment operator
OFBool backupMode() const
get current status of the "create backup" mode.
Definition: dcddirif.h:377
DcmDirectoryRecord * buildStoredPrintRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update stored print record and copy required values from dataset
void copyElementType2(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename)
copy type 2 element from dataset to directory record
Definition: dcddirif.h:1340
12-lead ECG Interchange on Diskette (STD-WVFM-ECG-FD)
Definition: dcddirif.h:155
DcmDirectoryRecord * buildStudyRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename)
create or update study record and copy required values from dataset
DicomDirImagePlugin()
constructor (protected)
Definition: dcddirif.h:105
OFBool JP2KSupport
flag indicating whether JPEG 2000 decompression is supported
Definition: dcddirif.h:1471
Ultrasound Single Frame for Image Display (STD-US-ID-SF-xxxx)
Definition: dcddirif.h:143
void inventMissingStudyLevelAttributes(DcmDirectoryRecord *parent)
invent missing type 1 attributes for all child records (from study level)
OFBool copyFile(const char *fromFilename, const char *toFilename)
copy contents of specified file
unsigned long AutoSeriesNumber
current series number used to invent missing attribute values
Definition: dcddirif.h:1478
void cleanup()
reset the object to its initial state.
OFBool resolutionCheck() const
get current status of the "spatial resolution check" mode.
Definition: dcddirif.h:395
void copyElementType3(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename)
copy type 3 element from dataset to directory record
Definition: dcddirif.h:1354
OFBool isFilenameValid(const char *filename, const OFBool allowEmpty=OFFalse)
check whether specified filename is valid.
OFBool InventPatientIDMode
invent missing patient ID mode
Definition: dcddirif.h:1438
unsigned int IconSize
size of the optional icon image in pixels
Definition: dcddirif.h:1460
OFBool enableIconImageMode(const OFBool newMode=OFTrue)
enable/disable the "create icon images" mode.
DcmDirectoryRecord * buildImplantGroupRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update implant group record and copy required values from dataset
DcmDirectoryRecord * buildStereometricRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update stereometric record and copy required values from dataset
OFBool compareStringAttributes(DcmItem *dataset, const DcmTagKey &datKey, DcmDirectoryRecord *record, const DcmTagKey &recKey, const OFString &sourceFilename, const OFBool errorMsg=OFFalse)
compare string attribute from dataset and record and report any deviation
void printUnexpectedValueMessage(const DcmTagKey &key, const char *filename=NULL, const OFBool errorMsg=OFTrue)
print a message that the value of a given tag is unexpected.
OFCondition writeDicomDir(const E_EncodingType encodingType=EET_UndefinedLength, const E_GrpLenEncoding groupLength=EGL_withoutGL)
write the current DICOMDIR object to file.
OFBool IconImageMode
create icon images
Definition: dcddirif.h:1450
OFBool encodingCheck() const
get current status of the "pixel encoding check" mode.
Definition: dcddirif.h:386
OFBool checkFilesetID(const OFString &filesetID)
check whether given fileset ID is valid
OFBool enableInventPatientIDMode(const OFBool newMode=OFTrue)
enable/disable the "invent new patient ID" mode.
CT/MR Studies (STD-CTMR-xxxx)
Definition: dcddirif.h:141
OFBool consistencyCheck() const
get current status of the "consistency check" mode.
Definition: dcddirif.h:413
OFBool compareSequenceAttributes(DcmItem *dataset, DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename)
compare sequence attribute from dataset and record and report any deviation
DcmDirectoryRecord * buildCurveRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update curve record and copy required values from dataset
unsigned long AutoPatientNumber
current patient number used to invent missing attribute values
Definition: dcddirif.h:1474
virtual OFBool scaleData(const Uint8 *srcData, const unsigned int srcWidth, const unsigned int srcHeight, Uint8 *dstData, const unsigned int dstWidth, const unsigned int dstHeight) const =0
scale image (pixel data) to specified size
OFCondition setIconPrefix(const char *prefix)
set filename prefix for alternative icon images.
OFBool RetiredSOPClassSupport
support retired SOP classes
Definition: dcddirif.h:1440
unsigned long AutoOverlayNumber
current overlay number used to invent missing attribute values
Definition: dcddirif.h:1482
virtual OFBool scaleImage(DcmItem *dataset, Uint8 *pixel, const unsigned long count, const unsigned long frame, const unsigned int width, const unsigned int height, const OFBool decompressAll=OFFalse) const =0
scale image (from DICOM dataset) to specified size
OFCondition createNewDicomDir(const E_ApplicationProfile profile=AP_GeneralPurpose, const char *filename=DEFAULT_DICOMDIR_NAME, const char *filesetID=DEFAULT_FILESETID)
create a new DICOMDIR object.
OFBool recordMatchesDataset(DcmDirectoryRecord *record, DcmItem *dataset)
check whether given directory record matches dataset.
DcmDirectoryRecord * buildRTTreatmentRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update RT treatment record and copy required values from dataset
DcmDirectoryRecord * buildImplantRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update implant record and copy required values from dataset
OFBool getIconFromFile(const OFString &filename, Uint8 *pixel, const unsigned long count, const unsigned int width, const unsigned int height)
create icon image from given PGM (portable gray map) file.
OFBool disableResolutionCheck(const OFBool newMode=OFFalse)
disable/enable the "spatial resolution check".
void createDicomDirBackup(const char *filename)
create backup of a given file
General Purpose MIME Interchange Profile (STD-GEN-MIME)
Definition: dcddirif.h:127
OFCondition setDefaultIcon(const char *filename)
set filename of default icon image.
DicomDirInterface()
constructor (default).
a class representing the DICOM file meta information header
Definition: dcmetinf.h:53
OFBool abortMode() const
get current status of the "abort on first error" mode.
Definition: dcddirif.h:323
OFBool inventPatientIDMode() const
get current status of the "invent missing patient ID" mode.
Definition: dcddirif.h:350
General Purpose USB and Flash Memory with Compression Interchange (STD-GEN-USB/MMC/CF/SD-JPEG/J2K) ...
Definition: dcddirif.h:129
E_ApplicationProfile
list of supported media storage application profiles
Definition: dcddirif.h:118
DcmDirectoryRecord * buildWaveformRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update waveform record and copy required values from dataset
OFBool enableMapFilenamesMode(const OFBool newMode=OFTrue)
enable/disable the "map filenames" mode.
DcmDirectoryRecord * buildPaletteRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update palette record and copy required values from dataset
OFBool JPEGSupport
flag indicating whether JPEG decompression is supported
Definition: dcddirif.h:1469
OFBool mapFilenamesMode() const
get current status of the "map filenames" mode.
Definition: dcddirif.h:332
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
OFBool isCharsetValid(const char *charset)
check whether given charset identifier is valid.
DcmDirectoryRecord * buildFiducialRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update fiducial record and copy required values from dataset
void printRecordErrorMessage(const OFCondition &error, const E_DirRecType recordType, const char *operation)
print an error message that something went wrong with a given record.
DcmDirectoryRecord * buildKeyObjectDocRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update key object doc record and copy required values from dataset
OFBool enableAbortMode(const OFBool newMode=OFTrue)
enable/disable the "abort on first error" mode.
OFBool warnAboutInconsistentAttributes(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename, const OFBool abortCheck=OFFalse)
see if all the attributes in record match the values in dataset and warn if not
Ultrasound Single & Multi-Frame with Spatial Calibration (STD-UD-SC-MF-xxxx)
Definition: dcddirif.h:151
OFBool disableEncodingCheck(const OFBool newMode=OFFalse)
disable/enable the "pixel encoding check".
DcmDirectoryRecord * buildRegistrationRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update registration record and copy required values from dataset
virtual ~DicomDirInterface()
destructor (virtual).
OFBool MapFilenamesMode
automatically map filenames
Definition: dcddirif.h:1434
OFBool transferSyntaxCheck() const
get current status of the "transfer syntax check" mode.
Definition: dcddirif.h:404
DcmDicomDir * DicomDir
pointer to the current DICOMDIR object
Definition: dcddirif.h:1421
void copyStringWithDefault(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename, const char *defaultValue="", const OFBool printWarning=OFFalse)
copy optional string value from dataset to directory record
DcmDirectoryRecord * buildStructReportRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update structure reporting record and copy required values from dataset ...
unsigned long AutoStudyNumber
current study number used to invent missing attribute values
Definition: dcddirif.h:1476
void inventMissingSeriesLevelAttributes(DcmDirectoryRecord *parent)
invent missing type 1 attributes for all child records (from series level)
DcmDirectoryRecord * buildRawDataRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
create or update raw data record and copy required values from dataset
Ultrasound Single Frame with Combined Calibration (STD-US-CC-SF-xxxx)
Definition: dcddirif.h:147
OFCondition checkCTandMRAttributes(DcmItem *dataset, const OFString &sopClass, const char *filename)
check attributes for compliance with CT and MR application profile
OFBool enableRetiredSOPClassSupport(const OFBool newMode=OFTrue)
enable/disable the "retired SOP class support" mode.
void copyElement(DcmItem *dataset, const DcmTagKey &key, DcmDirectoryRecord *record, const OFString &sourceFilename, const OFBool optional=OFFalse, const OFBool copyEmpty=OFTrue)
copy element from dataset to directory record
OFBool checkReferencedSOPInstance(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &referencedFileID, const OFString &sourceFilename)
check referenced SOP instance for consistency with a new directory record
OFCondition checkXrayAngiographicAttributes(DcmItem *dataset, const OFString &sopClass, const char *filename)
check attributes for compliance with X-ray Angiography application profile
1024 X-Ray Angiographic Studies on DVD Media (STD-XA1K-DVD)
Definition: dcddirif.h:137
OFBool getIconFromDataset(DcmItem *dataset, Uint8 *pixel, const unsigned long count, const unsigned int width, const unsigned int height)
create icon image from DICOM dataset.
DcmDirectoryRecord * buildSeriesRecord(DcmDirectoryRecord *record, DcmItem *dataset, const OFString &sourceFilename)
create or update new series record and copy required values from dataset
General purpose class for condition codes.
Definition: ofcond.h:305
OFBool TransferSyntaxCheck
check transfer syntax
Definition: dcddirif.h:1446
OFCondition addIconImage(DcmDirectoryRecord *record, DcmItem *dataset, const unsigned int size, const OFString &sourceFilename)
add icon image sequence to directory record.


Generated on Wed Dec 28 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.8