dcmpstat.h

00001 /*
00002  *
00003  *  Copyright (C) 1998-2005, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module: dcmpstat
00019  *
00020  *  Author: Marco Eichelberg
00021  *
00022  *  Purpose:
00023  *    classes: DcmPresentationState
00024  *
00025  *  Last Update:      $Author: meichel $
00026  *  Update Date:      $Date: 2005/12/08 16:03:29 $
00027  *  CVS/RCS Revision: $Revision: 1.2 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef DCMPSTAT_H__
00035 #define DCMPSTAT_H__
00036 
00037 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00038 #include "dcmtk/dcmdata/dctk.h"
00039 
00040 #include "dcmtk/ofstd/ofstring.h"    /* for class OFString */
00041 #include "dcmtk/dcmpstat/dvpstyp.h"     /* for enum types */
00042 #include "dcmtk/dcmpstat/dvpsovl.h"     /* for DVPSOverlay_PList */
00043 #include "dcmtk/dcmpstat/dvpsgll.h"     /* for DVPSGraphicLayer_PList */
00044 #include "dcmtk/dcmpstat/dvpsrsl.h"     /* for DVPSReferencedSeries_PList */
00045 #include "dcmtk/dcmpstat/dvpsall.h"     /* for DVPSOverlayCurveActivationLayer_PList */
00046 #include "dcmtk/dcmpstat/dvpsgal.h"     /* for DVPSGraphicObject_PList */
00047 #include "dcmtk/dcmpstat/dvpscul.h"     /* for DVPSCurve_PList */
00048 #include "dcmtk/dcmpstat/dvpsvll.h"     /* for DVPSVOILUT_PList */
00049 #include "dcmtk/dcmpstat/dvpsvwl.h"     /* for DVPSVOIWindow_PList */
00050 #include "dcmtk/dcmpstat/dvpsdal.h"     /* for DVPSDisplayedArea_PList */
00051 #include "dcmtk/dcmpstat/dvpssvl.h"     /* for DVPSSoftcopyVOI_PList */
00052 #include "dcmtk/dcmpstat/dvpspl.h"      /* for DVPSPresentationLUT */
00053 
00054 class DVPSTextObject;
00055 class DVPSGraphicObject;
00056 class DVPSCurve;
00057 class DVPSDisplayedArea;
00058 class DVPSSoftcopyVOI;
00059 
00065 class DcmPresentationState
00066 {
00067 public:
00070   DcmPresentationState();
00071 
00073   virtual ~DcmPresentationState();
00074 
00085   OFCondition read(DcmItem &dset);
00086 
00097   OFCondition write(DcmItem &dset, OFBool replaceSOPInstanceUID);
00098 
00102   const char *createInstanceUID();
00103 
00107   const char *getInstanceUID();
00108 
00112   const char *getSOPClassUID();
00113 
00116   const char *getPatientID();
00117 
00121   const char *getStudyUID();
00122 
00138   OFCondition addImageReference(
00139     const char *studyUID,
00140     const char *seriesUID,
00141     const char *sopclassUID,
00142     const char *instanceUID,
00143     const char *frames=NULL,
00144     const char *aetitle=NULL,
00145     const char *filesetID=NULL,
00146     const char *filesetUID=NULL);
00147 
00157   OFCondition addImageReference(
00158     DcmItem &dset,
00159     const char *aetitle=NULL,
00160     const char *filesetID=NULL,
00161     const char *filesetUID=NULL);
00162 
00169   OFCondition removeImageReference(
00170     const char *studyUID,
00171     const char *seriesUID,
00172     const char *instanceUID);
00173 
00178   OFCondition removeImageReference(DcmItem &dset);
00179 
00183   size_t numberOfImageReferences();
00184 
00197   OFCondition getImageReference(
00198     size_t idx,
00199     OFString& studyUID,
00200     OFString& seriesUID,
00201     OFString& sopclassUID,
00202     OFString& instanceUID,
00203     OFString& frames,
00204     OFString& aetitle,
00205     OFString& filesetID,
00206     OFString& filesetUID);
00207 
00208 
00213   void clear();
00214 
00241   OFCondition createFromImage(DcmItem &dset,
00242     DVPSoverlayActivation overlayActivation      = DVPSO_copyOverlays,
00243     DVPSVOIActivation     voiActivation          = DVPSV_preferVOILUT,
00244     OFBool                curveActivation        = OFTrue,
00245     OFBool                shutterActivation      = OFTrue,
00246     OFBool                presentationActivation = OFTrue,
00247     DVPSGraphicLayering   layering               = DVPSG_twoLayers,
00248     const char *          aetitle                = NULL,
00249     const char *          filesetID              = NULL,
00250     const char *          filesetUID             = NULL);
00251 
00252 
00253   /* Presentation LUT Interface */
00254 
00258   DVPSPresentationLUTType getPresentationLUT() { return presentationLUT.getType(); }
00259 
00266   OFBool havePresentationLookupTable() { return presentationLUT.haveTable(); }
00267 
00275   const char *getCurrentPresentationLUTExplanation() { return presentationLUT.getCurrentExplanation(); }
00276 
00282   const char *getPresentationLUTExplanation() { return presentationLUT.getLUTExplanation(); }
00283 
00287   DVPSPresentationLUT *getPresentationLUTData() { return &presentationLUT; }
00288 
00289   /* Rotate/Flip Interface */
00290 
00294   DVPSRotationType getRotation();
00295 
00299   OFBool getFlip();
00300 
00305   OFCondition setRotation(DVPSRotationType rotation);
00306 
00311   OFCondition setFlip(OFBool isFlipped);
00312 
00313 
00314   /* VOI Transform Interface */
00315 
00316   /* Displayed Area Interface */
00317 
00318 
00319   /* shutter Interface */
00320 
00325   OFBool haveShutter(DVPSShutterType type);
00326 
00327   /* rectangular shutter Interface */
00328 
00333   Sint32 getRectShutterLV();
00334 
00339   Sint32 getRectShutterRV();
00340 
00345   Sint32 getRectShutterUH();
00346 
00351   Sint32 getRectShutterLH();
00352 
00353 
00354   /* circular shutter Interface */
00355 
00360   Sint32 getCenterOfCircularShutter_x();
00361 
00366   Sint32 getCenterOfCircularShutter_y();
00367 
00378   Sint32 getRadiusOfCircularShutter();
00379 
00380   /* polygonal shutter Interface */
00381 
00386   size_t getNumberOfPolyShutterVertices();
00387 
00397   OFCondition getPolyShutterVertex(size_t idx, Sint32& x, Sint32& y);
00398 
00407   OFCondition setPolyShutterOrigin(Sint32 x, Sint32 y);
00408 
00409   /* bitmap shutter Interface
00410    *
00411    * see methods:
00412    *    overlayIsBitmapShutter(),
00413    *    overlayIsSuitableAsBitmapShutter(),
00414    *    activateOverlayAsBitmapShutter()
00415    * in overlay interface definitions.
00416    */
00417 
00418   /* shutter presentation value Interface */
00419 
00424   Uint16 getShutterPresentationValue();
00425 
00430   OFCondition setShutterPresentationValue(Uint16 pvalue);
00431 
00432   /* Presentation State Label, Description and Name Interface */
00433 
00438   const char *getPresentationLabel();
00439 
00444   const char *getPresentationDescription();
00445 
00450   const char *getPresentationCreatorsName();
00451 
00458   OFCondition setPresentationLabel(const char *label);
00459 
00466   OFCondition setPresentationDescription(const char *descr);
00467 
00474   OFCondition setPresentationCreatorsName(const char *name);
00475 
00476   /* specific character set */
00477 
00482   OFCondition setCharset(DVPScharacterSet charset);
00483 
00487   DVPScharacterSet getCharset();
00488 
00492   const char *getCharsetString();
00493 
00494   /* graphic layers */
00495 
00504   void sortGraphicLayers();
00505 
00509   size_t getNumberOfGraphicLayers();
00510 
00517   const char *getGraphicLayerName(size_t idx);
00518 
00525   size_t getGraphicLayerIndex(const char *name);
00526 
00527 
00534   const char *getGraphicLayerDescription(size_t idx);
00535 
00540   OFBool haveGraphicLayerRecommendedDisplayValue(size_t idx);
00541 
00550   OFCondition getGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16& gray);
00551 
00561   OFCondition getGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16& r, Uint16& g, Uint16& b);
00562 
00570   OFCondition setGraphicLayerRecommendedDisplayValueGray(size_t idx, Uint16 gray);
00571 
00581   OFCondition setGraphicLayerRecommendedDisplayValueRGB(size_t idx, Uint16 r, Uint16 g, Uint16 b);
00582 
00587   void removeGraphicLayerRecommendedDisplayValue(size_t idx, OFBool rgb, OFBool monochrome);
00588 
00598   OFCondition setGraphicLayerName(size_t idx, const char *name);
00599 
00605   OFCondition setGraphicLayerDescription(size_t idx, const char *descr);
00606 
00616   OFCondition toFrontGraphicLayer(size_t idx);
00617 
00626   OFCondition toBackGraphicLayer(size_t idx);
00627 
00635   OFCondition exchangeGraphicLayers(size_t idx1, size_t idx2);
00636 
00646   OFCondition addGraphicLayer(
00647      const char *gLayer,
00648      const char *gLayerDescription=NULL);
00649 
00650 
00651   /* text objects */
00652 
00653   /* graphic objects */
00654 
00655   /* curves */
00656 
00662   size_t getNumberOfCurves(size_t layer);
00663 
00670   OFCondition removeCurve(size_t layer, size_t idx);
00671 
00681   OFCondition moveCurve(size_t old_layer, size_t idx, size_t new_layer);
00682 
00683 
00684   /* overlays */
00685 
00691   size_t getNumberOfActiveOverlays(size_t layer);
00692 
00698   Uint16 getActiveOverlayGroup(size_t layer, size_t idx);
00699 
00704   size_t getNumberOfOverlaysInPresentationState();
00705 
00710   Uint16 getOverlayInPresentationStateGroup(size_t idx);
00711 
00716   const char *getOverlayInPresentationStateLabel(size_t idx);
00717 
00722   const char *getOverlayInPresentationStateDescription(size_t idx);
00723 
00731   size_t getOverlayInPresentationStateActivationLayer(size_t idx);
00732 
00738   OFBool overlayIsBitmapShutter(size_t idx);
00739 
00745   OFBool overlayInPresentationStateIsROI(size_t idx);
00746 
00756   OFCondition moveOverlay(size_t old_layer, size_t idx, size_t new_layer);
00757 
00758   /* attached image */
00759 
00760    /* Display transform */
00761 
00762   /* print related methods */
00763 
00769   void setLog(OFConsole *stream, OFBool verbMode, OFBool dbgMode);
00770 
00771 private:
00772 
00775   DcmPresentationState(const DcmPresentationState& copy);
00776 
00779   DcmPresentationState& operator=(const DcmPresentationState& obj);
00780 
00790   OFCondition createDummyValues(OFBool replaceSOPInstanceUID);
00791 
00797   void cleanupLayers();
00798 
00799 protected:
00800 
00806   OFCondition createDefaultDisplayedArea(DcmItem &dset);
00807 
00808   /* Module: Patient (M)
00809    */
00811   DcmPersonName            patientName;
00813   DcmLongString            patientID;
00815   DcmDate                  patientBirthDate;
00817   DcmCodeString            patientSex;
00818 
00819   /* Module: General Study (M)
00820    */
00822   DcmUniqueIdentifier      studyInstanceUID;
00824   DcmDate                  studyDate;
00826   DcmTime                  studyTime;
00828   DcmPersonName            referringPhysiciansName;
00830   DcmShortString           studyID;
00832   DcmShortString           accessionNumber;
00833 
00834   /* Module: General Series (M)
00835    */
00837   DcmUniqueIdentifier      seriesInstanceUID;
00839   DcmIntegerString         seriesNumber;
00840 
00841   /* Module: Presentation Series (M) - specializes general series
00842    */
00843   // modality; see General Series
00844 
00845   /* Module: General Equipment (M)
00846    */
00848   DcmLongString            manufacturer;
00849 
00850   /* Module: Displayed Area (M)
00851    */
00852   DVPSDisplayedArea_PList  displayedAreaSelectionList;
00853 
00854   /* Module: Softcopy Presentation LUT (M)
00855    * There must never be more that one Presentation LUT for one Presentation State,
00856    * therefore we need not save a list of LUTs.
00857    */
00858   DVPSPresentationLUT      presentationLUT;
00859 
00860   /* Module: Presentation State (M)
00861    * specializes mask and display shutter
00862    */
00864   DcmIntegerString         imageNumber;
00866   DcmCodeString            presentationLabel;
00868   DcmLongString            presentationDescription;
00870   DcmDate                  presentationCreationDate;
00872   DcmTime                  presentationCreationTime;
00874   DcmPersonName            presentationCreatorsName;
00876   DVPSReferencedSeries_PList referencedSeriesList;
00877   // shutterPresentationValue; Type 1c. See Display Shutter module
00878 
00879   /* Module: SOP Common (M)
00880    * we don't store the SOP Class UID because it is well known.
00881    */
00883   DcmUniqueIdentifier      sOPInstanceUID;
00885   DcmCodeString            specificCharacterSet;
00887   DcmDate                  instanceCreationDate;
00889   DcmTime                  instanceCreationTime;
00891   DcmUniqueIdentifier      instanceCreatorUID;
00892 
00893   /* Module: Display Shutter (C)
00894    * "required if display shutter to be applied and BitmapDispShutter not present"
00895    */
00897   OFBool                   useShutterRectangular;
00899   OFBool                   useShutterCircular;
00901   OFBool                   useShutterPolygonal;
00903   OFBool                   useShutterBitmap;
00905   DcmCodeString            shutterShape;
00907   DcmIntegerString         shutterLeftVerticalEdge;
00909   DcmIntegerString         shutterRightVerticalEdge;
00911   DcmIntegerString         shutterUpperHorizontalEdge;
00913   DcmIntegerString         shutterLowerHorizontalEdge;
00915   DcmIntegerString         centerOfCircularShutter;
00917   DcmIntegerString         radiusOfCircularShutter;
00919   DcmIntegerString         verticesOfThePolygonalShutter;
00921   DcmUnsignedShort         shutterPresentationValue;
00922 
00923   /* Module: Bitmap Display Shutter (C)
00924    * "required if display shutter to be applied and DispShutter not present"
00925    */
00927   DcmUnsignedShort         shutterOverlayGroup;
00928   // shutterPresentationValue already defined in Display Shutter module
00929   // shutterShape already defined in Display Shutter module
00930 
00931   /* Module: Overlay Plane (C)
00932    * "required if overlay to be applied or BitmapDispShutter present"
00933    */
00935   DVPSOverlay_PList        overlayList;
00936 
00937   /* Module: Overlay/Curve Activation (C)
00938    * "required if ref. image contains overlay or curve to be displayed"
00939    */
00941   DVPSOverlayCurveActivationLayer_PList activationLayerList;
00942 
00943   /* Module: Graphic Annotation (C)
00944    * "required if graphical annotation to be applied"
00945    */
00947   DVPSGraphicAnnotation_PList graphicAnnotationList;
00948 
00949   /* Module: Spatial Transformation (C)
00950    * "required if rotation/flipping/magnification to be applied"
00951    */
00953   DcmUnsignedShort         imageRotation;
00955   DcmCodeString            imageHorizontalFlip;
00956 
00957   /* Module: Graphic Layer (C)
00958    * "required if graphic annotation, overlays or curves to be applied"
00959    */
00961   DVPSGraphicLayer_PList graphicLayerList;
00962 
00963   /* Module: Modality LUT (C)
00964    * "required if modality LUT to be applied"
00965    * There must never be more that one Modality LUT for one Presentation State,
00966    * therefore we need not save a list of LUTs.
00967    */
00969   OFBool                   useModalityRescale;
00971   OFBool                   useModalityLUT;
00973   DcmUnsignedShort         modalityLUTDescriptor;
00975   DcmLongString            modalityLUTExplanation;
00977   DcmLongString            modalityLUTType;
00979   DcmUnsignedShort         modalityLUTData;
00981   DcmDecimalString         rescaleIntercept;
00983   DcmDecimalString         rescaleSlope;
00985   DcmLongString            rescaleType;
00986 
00987   /* Module: Softcopy VOI LUT (C)
00988    * "required if VOI LUT to be applied"
00989    */
00990   DVPSSoftcopyVOI_PList    softcopyVOIList;
00991 
00994   OFConsole *logstream;
00995 
00998   OFBool verboseMode;
00999 
01002   OFBool debugMode;
01003 
01004 };
01005 
01006 #endif
01007 
01008 /*
01009  *  $Log: dcmpstat.h,v $
01010  *  Revision 1.2  2005/12/08 16:03:29  meichel
01011  *  Changed include path schema for all DCMTK header files
01012  *
01013  *  Revision 1.1  2003/08/27 14:57:19  meichel
01014  *  Splitted class DVPresentationState into a base class DcmPresentationState
01015  *    that does not depend on module dcmimgle and current derived class with
01016  *    public API identical to the previous version.
01017  *
01018  *
01019  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5