34 #include "dcmtk/config/osconfig.h" 37 #include "dcmtk/ofstd/ofstream.h" 38 #include "dcmtk/dcmpstat/dvpscf.h" 39 #include "dcmtk/dcmpstat/dvpstat.h" 40 #include "dcmtk/dcmqrdb/dcmqridx.h" 41 #include "dcmtk/ofstd/ofstring.h" 42 #include "dcmtk/dcmpstat/dvcache.h" 70 DVInterface(
const char *config_file = NULL, OFBool useLog = OFFalse);
87 OFCondition loadImage(
const char *studyUID,
const char *seriesUID,
const char *instanceUID, OFBool changeStatus = OFFalse);
116 OFCondition loadPState(
const char *studyUID,
const char *seriesUID,
const char *instanceUID, OFBool changeStatus = OFFalse);
186 OFCondition savePState(
const char *filename, OFBool replaceSOPInstanceUID, OFBool explicitVR=OFTrue);
306 const char *
getFilename(
const char *studyUID,
const char *seriesUID,
const char *instanceUID);
809 return sendIOD(targetID, studyUID, NULL, NULL);
828 return sendIOD(targetID, studyUID, seriesUID, NULL);
848 OFCondition sendIOD(
const char *targetID,
const char *studyUID,
const char *seriesUID,
const char *instanceUID);
877 OFCondition dumpIOD(
const char *studyUID,
const char *seriesUID,
const char *instanceUID);
906 OFCondition checkIOD(
const char *studyUID,
const char *seriesUID,
const char *instanceUID);
926 const char *filename,
927 const void *pixelData,
929 unsigned long height,
930 double aspectRatio=1.0,
931 OFBool explicitVR=OFTrue,
932 const char *instanceUID=NULL);
949 const void *pixelData,
951 unsigned long height,
952 double aspectRatio=1.0);
972 const char *filename,
973 const void *pixelData,
975 unsigned long height,
976 double aspectRatio=1.0,
977 OFBool explicitVR=OFTrue,
978 const char *instanceUID=NULL);
995 const void *pixelData,
997 unsigned long height,
998 double aspectRatio=1.0);
1020 OFCondition loadStoredPrint(
const char *studyUID,
const char *seriesUID,
const char *instanceUID, OFBool changeStatus = OFFalse);
1042 const char *filename,
1043 OFBool writeRequestedImageSize,
1044 OFBool explicitVR=OFTrue,
1045 const char *instanceUID=NULL);
1709 int *oldpos = NULL);
1719 const char *seriesUID = NULL);
1724 const char *seriesUID = NULL,
1725 const char *instanceUID = NULL);
1730 const char *seriesUID = NULL,
1731 const char *instanceUID = NULL);
unsigned long minimumPrintBitmapWidth
minimum width of print bitmap (used for implicit scaling)
OFString printCurrentLUTID
config file identifier of LUT currently selected as Print Presentation LUT
OFCondition setPrinterPriority(const char *value)
sets the (optional) print priority.
const char * getPrintPresentationLUTID()
if the Stored Print object contains an active Presentation LUT that was set with selectPrintPresentat...
const char * getStudyDescription()
returns the Study Description of the currently selected study.
OFCondition startReceiver()
starts the network receiver processes (Storage Service Class SCPs).
OFCondition setPrinterMediumType(const char *value)
sets the (optional) print medium type.
const char * getCurrentPrinter()
gets the current printer's target ID.
const char * getInstanceDescription()
returns the escription of the currently selected instance.
OFString printerPriority
printer print priority, may be empty.
OFBool newInstancesReceived()
tests whether the database has been modified in any way since the last call to this method...
OFCondition startPrintSpooler()
starts the print spooler process.
DVStudyCache::ItemStruct * getStudyStruct(const char *studyUID=NULL, const char *seriesUID=NULL)
returns pointer to study struct specified by given UIDs or to current study
unsigned long maximumPreviewImageWidth
maximum width of (optional) preview image
const char * getPStateDescription(Uint32 idx)
returns description of specified presentation state referencing the currently selected image...
OFBool prependLighting
true if reflected ambient light and illumination should be prepended to annotation text ...
DicomImage * pHardcopyImage
pointer to the current hardcopy grayscale image (bitmap information only)
void disableImageAndPState()
disables internal settings for image and presentation state.
unsigned long maximumPrintPreviewHeight
maximum height of print preview bitmap
unsigned long getNumberOfUntrustworthySignatures(DVPSObjectType objtype) const
returns number of untrustworthy signatures for given object type.
const char * getStudyDate()
returns the Study Date of the currently selected study.
OFCondition setPrinterFilmSessionLabel(const char *value)
sets the (optional) printer film session label.
OFCondition dumpIOD(const char *filename)
creates a dump of the contents of a DICOM file and displays it on-screen.
OFBool getPrependPrinterName()
gets the current setting of the Prepend Printer Name annotation flag.
OFBool createPStateCache()
creates cache of referencing pstates for the current image
const char * getAccessionNumber()
returns the Accession Number of the currently selected study.
OFCondition addToPrintHardcopyFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID)
adds an existing DICOM image (should be Hardcopy Grayscale) that is already present in the image data...
OFCondition exchangeImageAndPState(DVPresentationState *newState, DcmFileFormat *image, DcmFileFormat *state=NULL)
helper function that exchanges the current presentation state and image by the pointers passed and fr...
OFCondition startExternalApplication(const char *application, const char *filename)
starts an external application and passes a filename.
OFBool imageInDatabase
OFTrue if current image is already stored in database, OFFalse otherwise.
OFCondition deleteStudy(const char *studyUID)
deletes the given study from the database.
OFCondition createPrintJobFilenames(const char *printer, OFString &tempname, OFString &jobname)
creates a new pair of filenames for print job creation.
unsigned long maximumPreviewImageHeight
maximum height of (optional) preview image
DVStudyCache idxCache
hierarchical cache structure to optimize index file access
OFCondition selectSeries(Uint32 idx)
selects the series with the given index within the currently selected study.
OFBool activateAnnotation
true if annotation should be created when spooling print job
this struct defines the structure of each "Study Record" in the index.dat file maintained by this mod...
unsigned long maximumPrintPreviewWidth
maximum width of print preview bitmap
const char * getPrinterPriority()
gets the (optional) print priority.
OFCondition loadReferencedImage(size_t idx, OFBool changeStatus=OFFalse)
loads an image which referenced by the current presentation state and needs to be contained in the da...
OFBool getPrependLighting()
gets the current setting of the Prepend Lighting annotation flag.
DVPSStoredPrint & getPrintHandler()
returns a reference to the print handler.
DVPresentationState * pState
pointer to the current presentation state object
OFCondition selectDisplayPresentationLUT(const char *lutID)
sets the LUT with the given identifier in the Presentation State as current Presentation LUT...
DVPresentationState * pStoredPState
pointer to the stored presentation state object (if any)
DVPSInstanceType getInstanceType()
returns the type of the currently selected instance.
OFBool prependDateTime
true if date and time should be prepended to annotation text
const char * getReferringPhysiciansName()
returns the Referring Physicians Name of the currently selected study.
OFString printerMediumType
printer medium type identifier, may be empty.
const char * getPresentationLabel()
returns the Presentation Label of the currently selected instance.
unsigned long getPrintPreviewSize()
gets number of bytes used for the print preview bitmap.
DcmFileFormat * pDicomImage
pointer to the current DICOM image attached to the presentation state
void setAnnotationText(const char *value)
sets the current annotation text.
OFBool getPrependDateTime()
gets the current setting of the Prepend Date/Time annotation flag.
a Grayscale Softcopy Presentation State.
OFCondition unlockExclusive()
removes an exlusive lock on the database if any.
DVInterface(const char *config_file=NULL, OFBool useLog=OFFalse)
constructor.
unsigned long getPrinterNumberOfCopies()
gets the (optional) print number of copies.
OFBool isActiveAnnotation()
gets the current setting of the annotation activity annotation flag.
const char * getStudyUID()
returns the Study Instance UID of the currently selected study.
OFCondition printSCUcreateBasicFilmSession(DVPSPrintMessageHandler &printHandler, OFBool plutInSession)
Initiates the creation of a DICOM Basic Film Session SOP Instance in the printer. ...
const char * getFilename()
returns the Filename of the currently selected instance.
OFCondition saveHardcopyGrayscaleImage(const char *filename, const void *pixelData, unsigned long width, unsigned long height, double aspectRatio=1.0, OFBool explicitVR=OFTrue, const char *instanceUID=NULL)
saves a monochrome bitmap as a DICOM Hardcopy Grayscale image.
Configuration class for the Softcopy Presentation State viewer.
OFString configPath
string containing the path name of the config file as passed to the ctor.
const char * getPrinterFilmDestination()
gets the (optional) printer film destination.
OFCondition spoolStoredPrintFromDB(const char *studyUID, const char *seriesUID, const char *instanceUID)
requests the spooler process to print an old print job that is stored in the database as a "stored pr...
OFCondition loadStoredPrint(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus=OFFalse)
loads a Stored Print object which is contained in the database into memory.
OFCondition loadStructuredReport(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus=OFFalse)
loads a structured report which is contained in the database.
const char * getPatientID()
returns the Patient ID of the currently selected study.
OFCondition verifyAndSignStructuredReport(const char *userID, const char *passwd, DVPSVerifyAndSignMode mode)
verifies and digitally signs the current structured report.
int findStudyIdx(StudyDescRecord *study, const char *uid)
returns index of specified study within study description record
DVSeriesCache::ItemStruct * getSeriesStruct(const char *studyUID=NULL, const char *seriesUID=NULL, const char *instanceUID=NULL)
returns pointer to series struct specified by given UIDs or to current series
unsigned long printJobCounter
a counter used for generating print job names.
const char * getSeriesUID()
returns the Series Instance UID of the currently selected series.
const char * getPatientSex()
returns the Patient Sex of the currently selected study.
OFCondition lockExclusive()
creates an exlusive lock on the database if none exists.
void setActiveAnnotation(OFBool value)
switches annotation printing on/off
OFCondition sendSeries(const char *targetID, const char *studyUID, const char *seriesUID)
sends a complete series over network to a different DICOM peer.
unsigned long getNumberOfCorrectSignatures(DVPSObjectType objtype) const
returns number of correct signatures for given object type.
OFCondition lockDatabase()
creates a database handle if none exists yet (this method may be called multiple times without interf...
DiDisplayFunction * displayFunction[DVPSD_max]
list of display function object
OFCondition setAmbientLightValue(double value)
sets ambient light value for the display transformation.
const char * getPatientBirthDate()
returns the Patient Birth Date of the currently selected study.
OFCondition terminatePrintSpooler()
terminates the print spooler process.
OFCondition enablePState()
restores the stored presentation state (see disablePresentationState) and deletes the temporary prese...
OFCondition selectPState(Uint32 idx, OFBool changeStatus=OFFalse)
selects and loads specified presentation state referencing the currently selected image...
OFBool createIndexCache()
creates index cache to optimize reading of index file
OFCondition deleteInstance(const char *studyUID, const char *seriesUID, const char *instanceUID)
deletes the given instance from the database.
OFCondition checkIOD(const char *filename)
checks the contents of a DICOM file and displays an evaluation report on the screen.
void clearFilmSessionSettings()
resets the settings for basic film session (everything that is not managed by the Stored Print object...
OFCondition startPrintServer()
starts the print server process (Basic Grayscale Print Management SCP).
const char * getPatientBirthTime()
returns the Patient Birth Time of the currently selected study.
const char * getCurrentSignatureValidationOverview() const
returns a string containing a complete HTML page with the signature validation overview.
OFString currentPrinter
target ID of current printer, empty if no printer exists in config file
DcmFileFormat * pDicomPState
pointer to the current DICOM dataset containing the loaded presentation state.
const char * getInstanceUID()
returns the SOP Instance UID of the currently selected instance.
DVPSInstanceType getSeriesType()
returns the type of all instances within the currently selected series.
OFCondition instanceReviewed(const char *studyUID, const char *seriesUID, const char *instanceUID)
modifies the review flag for one instance in the database, which is set to 'reviewed' state (DVIF_obj...
OFString printerFilmDestination
printer film destination identifier, may be empty.
const char * getPatientName()
returns the Patient Name of the currently selected study.
OFCondition setPrinterOwnerID(const char *value)
sets the (optional) print session owner ID.
const char * getImageNumber()
returns the Image Number of the currently selected instance.
OFCondition saveCurrentPStateForReset()
saves the current state of the presentation state object to be used for resetPresentationState().
OFString annotationText
annotation text (if any)
DVPSStoredPrint * pPrint
pointer to the current print handler object
virtual ~DVInterface()
destructor.
OFCondition selectStudy(Uint32 idx)
selects the study with the given index in the database.
const char * getPrinterFilmSessionLabel()
gets the (optional) printer film session label.
unsigned long minimumPrintBitmapHeight
minimum height of print bitmap (used for implicit scaling)
OFCondition loadPrintPreview(size_t idx, OFBool printLUT=OFTrue, OFBool changeStatus=OFFalse)
loads a Hardcopy Grayscale image registered by the stored print object and creates a preview...
int deleteImageFile(const char *filename)
conditionally deletes given image file (only if file resides in index.dat directory) ...
const char * getNameOfPhysiciansReadingStudy()
returns the Name Of Physicians Reading Study of the currently selected study.
OFCondition terminateQueryRetrieveServer()
terminates the query/retrieve server process (Query/Retrieve Service Class SCP).
the representation of a Stored Print object
const char * getSeriesPerformingPhysiciansName()
returns the Series Performing Physicians Name of the currently selected series.
OFCondition spoolPrintJob(OFBool deletePrintedImages=OFTrue)
start spooling of print job with current settings.
DSRDocument & getCurrentReport()
returns a reference to the current structured report.
Interface class for 'dcmsr' (DICOM Structured Reporting Documents).
const char * getPrinterMediumType()
gets the (optional) print medium type.
handler for all digital signature related functions in dcmpstat
Internal structure defining the list items.
unsigned long printerNumberOfCopies
printer number of copies
DVInterface & operator=(const DVInterface &)
private undefined assignment operator
OFCondition setPrinterFilmDestination(const char *value)
sets the (optional) printer film destination.
OFCondition selectPrintPresentationLUT(const char *lutID)
sets the LUT with the given identifier in the Stored Print object as current Presentation LUT...
This class maintains database handles based on the classical "index.dat" file.
OFCondition setPrinterNumberOfCopies(unsigned long value)
sets the (optional) print number of copies.
const char * getDisplayPresentationLUTID()
if the Presentation State contains an active Presentation LUT that was set with selectDisplayPresenta...
OFCondition saveStoredPrint(const char *filename, OFBool writeRequestedImageSize, OFBool explicitVR=OFTrue, const char *instanceUID=NULL)
saves the current print job as a Stored Print object.
OFString databaseIndexFile
string containing the path name of the database index file after a database lock has been acquired fo...
DVInstanceCache::ItemStruct * getInstanceStruct(const char *studyUID=NULL, const char *seriesUID=NULL, const char *instanceUID=NULL)
returns pointer to instance struct specified by given UIDs or to current instance ...
void clearIndexCache()
clears index cache (includes pstate cache)
DVIFhierarchyStatus getStudyStatus()
returns the review status of the currently selected study.
unsigned long getNumberOfCorruptSignatures(DVPSObjectType objtype) const
returns number of corrupt signatures for given object type.
A class to handle a study cache (list of items).
OFCondition loadImage(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus=OFFalse)
loads an image which is contained in the database and creates a default presentation state for the im...
OFCondition getPrintPreviewWidthHeight(unsigned long &width, unsigned long &height)
gets width and height of print preview bitmap.
Internal structure defining the list items.
const char * getSeriesProtocolName()
returns the Series Protocol Name of the currently selected series.
const char * getStudyTime()
returns the Study Time of the currently selected study.
OFCondition saveStructuredReport()
saves the current structured report in the same directory in which the database index file resides...
OFCondition sendStudy(const char *targetID, const char *studyUID)
sends a complete study over network to a different DICOM peer.
Uint32 getNumberOfInstances()
returns the number of instances (IODs) within the currently selected series.
OFCondition saveCurrentImage(const char *filename, OFBool explicitVR=OFTrue)
saves the DICOM image that is currently attached to the presentation state in a file with the given p...
OFBool isDisplayTransformPossible(DVPSDisplayTransform transform=DVPSD_GSDF)
checks whether display correction is possible (in principle), i.e.
OFString displayCurrentLUTID
config file identifier of LUT currently selected as Display Presentation LUT
const char * getSeriesOperatorsName()
returns the Series Operators Name of the currently selected series.
OFString printJobIdentifier
a unique string generated for each instance of this class.
const char * getSeriesDate()
returns the Series Date of the currently selected series.
OFCondition deleteSeries(const char *studyUID, const char *seriesUID)
deletes the given series from the database.
OFCondition disablePState()
stores the current presentation state in a temporary place and creates a new presentation state that ...
Class to handle hardcopy and softcopy device characteristics file and manage display LUTs (for calibr...
Uint32 getNumberOfStudies()
returns the number of studies currently contained in the database.
DVIFhierarchyStatus getSeriesStatus()
returns the review status of the currently selected series.
OFCondition selectInstance(Uint32 idx)
selects the instance with the given index within the currently selected series.
OFCondition loadPState(const char *studyUID, const char *seriesUID, const char *instanceUID, OFBool changeStatus=OFFalse)
loads a presentation state which is contained in the database.
IdxRecord idxRec
record structure of index items (last read entry)
OFCondition createQueryRetrieveServerConfigFile(const char *filename)
creates the query/retrieve server configuration file.
const char * getOtherPatientNames()
returns the Other Patient Names of the currently selected study.
void clearIndexRecord(IdxRecord &record, int &recpos)
clears specified index record (and makes pos invalid)
const char * getCurrentSignatureValidationHTML(DVPSObjectType objtype) const
returns a string containing a complete HTML page with the signature validation results for the last o...
OFCondition resetPresentationState()
resets the presentation state object to the status it had immediately after the last successful opera...
this class manages an instance entry of the index file.
OFCondition releaseDatabase()
removes any shared or exclusive lock on the database.
Interface class for dcmimgle/dcmimage module.
OFString printerFilmSessionLabel
printer film session label, may be empty.
const char * getSeriesTime()
returns the Series Time of the currently selected series.
void resetDatabaseReferenceTime()
resets index file modification time to reference time (yesterday)
const char * getPrinterOwnerID()
gets the (optional) print session owner ID.
void unloadPrintPreview()
removes a currently loaded Hardcopy Grayscale image from memory.
OFBool verifyUserPassword(const char *userID, const char *passwd)
verifies the given password for the given user ID.
const char * getOtherPatientID()
returns the Other Patient ID of the currently selected study.
Internal structure defining the list items.
void setPrependLighting(OFBool value)
sets the Prepend Lighting annotation flag.
DSRDocument * pReport
pointer to the current structured reporting object (should never be NULL)
a simple string class that implements a subset of std::string.
const char * getEthnicGroup()
returns the Patient Ethnic Group of the currently selected study.
DcmQueryRetrieveIndexDatabaseHandle * pHandle
handle to access database/index file
Uint32 getNumberOfSeries()
returns the number of series within the currently selected study.
OFCondition saveFileFormatToDB(DcmFileFormat &fileformat)
saves a DICOM object into a file in the same directory in which the database index file resides...
OFCondition terminatePrintServer()
terminates the print server process (Basic Grayscale Print Management SCP).
OFCondition startQueryRetrieveServer()
starts the query/retrieve server process (Query/Retrieve Service Class SCP).
unsigned long maximumPrintBitmapHeight
maximum height of print bitmap (used for implicit scaling)
size_t getNumberOfPrintPreviews()
gets the number of Hardcopy Grayscaleimages currently registered by the stored print object...
OFCondition terminateReceiver()
terminates the network receiver process (Storage Service Class SCP).
Uint32 getNumberOfPStates()
returns number of presentation states referencing the currently selected image.
const char * getSOPClassUID()
returns the SOP class UID of the currently selected instance.
unsigned long maximumPrintBitmapWidth
maximum width of print bitmap (used for implicit scaling)
const char * getModality()
returns the Modality of the currently selected series.
OFString printerOwnerID
printer film session owner ID, may be empty.
const char * getSeriesDescription()
returns the Series Description of the currently selected series.
void setPrependPrinterName(OFBool value)
sets the Prepend Printer Name annotation flag.
const char * c_str() const
returns a pointer to the initial element of an array of length size()+1 whose first size() elements e...
OFCondition sendIOD(const char *targetID, const char *studyUID, const char *seriesUID, const char *instanceUID)
sends a single instance (image or presentation state) over network to a different DICOM peer...
DVPSSignatureStatus getCombinedImagePStateSignatureStatus() const
returns the combined status flag for the current image and presentation state.
OFCondition addImageReferenceToPState(const char *studyUID, const char *seriesUID, const char *instanceUID)
adds an image which is contained in the database to the list of referenced images of the current pres...
OFCondition loadSRTemplate(const char *reportID)
loads a structured reporting "template".
void setMaxPrintPreviewWidthHeight(unsigned long width, unsigned long height)
sets the maximum print preview bitmap width and height.
DVPresentationState & getCurrentPState()
returns a reference to the current presentation state.
OFBool prependPrinterName
true if printer name should be prepended to annotation text
void setPrependDateTime(OFBool value)
sets the Prepend Date/Time annotation flag.
OFCondition getPrintPreviewBitmap(void *bitmap, unsigned long size)
writes the bitmap data of the print preview image into the given buffer.
DVSignatureHandler * pSignatureHandler
pointer to the handler object for digital signatures
const char * getSeriesNumber()
returns the Series Number of the currently selected series.
void updateStatusCache()
updates (hierarchical) status cache (propagates status information from instances to series and from ...
const char * getPStateLabel(Uint32 idx)
returns label of specified presentation state referencing the currently selected image.
OFBool lockingMode
locking mode (OFFalse => shared, OFTrue => exclusive)
DVPSSignatureStatus getCurrentSignatureStatus(DVPSObjectType objtype) const
returns the status flag for the current object of given type.
DVIFhierarchyStatus getInstanceStatus()
returns the review status of the currently selected instance.
OFCondition setCurrentPrinter(const char *targetID)
selects the current printer.
size_t getNumberOfImageReferences()
gets the number of image references contained in the current presentation state.
OFCondition savePState(OFBool replaceSOPInstanceUID)
saves the current presentation state in the same directory in which the database index file resides...
Interface class for the Softcopy Presentation State viewer.
const char * getAnnotationText()
gets the current annotation text.
OFCondition saveDICOMImage(const char *filename, const void *pixelData, unsigned long width, unsigned long height, double aspectRatio=1.0, OFBool explicitVR=OFTrue, const char *instanceUID=NULL)
saves a monochrome bitmap as a DICOM Secondary Capture image.
OFCondition getAmbientLightValue(double &value)
returns ambient light value for the display transformation.
General purpose class for condition codes.
int idxRecPos
position of last read index record (for optimization purposes)
unsigned long referenceTime
initialized with construction time of the interface object minus one day.
representation of an association used for DICOM Basic Grayscale Print.
OFBool readIndexRecord(const int pos, IdxRecord &record, int *oldpos=NULL)
reads specified index record (comparing pos with oldpos to avoid redundant loading) ...