OFFIS DCMTK  Version 3.6.0
dvpstat.h
1 /*
2  *
3  * Copyright (C) 1998-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: dcmpstat
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose:
19  * classes: DVPresentationState
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:16:37 $
23  * CVS/RCS Revision: $Revision: 1.47 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DVPSTAT_H
31 #define DVPSTAT_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 #include "dcmtk/dcmpstat/dcmpstat.h"
35 
36 class DicomImage;
37 class DiDisplayFunction;
38 
44 {
45 public:
59  DiDisplayFunction **dispFunction=NULL,
60  unsigned long minPrintBitmapX=0,
61  unsigned long minPrintBitmapY=0,
62  unsigned long maxPrintBitmapX=0,
63  unsigned long maxPrintBitmapY=0,
64  unsigned long maxPreviewImageX=0,
65  unsigned long maxPreviewImageY=0);
66 
68  virtual ~DVPresentationState();
69 
74  void clear();
75 
86  OFCondition read(DcmItem &dset);
87 
115  DVPSoverlayActivation overlayActivation = DVPSO_copyOverlays,
116  DVPSVOIActivation voiActivation = DVPSV_preferVOILUT,
117  OFBool curveActivation = OFTrue,
118  OFBool shutterActivation = OFTrue,
119  OFBool presentationActivation = OFTrue,
120  DVPSGraphicLayering layering = DVPSG_twoLayers,
121  const char * aetitle = NULL,
122  const char * filesetID = NULL,
123  const char * filesetUID = NULL);
124 
135  const char *aetitle=NULL,
136  const char *filesetID=NULL,
137  const char *filesetUID=NULL);
138 
143 
150  OFCondition setCurrentPresentationLUT(DVPSPresentationLUTType newType);
151 
159 
173  DcmUnsignedShort& lutDescriptor,
174  DcmUnsignedShort& lutData,
175  DcmLongString& lutExplanation);
176 
188 
197 
204 
208  OFBool haveActiveVOIWindow();
209 
213  OFBool haveActiveVOILUT();
214 
219  const char *getCurrentVOIDescription();
220 
227 
234 
237  size_t getNumberOfVOILUTsInImage();
238 
242 
249  const char *getDescriptionOfVOILUTsInImage(size_t idx);
250 
257  const char *getDescriptionOfVOIWindowsInImage(size_t idx);
258 
265  OFCondition setVOILUTFromImage(size_t idx,
266  DVPSObjectApplicability applicability=DVPSB_currentImage);
267 
275  DVPSObjectApplicability applicability=DVPSB_currentImage);
276 
285  OFCondition setVOIWindow(double wCenter, double wWidth, const char *description=NULL,
286  DVPSObjectApplicability applicability=DVPSB_currentImage);
287 
301  DcmUnsignedShort& lutDescriptor,
302  DcmUnsignedShort& lutData,
303  DcmLongString& lutExplanation,
304  DVPSObjectApplicability applicability=DVPSB_currentImage);
305 
311  void deactivateVOI(DVPSObjectApplicability applicability=DVPSB_currentImage);
312 
325  OFCondition setGammaVOILUT(double gammaValue, DVPSObjectApplicability applicability=DVPSB_currentImage);
326 
331  DVPSPresentationSizeMode getDisplayedAreaPresentationSizeMode();
332 
340 
350  OFCondition getStandardDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY);
351 
361  OFCondition getImageRelativeDisplayedArea(Sint32& tlhcX, Sint32& tlhcY, Sint32& brhcX, Sint32& brhcY);
362 
369 
375 
381 
400  DVPSPresentationSizeMode sizeMode,
401  Sint32 tlhcX, Sint32 tlhcY,
402  Sint32 brhcX, Sint32 brhcY,
403  double magnification=1.0,
404  DVPSObjectApplicability applicability=DVPSB_currentImage);
405 
425  DVPSPresentationSizeMode sizeMode,
426  Sint32 tlhcX, Sint32 tlhcY,
427  Sint32 brhcX, Sint32 brhcY,
428  double magnification=1.0,
429  DVPSObjectApplicability applicability=DVPSB_currentImage);
430 
435  void removeShutter(DVPSShutterType type);
436 
447  OFCondition setRectShutter(Sint32 lv, Sint32 rv, Sint32 uh, Sint32 lh);
457  OFCondition setCircularShutter(Sint32 centerX, Sint32 centerY, Sint32 radius);
458 
470  OFCondition addPolyShutterVertex(Sint32 x, Sint32 y);
471 
477  OFCondition removeGraphicLayer(size_t idx);
478 
486  size_t getNumberOfTextObjects(size_t layer);
487 
497  DVPSTextObject *getTextObject(size_t layer, size_t idx);
498 
508  DVPSTextObject *addTextObject(size_t layer,
509  DVPSObjectApplicability applicability=DVPSB_allImages);
510 
519  OFCondition removeTextObject(size_t layer, size_t idx);
520 
534  OFCondition moveTextObject(size_t old_layer, size_t idx, size_t new_layer,
535  DVPSObjectApplicability applicability=DVPSB_allImages);
536 
544  size_t getNumberOfGraphicObjects(size_t layer);
545 
555  DVPSGraphicObject *getGraphicObject(size_t layer, size_t idx);
556 
566  DVPSGraphicObject *addGraphicObject(size_t layer,
567  DVPSObjectApplicability applicability=DVPSB_allImages);
568 
577  OFCondition removeGraphicObject(size_t layer, size_t idx);
578 
592  OFCondition moveGraphicObject(size_t old_layer, size_t idx, size_t new_layer,
593  DVPSObjectApplicability applicability=DVPSB_allImages);
594 
602  DVPSCurve *getCurve(size_t layer, size_t idx);
603 
608  size_t getNumberOfCurvesInImage();
609 
616  DVPSCurve *getCurveInImage(size_t idx);
617 
626  OFCondition addCurve(size_t layer, size_t curveidxinimage);
627 
633  const char *getActiveOverlayLabel(size_t layer, size_t idx);
634 
640  const char *getActiveOverlayDescription(size_t layer, size_t idx);
641 
648  OFBool activeOverlayIsROI(size_t layer, size_t idx);
649 
672  size_t layer,
673  size_t idx,
674  const void *&overlayData,
675  unsigned int &width,
676  unsigned int &height,
677  unsigned int &left_pos,
678  unsigned int &top_pos,
679  OFBool &isROI,
680  Uint16 &fore,
681  unsigned int bits = 8);
682 
690 
695  Uint16 getOverlayInImageGroup(size_t idx);
696 
701  const char *getOverlayInImageLabel(size_t idx);
702 
707  const char *getOverlayInImageDescription(size_t idx);
708 
715  size_t getOverlayInImageActivationLayer(size_t idx);
716 
722  OFBool overlayInImageIsROI(size_t idx);
723 
732 
743  OFCondition changeOverlayGroupInPresentationState(size_t idx, Uint16 newGroup=0);
744 
760  OFCondition addOverlayToPresentationState(DcmItem& overlayIOD, Uint16 groupInItem, Uint16 newGroup=0);
761 
770  OFBool overlayIsSuitableAsBitmapShutter(size_t idx);
771 
780  OFCondition activateOverlayInImage(size_t layer, size_t idx);
781 
791  OFCondition activateOverlayInPresentationState(size_t layer, size_t idx);
792 
801 
810  OFCondition deactivateOverlay(size_t layer, size_t idx);
811 
824  OFCondition attachImage(DcmDataset *dataset, OFBool transferOwnership);
825 
838  OFCondition attachImage(DcmFileFormat *fileformat, OFBool transferOwnership);
839 
842  void detachImage();
843 
847  OFBool isInverse();
848 
854 
874  const void *&pixelData,
875  unsigned long &width,
876  unsigned long &height);
877 
887  void *pixelData,
888  unsigned long size);
889 
893  const char *getAttachedImageSOPClassUID();
894 
898  const char *getAttachedImageSOPInstanceUID();
899 
908  OFCondition getImageWidth(unsigned long &width);
909 
918  OFCondition getImageHeight(unsigned long &height);
919 
924  unsigned long getPrintBitmapSize();
925 
933  OFCondition setMinimumPrintBitmapWidthHeight(unsigned long width,
934  unsigned long height);
935 
943  OFCondition setMaximumPrintBitmapWidthHeight(unsigned long width,
944  unsigned long height);
945 
953  OFCondition getPrintBitmapWidthHeight(unsigned long &width,
954  unsigned long &height);
955 
962  OFCondition getPrintBitmapWidth(unsigned long &width);
963 
970  OFCondition getPrintBitmapHeight(unsigned long &height);
971 
978 
988 
999  OFCondition getPrintBitmap(void *bitmap,
1000  unsigned long size,
1001  OFBool inversePLUT = OFFalse);
1002 
1016  OFCondition createPreviewImage(unsigned long maxWidth,
1017  unsigned long maxHeight,
1018  OFBool clipMode = OFFalse);
1019 
1022  void deletePreviewImage();
1023 
1028  unsigned long getPreviewImageSize();
1029 
1035  OFCondition getPreviewImageWidthHeight(unsigned long &width,
1036  unsigned long &height);
1037 
1042  OFCondition getPreviewImageWidth(unsigned long &width);
1043 
1048  OFCondition getPreviewImageHeight(unsigned long &height);
1049 
1056  OFCondition getPreviewImageBitmap(void *bitmap,
1057  unsigned long size);
1058 
1069  OFCondition getImageMinMaxPixelRange(double &minValue, double& maxValue);
1070 
1081  OFCondition getImageMinMaxPixelValue(double &minValue, double& maxValue);
1082 
1089  OFCondition getImageNumberOfFrames(unsigned long &frames);
1090 
1098  OFCondition selectImageFrameNumber(unsigned long frame);
1099 
1103  unsigned long getSelectedImageFrameNumber();
1104 
1111  DVPSDisplayTransform getDisplayTransform() { return displayTransform; }
1112 
1118  void setDisplayTransform(DVPSDisplayTransform transform) { displayTransform = transform; }
1119 
1129  Uint16 convertPValueToDDL(Uint16 pvalue, unsigned int bits = 8);
1130 
1139 
1143  const char *getCurrentImageModality();
1144 
1153  Uint16 findOverlayGroup(Uint16 currentGroup=0);
1154 
1163  void renderPixelData(OFBool display = OFTrue);
1164 
1171 
1177 
1178 private:
1179 
1188  DVPSOverlay& ovl,
1189  DicomImage &image,
1190  OFBool asShutter = OFFalse,
1191  Uint16 pvalue = 0);
1192 
1193  /* connection with dcmimage */
1194 
1214  unsigned long currentImageWidth;
1217  unsigned long currentImageHeight;
1220  unsigned long renderedImageWidth;
1223  unsigned long renderedImageHeight;
1226  signed long renderedImageTop;
1230  signed long renderedImageLeft;
1234  signed long renderedImageBottom;
1237  signed long renderedImageRight;
1267  DVPSRotationType currentImageRotation;
1273 
1283 
1287 
1291 
1295  DVPSDisplayTransform displayTransform;
1296 
1300 
1304 
1308 
1312 
1316 
1320 
1324 
1328 
1329 };
1330 
1331 #endif
1332 
1333 /*
1334  * $Log: dvpstat.h,v $
1335  * Revision 1.47 2010-10-14 13:16:37 joergr
1336  * Updated copyright header. Added reference to COPYRIGHT file.
1337  *
1338  * Revision 1.46 2009-11-24 14:12:58 uli
1339  * Switched to logging mechanism provided by the "new" oflog module.
1340  *
1341  * Revision 1.45 2009-05-28 10:55:38 joergr
1342  * Fixed various Doxygen API documentation issues.
1343  *
1344  * Revision 1.44 2005/12/08 16:04:07 meichel
1345  * Changed include path schema for all DCMTK header files
1346  *
1347  * Revision 1.43 2003/09/05 14:30:06 meichel
1348  * Introduced new API methods that allow Displayed Areas to be queried
1349  * and set either relative to the image (ignoring rotation and flip) or
1350  * in absolute values as defined in the standard. Rotate and flip methods
1351  * now adjust displayed areas in the presentation state.
1352  *
1353  * Revision 1.42 2003/08/27 14:57:19 meichel
1354  * Splitted class DVPresentationState into a base class DcmPresentationState
1355  * that does not depend on module dcmimgle and current derived class with
1356  * public API identical to the previous version.
1357  *
1358  * Revision 1.41 2002/12/09 13:29:49 joergr
1359  * Renamed parameter/local variable to avoid name clashes with global
1360  * declaration left and/or right (used for as iostream manipulators).
1361  *
1362  * Revision 1.40 2001/09/26 15:36:17 meichel
1363  * Adapted dcmpstat to class OFCondition
1364  *
1365  * Revision 1.39 2001/06/01 15:50:23 meichel
1366  * Updated copyright header
1367  *
1368  * Revision 1.38 2000/11/13 15:50:43 meichel
1369  * Added dcmpstat support methods for creating image references
1370  * in SR documents.
1371  *
1372  * Revision 1.37 2000/07/04 15:58:03 joergr
1373  * Added support for overriding the presentation LUT settings made for the
1374  * image boxes.
1375  *
1376  * Revision 1.36 2000/06/09 10:14:12 joergr
1377  * Added support for rendering inverse presentation LUT into print bitmaps.
1378  *
1379  * Revision 1.35 2000/06/08 17:36:51 joergr
1380  * Corrected bug in addImageReferenceToPState().
1381  *
1382  * Revision 1.34 2000/06/02 16:00:53 meichel
1383  * Adapted all dcmpstat classes to use OFConsole for log and error output
1384  *
1385  * Revision 1.33 2000/05/30 14:21:24 joergr
1386  * Renamed some variables to avoid compiler warnings (reported by gcc 2.9x with
1387  * additional compiler flags).
1388  *
1389  * Revision 1.32 2000/05/30 13:47:03 joergr
1390  * Added support for multi-frame images and multiple references from a single
1391  * presentation to a number of images.
1392  * Removed methods which were already marked as "retired".
1393  * Added new function allowing to set a VOILUT created from a given gamma
1394  * value.
1395  *
1396  * Revision 1.31 2000/03/08 16:28:57 meichel
1397  * Updated copyright header.
1398  *
1399  * Revision 1.30 2000/02/29 12:16:16 meichel
1400  * Fixed bug in dcmpstat library that caused Monochrome1 images
1401  * to be printed inverse if a Presentation LUT was applied.
1402  *
1403  * Revision 1.29 1999/11/15 19:02:16 joergr
1404  * Changed behaviour of method getOverlayData(): parameter 'transp' replaced by
1405  * 'fore' to specify the foreground color used for the overlay plane.
1406  *
1407  * Revision 1.28 1999/11/03 10:36:32 joergr
1408  * Enhanced comments for methods dealing with arrays of pixel data.
1409  *
1410  * Revision 1.27 1999/10/20 10:49:20 joergr
1411  * Enhanced method getOverlayData to support 12 bit data for print.
1412  * Enhanced method convertPValueToDDL to support 12 bit data for print.
1413  * Added support for a down-scaled preview image of the current DICOM image
1414  * (e.g. useful for online-windowing or print preview).
1415  *
1416  * Revision 1.26 1999/10/19 16:24:50 meichel
1417  * Corrected handling of MONOCHROME1 images when used with P-LUTs
1418  *
1419  * Revision 1.25 1999/10/13 14:11:57 meichel
1420  * Added config file entries and access methods
1421  * for user-defined VOI presets, log directory, verbatim logging
1422  * and an explicit list of image display formats for each printer.
1423  *
1424  * Revision 1.24 1999/10/07 17:21:51 meichel
1425  * Reworked management of Presentation LUTs in order to create tighter
1426  * coupling between Softcopy and Print.
1427  *
1428  * Revision 1.23 1999/09/10 12:46:48 meichel
1429  * Added implementations for a number of print API methods.
1430  *
1431  * Revision 1.22 1999/09/10 09:02:32 joergr
1432  * Added support for CIELAB display function. New methods to handle display
1433  * functions. Old methods are marked as retired and should be removed asap.
1434  *
1435  * Revision 1.21 1999/09/07 09:04:37 joergr
1436  * Completed support for getting a print bitmap out of a pstate object.
1437  *
1438  * Revision 1.20 1999/09/01 16:14:42 meichel
1439  * Added support for requested image size to print routines
1440  *
1441  * Revision 1.19 1999/08/27 15:57:58 meichel
1442  * Added methods for saving hardcopy images and stored print objects
1443  * either in file or in the local database.
1444  *
1445  * Revision 1.18 1999/08/25 16:48:01 joergr
1446  * Added minimal support to get a print bitmap out of a pstate object.
1447  *
1448  * Revision 1.17 1999/07/30 13:34:51 meichel
1449  * Added new classes managing Stored Print objects
1450  *
1451  * Revision 1.16 1999/07/22 16:39:13 meichel
1452  * Adapted dcmpstat data structures and API to supplement 33 letter ballot text.
1453  *
1454  * Revision 1.15 1999/05/04 12:28:11 meichel
1455  * Removed carriage returns
1456  *
1457  * Revision 1.14 1999/04/27 11:23:57 joergr
1458  * Added method to check whether current image is inverse or not.
1459  *
1460  * Revision 1.13 1999/03/22 09:05:35 joergr
1461  * Added parameter to get value of (transparent) background color for method
1462  * getOverlayData.
1463  *
1464  * Revision 1.12 1999/03/03 13:26:06 joergr
1465  * Added method to invert an image by changing the presentation state LUT or
1466  * shape.
1467  * Moved method 'isBartenTransformPossible()' from presentation state class to
1468  * interface class.
1469  *
1470  * Revision 1.11 1999/03/02 13:01:02 joergr
1471  * Added method to presentation state class that checks whether Barten
1472  * transformation is possible or not.
1473  *
1474  * Revision 1.10 1999/02/25 18:40:08 joergr
1475  * Added method to fill pixel data into an externally handled storage area.
1476  *
1477  * Revision 1.9 1999/02/18 11:36:38 meichel
1478  * Added new method convertPValueToDDL() to DVPresentationState
1479  * that maps P-Values to DDLs.
1480  *
1481  * Revision 1.8 1999/02/17 10:05:32 meichel
1482  * Moved creation of Display Function object from DVPresentationState to
1483  * DVInterface to avoid unnecessary re-reads.
1484  *
1485  * Revision 1.7 1999/02/09 15:58:57 meichel
1486  * Implemented bitmap shutter activation amd method for
1487  * exchanging graphic layers.
1488  *
1489  * Revision 1.6 1999/02/05 17:45:36 meichel
1490  * Added config file entry for monitor characteristics file. Monitor charac-
1491  * teristics are passed to dcmimage if present to activate Barten transform.
1492  *
1493  * Revision 1.5 1999/01/15 17:33:05 meichel
1494  * added methods to DVPresentationState allowing to access the image
1495  * references in the presentation state. Also added methods allowing to
1496  * get the width and height of the attached image.
1497  *
1498  * Revision 1.4 1999/01/11 13:35:49 meichel
1499  * added new methods getImageAspectRatio, getImageMinMaxPixelRange and
1500  * getImageMinMaxPixelValue to class DVPresentationState.
1501  *
1502  * Revision 1.3 1998/12/22 17:57:07 meichel
1503  * Implemented Presentation State interface for overlays,
1504  * VOI LUTs, VOI windows, curves. Added test program that
1505  * allows to add curve data to DICOM images.
1506  *
1507  * Revision 1.2 1998/12/14 16:10:35 meichel
1508  * Implemented Presentation State interface for graphic layers,
1509  * text and graphic annotations, presentation LUTs.
1510  *
1511  * Revision 1.1 1998/11/27 14:50:34 meichel
1512  * Initial Release.
1513  *
1514  *
1515  */


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