⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dcmpstat.h

📁 转化为DIB位图再显示出来的dicom文件C++代码
💻 H
📖 第 1 页 / 共 3 页
字号:
/* * *  Copyright (C) 1998-2005, OFFIS * *  This software and supporting documentation were developed by * *    Kuratorium OFFIS e.V. *    Healthcare Information and Communication Systems *    Escherweg 2 *    D-26121 Oldenburg, Germany * *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER. * *  Module: dcmpstat * *  Author: Marco Eichelberg * *  Purpose: *    classes: DcmPresentationState * *  Last Update:      $Author: meichel $ *  Update Date:      $Date: 2005/12/08 16:03:29 $ *  CVS/RCS Revision: $Revision: 1.2 $ *  Status:           $State: Exp $ * *  CVS/RCS Log at end of file * */#ifndef DCMPSTAT_H__#define DCMPSTAT_H__#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */#include "dcmtk/dcmdata/dctk.h"#include "dcmtk/ofstd/ofstring.h"    /* for class OFString */#include "dcmtk/dcmpstat/dvpstyp.h"     /* for enum types */#include "dcmtk/dcmpstat/dvpsovl.h"     /* for DVPSOverlay_PList */#include "dcmtk/dcmpstat/dvpsgll.h"     /* for DVPSGraphicLayer_PList */#include "dcmtk/dcmpstat/dvpsrsl.h"     /* for DVPSReferencedSeries_PList */#include "dcmtk/dcmpstat/dvpsall.h"     /* for DVPSOverlayCurveActivationLayer_PList */#include "dcmtk/dcmpstat/dvpsgal.h"     /* for DVPSGraphicObject_PList */#include "dcmtk/dcmpstat/dvpscul.h"     /* for DVPSCurve_PList */#include "dcmtk/dcmpstat/dvpsvll.h"     /* for DVPSVOILUT_PList */#include "dcmtk/dcmpstat/dvpsvwl.h"     /* for DVPSVOIWindow_PList */#include "dcmtk/dcmpstat/dvpsdal.h"     /* for DVPSDisplayedArea_PList */#include "dcmtk/dcmpstat/dvpssvl.h"     /* for DVPSSoftcopyVOI_PList */#include "dcmtk/dcmpstat/dvpspl.h"      /* for DVPSPresentationLUT */class DVPSTextObject;class DVPSGraphicObject;class DVPSCurve;class DVPSDisplayedArea;class DVPSSoftcopyVOI;/** a Grayscale Softcopy Presentation State. *  This class manages the data structures comprising a Presentation State object. *  Presentation states can be created, read, written, and modified. */class DcmPresentationState{public:  /** default constructor   */  DcmPresentationState();  /// destructor  virtual ~DcmPresentationState();  /** reads a presentation state from a DICOM dataset.   *  The DICOM elements of the presentation state are copied   *  from the dataset to this object.   *  The completeness and correctness of the   *  presentation state (presence of all required elements,   *  value multiplicity) is checked.   *  If this method returns an error code, the object is in undefined state afterwards.   *  @param dset the dataset from which the presentation state is to be read   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition read(DcmItem &dset);  /** writes the presentation state managed by this object to a DICOM dataset.   *  Copies of the DICOM elements managed by this object are inserted into   *  the DICOM dataset.   *  @param dset the dataset to which the presentation state is written   *  @param replaceSOPInstanceUID flag indicating whether the   *    SOP Instance UID should be replaced by a new UID.   *    If true, a new UID is always generated. If false, a new   *    UID is generated only if no UID has been assigned before.   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition write(DcmItem &dset, OFBool replaceSOPInstanceUID);  /** generates a new SOP Instance UID for the Presentation State.   *  @return new SOP Instance UID if successfully set, NULL otherwise.   */  const char *createInstanceUID();  /** returns the current SOP Instance UID for the Presentation State.   *  @return SOP Instance UID if present, NULL otherwise.   */  const char *getInstanceUID();  /** returns the (currently hard-coded) SOP Class UID of the Presentation State.   *  @return SOP Class UID of the presentation state   */  const char *getSOPClassUID();  /** returns the patient ID of the presentation state   */  const char *getPatientID();  /** returns the Study Instance UID of the presentation state.   *  @return Study Instance UID if successful, NULL otherwise.   */  const char *getStudyUID();  /** adds a reference to an image to this presentation state.   *  This method checks if the given SOP class and Study UID match   *  for this presentation state and returns an error code otherwise.   *  @param studyUID the Study Instance UID of the image reference to be added.   *  @param seriesUID the Series Instance UID of the image reference to be added.   *  @param sopclassUID the SOP class UID of the image reference to be added.   *  @param instanceUID the SOP instance UID of the image reference to be added.   *  @param frames a list of frame numbers in DICOM IS format   *    (integer numbers separated by '\' characters). Default: frame numbers absent.   *    The frame numbers are required if the referenced image is a multiframe image.   *  @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent.   *  @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent.   *  @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent.   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition addImageReference(    const char *studyUID,    const char *seriesUID,    const char *sopclassUID,    const char *instanceUID,    const char *frames=NULL,    const char *aetitle=NULL,    const char *filesetID=NULL,    const char *filesetUID=NULL);  /** adds a reference to an image to this presentation state.   *  This method checks if the given SOP class and Study UID match   *  for this presentation state and returns an error code otherwise.   *  @param dset the DICOM dataset containing the image IOD   *  @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent.   *  @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent.   *  @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent.   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition addImageReference(    DcmItem &dset,    const char *aetitle=NULL,    const char *filesetID=NULL,    const char *filesetUID=NULL);  /** removes a reference to an image from this presentation state.   *  @param studyUID the Study Instance UID of the image reference to be removed.   *  @param seriesUID the Series Instance UID of the image reference to be removed.   *  @param instanceUID the SOP instance UID of the image reference to be removed.   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition removeImageReference(    const char *studyUID,    const char *seriesUID,    const char *instanceUID);  /** removes a reference to an image from this presentation state.   *  @param dset the DICOM dataset containing the image IOD   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition removeImageReference(DcmItem &dset);  /** gets the number of image references in all series managed by this list.   *  @return number of image references   */  size_t numberOfImageReferences();  /** gets an image reference with the given index.   *  @param idx index, must be < numberOfImageReferences().   *  @param studyUID the Study Instance UID is returned in this string   *  @param seriesUID the Series Instance UID is returned in this string   *  @param sopclassUID the SOP Class UID is returned in this string   *  @param instanceUID the SOP Instance UID is returned in this string   *  @param frames the list of frames is returned in this string   *  @param aetitle the series retrieveAETitle is returned in this string   *  @param filesetID the series storageMediaFileSetID is returned in this string   *  @param filesetUID the series storageMediaFileSetUID is returned in this string   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition getImageReference(    size_t idx,    OFString& studyUID,    OFString& seriesUID,    OFString& sopclassUID,    OFString& instanceUID,    OFString& frames,    OFString& aetitle,    OFString& filesetID,    OFString& filesetUID);  /** resets the object to initial state.   *  After this call, the object is in the same state as after   *  creation with the default constructor.   */  void clear();  /** creates a default presentation state for a DICOM image.   *  A number of flags specify how curves, overlays, VOI transformations,   *  a display shutter and a presentation LUT shape   *  should be treated when found in the image IOD.   *  If this method returns an error code, the object is in undefined state afterwards.   *  @param dset the DICOM dataset containing the image IOD   *  @param overlayActivation flag defining how overlays should be handled   *    (copied, activated or ignored). Default: Copy overlays.   *  @param voiActivation flag defining how VOI LUTs or VOI window width/center should   *    be handled. Default: Use VOI and prefer VOI LUT from VOI window.   *  @param curveActivation flag defining whether curves in the image should   *    be activated. Default: Activate curves.   *  @param shutterActivation flag defining whether a shutter (not bitmap shutter)   *    should be copied to the presentation state when found in the image.   *    Default: Copy shutter.   *  @param presentationActivation flag defining whether a presentation LUT shape   *    should be copied to the presentation state when found in the image.   *    Default: Copy presentation LUT shape.   *  @param layering flag defining how graphic layers should be created for   *    activated overlays and curves. Default: Create one layer for all overlays   *    and another layer for all curves.   *  @param aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent.   *  @param filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent.   *  @param filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent.   *  @return EC_Normal upon success, an error code otherwise.   */  OFCondition createFromImage(DcmItem &dset,    DVPSoverlayActivation overlayActivation      = DVPSO_copyOverlays,    DVPSVOIActivation     voiActivation          = DVPSV_preferVOILUT,    OFBool                curveActivation        = OFTrue,    OFBool                shutterActivation      = OFTrue,    OFBool                presentationActivation = OFTrue,    DVPSGraphicLayering   layering               = DVPSG_twoLayers,    const char *          aetitle                = NULL,    const char *          filesetID              = NULL,    const char *          filesetUID             = NULL);  /* Presentation LUT Interface */  /** gets the current Presentation LUT type.   *  @return the current presentation LUT type   */  DVPSPresentationLUTType getPresentationLUT() { return presentationLUT.getType(); }  /** checks if a real Presentation LUT (not shape)   *  is available in the presentation state.   *  @return OFTrue if the presentation state contains   *    a presentation LUT, no matter if it is activated or not.   *    Returns OFFalse otherwise.   */  OFBool havePresentationLookupTable() { return presentationLUT.haveTable(); }  /** gets a description of the current presentation LUT.   *  For well-known presentation LUT shapes, a standard text   *  is returned. For presentation LUTs, the LUT explanation   *  is returned if it exists and a standard text otherwise.   *  This method never returns NULL.   *  @return a pointer to a string describing the current presentation LUT.   */  const char *getCurrentPresentationLUTExplanation() { return presentationLUT.getCurrentExplanation(); }  /** returns the LUT explanation of the presentation LUT   *  if it exists and is non-empty.   *  Otherwise returns NULL.   *  @return a string pointer   */  const char *getPresentationLUTExplanation() { return presentationLUT.getLUTExplanation(); }  /** gets the current Presentation LUT object.   *  @return the current presentation LUT object   */  DVPSPresentationLUT *getPresentationLUTData() { return &presentationLUT; }  /* Rotate/Flip Interface */  /** gets the current rotation status of the presentation state.   *  @return the current rotation status   */  DVPSRotationType getRotation();  /** gets the current horizontal flip status of the presentation state.   *  @return OFTrue if flip is on, OFFalse if flip is off.   */  OFBool getFlip();  /** sets rotation status of the presentation state.   *  @param rotation the rotation to be set   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition setRotation(DVPSRotationType rotation);  /** sets horizontal flip status of the presentation state.   *  @param isFlipped the flip status, OFTrue for on, OFFalse for off.   *  @return EC_Normal if successful, an error code otherwise.   */  OFCondition setFlip(OFBool isFlipped);  /* VOI Transform Interface */  /* Displayed Area Interface */  /* shutter Interface */  /** checks if a display shutter of given type is active.   *  @param type the shutter type   *  @return OFTrue if this type of shutter is currently active.   */  OFBool haveShutter(DVPSShutterType type);  /* rectangular shutter Interface */  /** gets rectangular shutter left vertical edge.   *  May only be called if a rectangular shutter is active.   *  @return the rect shutter LV edge.   */  Sint32 getRectShutterLV();  /** gets rectangular shutter right vertical edge.   *  May only be called if a rectangular shutter is active.   *  @return the rect shutter RV edge.   */  Sint32 getRectShutterRV();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -