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 #ifndef DIOVLAY_H
00031 #define DIOVLAY_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034 #include "dcmtk/ofstd/ofcast.h"
00035
00036 #include "dcmtk/dcmimgle/diobjcou.h"
00037 #include "dcmtk/dcmimgle/diovdat.h"
00038 #include "dcmtk/dcmimgle/diovpln.h"
00039 #include "dcmtk/dcmimgle/diutils.h"
00040
00041
00042
00043
00044
00045
00046 class DiDocument;
00047
00048 class DcmOverlayData;
00049 class DcmLongString;
00050
00051
00052
00053
00054
00055
00058 class DiOverlay
00059 : public DiObjectCounter
00060 {
00061
00062 public:
00063
00071 DiOverlay(const DiDocument *docu = NULL,
00072 const Uint16 alloc = 0,
00073 const Uint16 stored = 0,
00074 const Uint16 high = 0);
00075
00084 DiOverlay(const DiOverlay *overlay,
00085 const signed long left_pos,
00086 const signed long top_pos,
00087 const double xfactor,
00088 const double yfactor);
00089
00098 DiOverlay(const DiOverlay *overlay,
00099 const int horz,
00100 const int vert,
00101 const Uint16 columns,
00102 const Uint16 rows);
00103
00111 DiOverlay(const DiOverlay *overlay,
00112 const int degree,
00113 const Uint16 columns,
00114 const Uint16 rows);
00115
00118 virtual ~DiOverlay();
00119
00126 int isPlaneVisible(unsigned int plane);
00127
00134 int showPlane(unsigned int plane);
00135
00145 int showPlane(unsigned int plane,
00146 const double fore,
00147 const double thresh,
00148 const EM_Overlay mode);
00149
00158 int showPlane(unsigned int plane,
00159 const Uint16 pvalue);
00160
00165 int showAllPlanes();
00166
00175 int showAllPlanes(const double fore,
00176 const double thresh,
00177 const EM_Overlay mode);
00178
00185 int hidePlane(unsigned int plane);
00186
00191 int hideAllPlanes();
00192
00201 int placePlane(unsigned int plane,
00202 const signed int left_pos,
00203 const signed int top_pos);
00204
00211 unsigned int getPlaneGroupNumber(unsigned int plane) const;
00212
00219 const char *getPlaneLabel(unsigned int plane) const;
00220
00227 const char *getPlaneDescription(unsigned int plane) const;
00228
00235 EM_Overlay getPlaneMode(unsigned int plane) const;
00236
00241 inline unsigned int getCount() const
00242 {
00243 return (Data != NULL) ? Data->Count : 0;
00244 }
00245
00251 inline signed long getLeft() const
00252 {
00253 return Left;
00254 }
00255
00261 inline signed long getTop() const
00262 {
00263 return Top;
00264 }
00265
00270 int hasEmbeddedData() const;
00271
00289 int addPlane(const unsigned int group,
00290 const signed int left_pos,
00291 const signed int top_pos,
00292 const unsigned int columns,
00293 const unsigned int rows,
00294 const DcmOverlayData &data,
00295 const DcmLongString &label,
00296 const DcmLongString &description,
00297 const EM_Overlay mode);
00298
00299
00306 int removePlane(const unsigned int group);
00307
00308 inline DiOverlayPlane *getPlane(const unsigned int plane) const
00309 {
00310 return ((Data != NULL) && (Data->Planes != NULL) && (plane < Data->Count)) ? Data->Planes[plane] : OFstatic_cast(DiOverlayPlane *, NULL);
00311 }
00312
00320 inline int hasPlane(unsigned int plane,
00321 const int visible = 0) const
00322 {
00323 return (convertToPlaneNumber(plane, AdditionalPlanes) > 1) && (!visible || Data->Planes[plane]->isVisible());
00324 }
00325
00344 void *getPlaneData(const unsigned long frame,
00345 unsigned int plane,
00346 unsigned int &left_pos,
00347 unsigned int &top_pos,
00348 unsigned int &width,
00349 unsigned int &height,
00350 EM_Overlay &mode,
00351 const Uint16 columns,
00352 const Uint16 rows,
00353 const int bits = 8,
00354 const Uint16 fore = 0xff,
00355 const Uint16 back = 0x0);
00356
00370 void *getFullPlaneData(const unsigned long frame,
00371 unsigned int plane,
00372 unsigned int &width,
00373 unsigned int &height,
00374 const int bits = 8,
00375 const Uint16 fore = 0xff,
00376 const Uint16 back = 0x0);
00377
00391 unsigned long create6xxx3000PlaneData(Uint8 *&buffer,
00392 unsigned int plane,
00393 unsigned int &width,
00394 unsigned int &height,
00395 unsigned long &frames);
00396
00398 static const unsigned int MaxOverlayCount;
00400 static const unsigned int FirstOverlayGroup;
00401
00402
00403 protected:
00404
00411 Uint16 *Init(const DiOverlay *overlay);
00412
00423 int convertToPlaneNumber(unsigned int &plane,
00424 const int mode) const;
00425
00432 unsigned int convertToGroupNumber(const unsigned int plane) const
00433 {
00434 return FirstOverlayGroup + 2 * plane;
00435 }
00436
00444 int isValidGroupNumber(const unsigned int group) const;
00445
00454 int checkPlane(const unsigned int plane,
00455 const int mode = 1);
00456
00457
00458 private:
00459
00461 signed long Left;
00463 signed long Top;
00465 Uint16 Width;
00467 Uint16 Height;
00469 unsigned long Frames;
00470
00472 int AdditionalPlanes;
00473
00475 DiOverlayData *Data;
00476
00477
00478
00479 DiOverlay(const DiOverlay &);
00480 DiOverlay &operator=(const DiOverlay &);
00481 };
00482
00483
00484 #endif
00485
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
00592
00593
00594
00595
00596
00597
00598
00599
00600