00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef DIDOCU_H
00035 #define DIDOCU_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dctypes.h"
00039 #include "dcmtk/dcmdata/dcfilefo.h"
00040 #include "dcmtk/dcmdata/dcxfer.h"
00041 #include "dcmtk/dcmimgle/diobjcou.h"
00042 #include "dcmtk/ofstd/ofstring.h"
00043
00044 #define INCLUDE_CSTDDEF
00045 #include "dcmtk/ofstd/ofstdinc.h"
00046
00047
00048
00049
00050
00051
00052 class DcmStack;
00053 class DcmObject;
00054 class DcmTagKey;
00055 class DcmElement;
00056 class DcmSequenceOfItems;
00057
00058
00059
00060
00061
00062
00068 class DiDocument
00069 : public DiObjectCounter
00070 {
00071
00072 public:
00073
00081 DiDocument(const char *filename,
00082 const unsigned long flags = 0,
00083 const unsigned long fstart = 0,
00084 const unsigned long fcount = 0);
00085
00094 DiDocument(DcmObject *object,
00095 const E_TransferSyntax xfer,
00096 const unsigned long flags = 0,
00097 const unsigned long fstart = 0,
00098 const unsigned long fcount = 0);
00099
00102 virtual ~DiDocument();
00103
00108 inline int good() const
00109 {
00110 return Object != NULL;
00111 }
00112
00117 inline DcmObject *getDicomObject() const
00118 {
00119 return Object;
00120 }
00121
00126 inline unsigned long getFrameStart() const
00127 {
00128 return FrameStart;
00129 }
00130
00135 inline unsigned long getFrameCount() const
00136 {
00137 return FrameCount;
00138 }
00139
00144 inline unsigned long getFlags() const
00145 {
00146 return Flags;
00147 }
00148
00153 inline E_TransferSyntax getTransferSyntax() const
00154 {
00155 return Xfer;
00156 }
00157
00165 DcmElement *search(const DcmTagKey &tag,
00166 DcmObject *obj = NULL) const;
00167
00175 int search(const DcmTagKey &tag,
00176 DcmStack &stack) const;
00177
00178
00185 unsigned long getVM(const DcmTagKey &tag) const;
00186
00196 unsigned long getValue(const DcmTagKey &tag,
00197 Uint16 &returnVal,
00198 const unsigned long pos = 0,
00199 DcmObject *item = NULL) const;
00200
00209 unsigned long getValue(const DcmTagKey &tag,
00210 Sint16 &returnVal,
00211 const unsigned long pos = 0) const;
00212
00221 unsigned long getValue(const DcmTagKey &tag,
00222 Uint32 &returnVal,
00223 const unsigned long pos = 0) const;
00224
00233 unsigned long getValue(const DcmTagKey &tag,
00234 Sint32 &returnVal,
00235 const unsigned long pos = 0) const;
00236
00245 unsigned long getValue(const DcmTagKey &tag,
00246 double &returnVal,
00247 const unsigned long pos = 0) const;
00248
00257 unsigned long getValue(const DcmTagKey &tag,
00258 const Uint16 *&returnVal,
00259 DcmObject *item = NULL) const;
00260
00269 unsigned long getValue(const DcmTagKey &tag,
00270 const char *&returnVal,
00271 DcmObject *item = NULL) const;
00272
00282 unsigned long getValue(const DcmTagKey &tag,
00283 OFString &returnVal,
00284 const unsigned long pos = 0,
00285 DcmObject *item = NULL) const;
00286
00294 unsigned long getSequence(const DcmTagKey &tag,
00295 DcmSequenceOfItems *&seq) const;
00296
00305 static unsigned long getElemValue(const DcmElement *elem,
00306 Uint16 &returnVal,
00307 const unsigned long pos = 0);
00308
00316 static unsigned long getElemValue(const DcmElement *elem,
00317 const Uint16 *&returnVal);
00318
00326 static unsigned long getElemValue(const DcmElement *elem,
00327 const char *&returnVal);
00328
00337 static unsigned long getElemValue(const DcmElement *elem,
00338 OFString &returnVal,
00339 const unsigned long pos = 0);
00340
00341 protected:
00342
00345 void convertPixelData();
00346
00347
00348 private:
00349
00351 DcmObject *Object;
00353 DcmFileFormat *FileFormat;
00355 E_TransferSyntax Xfer;
00356
00358 unsigned long FrameStart;
00360 unsigned long FrameCount;
00361
00363 unsigned long Flags;
00364
00365
00366
00367 DiDocument(const DiDocument &);
00368 DiDocument &operator=(const DiDocument &);
00369 };
00370
00371
00372 #endif
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461