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 DIOVLAY_H
00035 #define DIOVLAY_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dctypes.h"
00039 #include "dcmtk/ofstd/ofcast.h"
00040
00041 #include "dcmtk/dcmimgle/diobjcou.h"
00042 #include "dcmtk/dcmimgle/diovdat.h"
00043 #include "dcmtk/dcmimgle/diovpln.h"
00044 #include "dcmtk/dcmimgle/diutils.h"
00045
00046
00047
00048
00049
00050
00051 class DiDocument;
00052
00053 class DcmOverlayData;
00054 class DcmLongString;
00055
00056
00057
00058
00059
00060
00063 class DiOverlay
00064 : public DiObjectCounter
00065 {
00066
00067 public:
00068
00074 DiOverlay(const DiDocument *docu = NULL,
00075 const Uint16 alloc = 0);
00076
00085 DiOverlay(const DiOverlay *overlay,
00086 const signed long left_pos,
00087 const signed long top_pos,
00088 const double xfactor,
00089 const double yfactor);
00090
00099 DiOverlay(const DiOverlay *overlay,
00100 const int horz,
00101 const int vert,
00102 const Uint16 columns,
00103 const Uint16 rows);
00104
00112 DiOverlay(const DiOverlay *overlay,
00113 const int degree,
00114 const Uint16 columns,
00115 const Uint16 rows);
00116
00119 virtual ~DiOverlay();
00120
00127 int isPlaneVisible(unsigned int plane);
00128
00135 int showPlane(unsigned int plane);
00136
00146 int showPlane(unsigned int plane,
00147 const double fore,
00148 const double thresh,
00149 const EM_Overlay mode);
00150
00159 int showPlane(unsigned int plane,
00160 const Uint16 pvalue);
00161
00166 int showAllPlanes();
00167
00176 int showAllPlanes(const double fore,
00177 const double thresh,
00178 const EM_Overlay mode);
00179
00186 int hidePlane(unsigned int plane);
00187
00192 int hideAllPlanes();
00193
00202 int placePlane(unsigned int plane,
00203 const signed int left_pos,
00204 const signed int top_pos);
00205
00212 unsigned int getPlaneGroupNumber(unsigned int plane) const;
00213
00220 const char *getPlaneLabel(unsigned int plane) const;
00221
00228 const char *getPlaneDescription(unsigned int plane) const;
00229
00236 EM_Overlay getPlaneMode(unsigned int plane) const;
00237
00242 inline unsigned int getCount() const
00243 {
00244 return (Data != NULL) ? Data->Count : 0;
00245 }
00246
00252 inline signed long getLeft() const
00253 {
00254 return Left;
00255 }
00256
00262 inline signed long getTop() const
00263 {
00264 return Top;
00265 }
00266
00271 int hasEmbeddedData() const;
00272
00290 int addPlane(const unsigned int group,
00291 const signed int left_pos,
00292 const signed int top_pos,
00293 const unsigned int columns,
00294 const unsigned int rows,
00295 const DcmOverlayData &data,
00296 const DcmLongString &label,
00297 const DcmLongString &description,
00298 const EM_Overlay mode);
00299
00300
00307 int removePlane(const unsigned int group);
00308
00309 inline DiOverlayPlane *getPlane(const unsigned int plane) const
00310 {
00311 return ((Data != NULL) && (Data->Planes != NULL) && (plane < Data->Count)) ? Data->Planes[plane] : OFstatic_cast(DiOverlayPlane *, NULL);
00312 }
00313
00321 inline int hasPlane(unsigned int plane,
00322 const int visible = 0) const
00323 {
00324 return (convertToPlaneNumber(plane, AdditionalPlanes) > 1) && (!visible || Data->Planes[plane]->isVisible());
00325 }
00326
00345 void *getPlaneData(const unsigned long frame,
00346 unsigned int plane,
00347 unsigned int &left_pos,
00348 unsigned int &top_pos,
00349 unsigned int &width,
00350 unsigned int &height,
00351 EM_Overlay &mode,
00352 const Uint16 columns,
00353 const Uint16 rows,
00354 const int bits = 8,
00355 const Uint16 fore = 0xff,
00356 const Uint16 back = 0x0);
00357
00371 void *getFullPlaneData(const unsigned long frame,
00372 unsigned int plane,
00373 unsigned int &width,
00374 unsigned int &height,
00375 const int bits = 8,
00376 const Uint16 fore = 0xff,
00377 const Uint16 back = 0x0);
00378
00392 unsigned long create6xxx3000PlaneData(Uint8 *&buffer,
00393 unsigned int plane,
00394 unsigned int &width,
00395 unsigned int &height,
00396 unsigned long &frames);
00397
00399 static const unsigned int MaxOverlayCount;
00401 static const unsigned int FirstOverlayGroup;
00402
00403
00404 protected:
00405
00412 Uint16 *Init(const DiOverlay *overlay);
00413
00424 int convertToPlaneNumber(unsigned int &plane,
00425 const int mode) const;
00426
00433 unsigned int convertToGroupNumber(const unsigned int plane) const
00434 {
00435 return FirstOverlayGroup + 2 * plane;
00436 }
00437
00445 int isValidGroupNumber(const unsigned int group) const;
00446
00455 int checkPlane(const unsigned int plane,
00456 const int mode = 1);
00457
00458
00459 private:
00460
00462 signed long Left;
00464 signed long Top;
00466 Uint16 Width;
00468 Uint16 Height;
00470 unsigned long Frames;
00471
00473 int AdditionalPlanes;
00474
00476 DiOverlayData *Data;
00477
00478
00479
00480 DiOverlay(const DiOverlay &);
00481 DiOverlay &operator=(const DiOverlay &);
00482 };
00483
00484
00485 #endif
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591