📄 dvpstat.h
字号:
/* * * 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: DVPresentationState * * Last Update: $Author: meichel $ * Update Date: $Date: 2005/12/08 16:04:07 $ * CVS/RCS Revision: $Revision: 1.44 $ * Status: $State: Exp $ * * CVS/RCS Log at end of file * */#ifndef __DVPSTAT_H__#define __DVPSTAT_H__#include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */#include "dcmtk/dcmpstat/dcmpstat.h"class DicomImage;class DiDisplayFunction;/** 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 DVPresentationState: public DcmPresentationState{public: /** default constructor * @param displayFunction list of objects describing the display * characteristics of the monitor. Used to implement the standard display function. * The parameter should be an array with DVPSD_max entries (see DVInterface). * If absent, no display transform is performed. * @param minPrintBitmapX default value for minimum print bitmap size X * @param minPrintBitmapY default value for minimum print bitmap size Y * @param maxPrintBitmapX default value for maximum print bitmap size X * @param maxPrintBitmapY default value for maximum print bitmap size Y * @param maxPreviewImageX default value for maximum preview image size X * @param maxPreviewImageY default value for maximum preview image size Y */ DVPresentationState( DiDisplayFunction **dispFunction=NULL, unsigned long minPrintBitmapX=0, unsigned long minPrintBitmapY=0, unsigned long maxPrintBitmapX=0, unsigned long maxPrintBitmapY=0, unsigned long maxPreviewImageX=0, unsigned long maxPreviewImageY=0); /// destructor virtual ~DVPresentationState(); /** 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(); /** 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); /** 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); /** adds a reference to the currently attached image to this * presentation state. This method checks if the given image * is not yet referenced and if its Study UID and SOP class * match for this presentation state and returns an error code otherwise. * @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 addImageReferenceAttached( const char *aetitle=NULL, const char *filesetID=NULL, const char *filesetUID=NULL); /** removes a reference to the currently attached image from this presentation state. * @return EC_Normal if successful, an error code otherwise. */ OFCondition removeImageReferenceAttached(); /** sets the current Presentation LUT type. * DVPSP_table can only be used if the presentation state * contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue. * @param newType the new presentation LUT type. * @return EC_Normal if successful, an error code otherwise. */ OFCondition setCurrentPresentationLUT(DVPSPresentationLUTType newType); /** resets the Presentation LUT to the default LUT shape * which is DVPSP_identity for MONOCHROME2 images and DVPSP_inverse for MONOCHROME1. * DVPSP_table can only be used if the presentation state * contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue. * @return EC_Normal if successful, an error code otherwise. */ OFCondition setDefaultPresentationLUTShape(); /** stores a presentation lookup table in the presentation state. * This method stores a presentation lookup table in the * presentation state and activates it. The LUT is copied to * the presentation state. If the method returns EC_Normal, * any old presentation LUT in the presentation state is overwritten. * This method keeps the inverse/not inverse status intact, * i.e. inverses the LUT if necessary. * @param lutDescriptor the LUT Descriptor in DICOM format (VM=3) * @param lutData the LUT Data in DICOM format * @param lutExplanation the LUT Explanation in DICOM format, may be empty. * @return EC_Normal if successful, an error code otherwise. */ OFCondition setPresentationLookupTable( DcmUnsignedShort& lutDescriptor, DcmUnsignedShort& lutData, DcmLongString& lutExplanation); /** stores a presentation lookup table in the presentation state. * This method stores a presentation lookup table in the * presentation state and activates it. The LUT is copied to * the presentation state. Overwrites old LUT. If unsuccessful, * LUT is set to DVPSP_identity. * This method keeps the inverse/not inverse status intact, * i.e. inverses the LUT if necessary. * @param dset dataset from which the Presentation LUT SQ or Shape is read. * @return EC_Normal if successful, an error code otherwise. */ OFCondition setPresentationLookupTable(DcmItem &dset); /** writes the current Presentation LUT to a DICOM dataset. * Copies of the DICOM element managed by this object are inserted into * the DICOM dataset. In the case of a MONOCHROME1 image an inverted * LUT is written to dataset because the print bitmap is always MONOCHROME2. * @param dset the dataset to which the Presentation LUT SQ/Shape is written * @return EC_Normal if successful, an error code otherwise. */ OFCondition writePresentationLUTforPrint(DcmItem &dset); /** checks whether the attached image is MONOCHROME1. In this case, the * presentation LUT must be reversed when applied to the print bitmap * which is always MONOCHROME2. * @return OFTrue if attached image is MONOCHROME1, OFFalse otherwise. */ OFBool isMonochrome1Image() { return currentImageMonochrome1; } /** check if a VOI window is currently active * @return OFTrue if a VOI window is active */ OFBool haveActiveVOIWindow(); /** check if a VOI LUT is currently active * @return OFTrue if a VOI LUT is active */ OFBool haveActiveVOILUT(); /** returns a description string for a currently active VOI transform. * If no description is available, NULL is returned. * @return a pointer to a string or NULL. */ const char *getCurrentVOIDescription(); /** gets the width of the current VOI window. * May only be called if haveActiveVOIWindow() is OFTrue. * @param w the window width is returned in this parameter * @return EC_Normal upon success, an error code otherwise. */ OFCondition getCurrentWindowWidth(double &w); /** get the center of the current VOI window. * May only be called if haveActiveVOIWindow() is OFTrue. * @param c the window center is returned in this parameter * @return EC_Normal upon success, an error code otherwise. */ OFCondition getCurrentWindowCenter(double &c); /** gets the number of VOI LUTs available in the attached image. */ size_t getNumberOfVOILUTsInImage(); /** gets the number of VOI Windows available in the attached image. */ size_t getNumberOfVOIWindowsInImage(); /** returns a description string for the given VOI LUT in the attached * image. * If no description for the given index is available, NULL is returned. * @param idx index, must be < getNumberOfVOILUTsInImage() * @return a pointer to a string or NULL. */ const char *getDescriptionOfVOILUTsInImage(size_t idx); /** returns a description string for the given VOI Window
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -