00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
#ifndef DVPSSP_H
00036
#define DVPSSP_H
00037
00038
#include "osconfig.h"
00039
00040
#include "ofstream.h"
00041
#include "ofstring.h"
00042
#include "dctk.h"
00043
#include "dvpstyp.h"
00044
#include "dvpspll.h"
00045
#include "dvpsibl.h"
00046
#include "dvpsabl.h"
00047
#include "dvpstat.h"
00048
#include "dvpspr.h"
00049
00050
class DicomImage;
00051
class DVPSPresentationLUT;
00052
class DVConfiguration;
00056 class DVPSStoredPrint
00057 {
00058
public:
00064
DVPSStoredPrint(Uint16 illumin, Uint16 reflection,
const char *aetitle = NULL);
00065
00067
DVPSStoredPrint(
const DVPSStoredPrint& copy);
00068
00073 DVPSStoredPrint *
clone() {
return new DVPSStoredPrint(*
this); }
00074
00076
virtual ~DVPSStoredPrint();
00077
00082
void clear();
00083
00093
OFCondition read(
DcmItem &dset);
00094
00111
OFCondition write(
00112
DcmItem &dset,
00113 OFBool writeRequestedImageSize,
00114 OFBool limitImages,
00115 OFBool updateDecimateCrop,
00116 OFBool ignoreEmptyImages);
00117
00122
OFCondition setOriginator(
const char *aetitle);
00123
00127
OFCondition setDestination(
const char *aetitle);
00128
00132
OFCondition setPrinterName(
const char *name);
00133
00141
OFCondition setImageDisplayFormat(
unsigned long columns,
unsigned long rows);
00142
00149
OFCondition setFilmSizeID(
const char *value);
00150
00157
OFCondition setMagnificationType(
const char *value);
00158
00165
OFCondition setSmoothingType(
const char *value);
00166
00173
OFCondition setConfigurationInformation(
const char *value);
00174
00181
OFCondition setResolutionID(
const char *value);
00182
00189
OFCondition setFilmOrientation(DVPSFilmOrientation value);
00190
00197
OFCondition setTrim(DVPSTrimMode value);
00198
00206
OFCondition setRequestedDecimateCropBehaviour(DVPSDecimateCropBehaviour value);
00207
00214
OFCondition setBorderDensity(
const char *value);
00215
00222
OFCondition setEmtpyImageDensity(
const char *value);
00223
00230
OFCondition setMaxDensity(
const char *value);
00231
00238
OFCondition setMinDensity(
const char *value);
00239
00250
OFCondition newPrinter(
const char *name = NULL,
const char *destinationAE = NULL);
00251
00255
const char *
getOriginator();
00259
const char *
getDestination();
00263
const char *
getPrinterName();
00264
00268
unsigned long getImageDisplayFormatColumns();
00269
00273
unsigned long getImageDisplayFormatRows();
00274
00278 DVPSFilmOrientation
getFilmOrientation();
00279
00283 DVPSTrimMode
getTrim();
00284
00289 DVPSDecimateCropBehaviour
getRequestedDecimateCropBehaviour()
00290 {
00291
return decimateCropBehaviour;
00292 }
00293
00297
const char *
getStudyInstanceUID();
00298
00302
const char *
getSeriesInstanceUID();
00303
00307
const char *
getSOPInstanceUID();
00308
00312
const char *
getFilmSizeID();
00313
00317
const char *
getMagnificationType();
00318
00322
const char *
getSmoothingType();
00323
00327
const char *
getConfigurationInformation();
00328
00332
const char *
getResolutionID();
00333
00337
const char *
getBorderDensity();
00338
00342
const char *
getEmtpyImageDensity();
00343
00349
const char *
getMaxDensity();
00350
00356
const char *
getMinDensity();
00357
00361 Uint16
getMaxDensityValue();
00362
00366 Uint16
getMinDensityValue();
00367
00371 size_t
getNumberOfImages()
00372 {
00373
return imageBoxContentList.
size();
00374 }
00375
00379 size_t
getNumberOfAnnotations()
00380 {
00381
return annotationContentList.
size();
00382 }
00383
00388
OFCondition deleteImage(size_t idx);
00389
00395
OFCondition deleteMultipleImages(size_t number);
00396
00403
OFCondition deleteSpooledImages();
00404
00410 OFBool
imageHasAdditionalSettings(size_t idx)
00411 {
00412
return imageBoxContentList.
imageHasAdditionalSettings(idx);
00413 }
00414
00420 OFCondition setImagePolarity(size_t idx,
const char *value)
00421 {
00422
return imageBoxContentList.
setImagePolarity(idx, value);
00423 }
00424
00430 OFCondition setImageRequestedSize(size_t idx,
const char *value)
00431 {
00432
return imageBoxContentList.
setImageRequestedSize(idx, value);
00433 }
00434
00442 OFCondition setImageMagnificationType(size_t idx,
const char *value)
00443 {
00444
return imageBoxContentList.
setImageMagnificationType(idx, value);
00445 }
00446
00454 OFCondition setImageSmoothingType(size_t idx,
const char *value)
00455 {
00456
return imageBoxContentList.
setImageSmoothingType(idx, value);
00457 }
00458
00466 OFCondition setImageConfigurationInformation(size_t idx,
const char *value)
00467 {
00468
return imageBoxContentList.
setImageConfigurationInformation(idx, value);
00469 }
00470
00475 const char *
getImagePolarity(size_t idx)
00476 {
00477
return imageBoxContentList.
getImagePolarity(idx);
00478 }
00479
00484 const char *
getImageRequestedSize(size_t idx)
00485 {
00486
return imageBoxContentList.
getImageRequestedSize(idx);
00487 }
00488
00493 const char *
getImageMagnificationType(size_t idx)
00494 {
00495
return imageBoxContentList.
getImageMagnificationType(idx);
00496 }
00497
00502 const char *
getImageSmoothingType(size_t idx)
00503 {
00504
return imageBoxContentList.
getImageSmoothingType(idx);
00505 }
00506
00511 const char *
getImageConfigurationInformation(size_t idx)
00512 {
00513
return imageBoxContentList.
getImageConfigurationInformation(idx);
00514 }
00515
00521
DVPSPresentationLUT *
getImagePresentationLUT(size_t idx);
00522
00527
DVPSPresentationLUT *
getPresentationLUT();
00528
00533
OFCondition setDefaultPresentationLUT();
00534
00540
OFCondition setPresentationLUTShape(DVPSPresentationLUTType shape);
00541
00550
OFCondition setPresentationLookupTable(
DcmItem &dset);
00551
00560 Sint32
convertODtoPValue(Uint16 density,
unsigned int bits = 8);
00561
00569
OFCondition writeHardcopyImageAttributes(
DcmItem &dset);
00570
00583
OFCondition addImageBox(
00584
const char *retrieveaetitle,
00585
const char *refstudyuid,
00586
const char *refseriesuid,
00587
const char *refsopclassuid,
00588
const char *refsopinstanceuid,
00589
const char *requestedimagesize,
00590
const char *patientid,
00591
DVPSPresentationLUT *presentationlut,
00592 OFBool inversePLUT);
00593
00606
OFCondition addImageBox(
00607
const char *retrieveaetitle,
00608
const char *refsopinstanceuid,
00609
const char *requestedimagesize=NULL,
00610
const char *patientid=NULL,
00611
DVPSPresentationLUT *presentationlut=NULL,
00612 OFBool inversePLUT=OFFalse);
00613
00623
OFCondition setSingleAnnotation(
00624
const char *displayformat,
00625
const char *text,
00626 Uint16 position);
00627
00630
void deleteAnnotations();
00631
00636
OFCondition setInstanceUID(
const char *uid);
00637
00641 void clearInstanceUID() {
sOPInstanceUID.
clear(); }
00642
00650 OFCondition getImageReference(size_t idx,
const char *&studyUID,
const char *&seriesUID,
const char *&instanceUID)
00651 {
00652
return imageBoxContentList.
getImageReference(idx, studyUID, seriesUID, instanceUID);
00653 }
00654
00660 DVPSPrintPresentationLUTAlignment
getReferencedPresentationLUTAlignment() {
return referencedPresentationLUTAlignment; }
00661
00668
OFCondition printSCUgetPrinterInstance(
DVPSPrintMessageHandler& printHandler);
00669
00680
OFCondition printSCUpreparePresentationLUT(
00681
DVPSPrintMessageHandler& printHandler,
00682 OFBool printerRequiresMatchingLUT,
00683 OFBool printerLUTRenderingPreferred,
00684 OFBool printerSupports12Bit);
00685
00693
OFCondition printSCUcreateBasicFilmSession(
00694
DVPSPrintMessageHandler& printHandler,
00695
DcmDataset& dset,
00696 OFBool plutInSession);
00697
00706
OFCondition printSCUcreateBasicFilmBox(
DVPSPrintMessageHandler& printHandler, OFBool plutInSession);
00707
00717
OFCondition printSCUsetBasicImageBox(
00718
DVPSPrintMessageHandler& printHandler,
00719 size_t idx,
00720
DicomImage& image,
00721 OFBool useMonochrome1=OFFalse);
00722
00729
OFCondition printSCUsetBasicAnnotationBox(
00730
DVPSPrintMessageHandler& printHandler,
00731 size_t idx);
00732
00737
OFCondition printSCUprintBasicFilmBox(
DVPSPrintMessageHandler& printHandler);
00738
00743
OFCondition printSCUprintBasicFilmSession(
DVPSPrintMessageHandler& printHandler);
00744
00749
OFCondition printSCUdelete(
DVPSPrintMessageHandler& printHandler);
00750
00758
OFCondition setPrintIllumination(Uint16 value);
00759
00764 Uint16
getPrintIllumination();
00765
00773
OFCondition setPrintReflectedAmbientLight(Uint16 value);
00774
00779 Uint16
getPrintReflectedAmbientLight();
00780
00805 OFBool
printSCPCreate(
00806
DVConfiguration& cfg,
00807
const char *cfgname,
00808
DcmDataset *rqDataset,
00809 T_DIMSE_Message& rsp,
00810
DcmDataset *& rspDataset,
00811 OFBool presentationLUTnegotiated,
00812
DVPSPresentationLUT_PList& globalPresentationLUTList,
00813
const char *filmSessionUID,
00814
DcmUniqueIdentifier& study,
00815
DcmUniqueIdentifier& psSeries,
00816
DcmUniqueIdentifier& imgSeries);
00817
00834 OFBool
printSCPSet(
00835
DVConfiguration& cfg,
00836
const char *cfgname,
00837
DcmDataset *rqDataset,
00838 T_DIMSE_Message& rsp,
00839
DcmDataset *& rspDataset,
00840 OFBool presentationLUTnegotiated,
00841
DVPSPresentationLUT_PList& globalPresentationLUTList);
00842
00847 OFBool
isFilmBoxInstance(
const char *c) {
if (c && (
filmBoxInstanceUID == c))
return OFTrue;
else return OFFalse; }
00848
00855 OFBool
usesPresentationLUT(
const char *c);
00856
00863 DVPSImageBoxContent *
duplicateImageBox(
const char *uid) {
return imageBoxContentList.
duplicateImageBox(uid); }
00864
00872 OFBool
haveImagePositionClash(
const char *uid, Uint16 position) {
return imageBoxContentList.
haveImagePositionClash(uid, position); }
00873
00879 void replaceImageBox(
DVPSImageBoxContent *newImageBox) {
imageBoxContentList.
replace(newImageBox); }
00880
00888
void updatePresentationLUTList(
DVPSPresentationLUT_PList& globalPresentationLUTList);
00889
00895
void setLog(
OFConsole *stream, OFBool verbMode, OFBool dbgMode);
00896
00903 OFBool
matchesPresentationLUT(DVPSPrintPresentationLUTAlignment align)
const
00904
{
00905
return imageBoxContentList.
matchesPresentationLUT(align);
00906 }
00907
00917
void overridePresentationLUTSettings(
00918
DcmUnsignedShort& newIllumination,
00919
DcmUnsignedShort& newReflectedAmbientLight,
00920
DcmUniqueIdentifier& newReferencedPLUT,
00921 DVPSPrintPresentationLUTAlignment newAlignment);
00922
00929 OFBool
emptyPageWarning() {
return imageBoxContentList.
emptyPageWarning(); }
00930
00931
private:
00932
00934
DVPSStoredPrint&
operator=(
const DVPSStoredPrint&);
00935
00936
00937
00938
00939 OFBool isImageStorageSOPClass(
OFString& sopclassuid);
00940
00945
OFCondition createDefaultValues();
00946
00952
OFCondition addReferencedPLUTSQ(
DcmItem &dset);
00953
00961
OFCondition addPresentationLUTReference(
DcmItem& dset);
00962
00965
void invalidateCache();
00966
00969
void updateCache();
00970
00971
00972
00974 DcmPersonName patientName;
00976 DcmLongString patientID;
00978 DcmDate patientBirthDate;
00980 DcmCodeString patientSex;
00981
00982
00983
00985 DcmUniqueIdentifier studyInstanceUID;
00987 DcmDate studyDate;
00989 DcmTime studyTime;
00991 DcmPersonName referringPhysiciansName;
00993 DcmShortString studyID;
00995 DcmShortString accessionNumber;
00996
00997
00998
01000 DcmUniqueIdentifier seriesInstanceUID;
01002 DcmIntegerString seriesNumber;
01003
01004
01005
01007 DcmLongString manufacturer;
01008
01009
01010
01011
01012
01013
01015 DcmApplicationEntity originator;
01017 DcmApplicationEntity destination;
01019 DcmLongString printerName;
01020
01021
01022
01024 DcmIntegerString instanceNumber;
01025
01027 DcmShortText imageDisplayFormat;
01029 DcmCodeString annotationDisplayFormatID;
01031 DcmCodeString filmOrientation;
01033 DcmCodeString filmSizeID;
01035 DcmCodeString magnificationType;
01037 DcmCodeString smoothingType;
01039 DcmCodeString borderDensity;
01041 DcmCodeString emptyImageDensity;
01043 DcmUnsignedShort minDensity;
01045 DcmUnsignedShort maxDensity;
01047 DcmCodeString trim;
01049 DcmShortText configurationInformation;
01051 DcmUnsignedShort illumination;
01053 DcmUnsignedShort reflectedAmbientLight;
01055 DcmCodeString requestedResolutionID;
01057 DcmUniqueIdentifier referencedPresentationLUTInstanceUID;
01058
01064 DVPSPrintPresentationLUTAlignment
referencedPresentationLUTAlignment;
01065
01066
01067
01069 DVPSImageBoxContent_PList imageBoxContentList;
01070
01071
01072
01074 DVPSAnnotationContent_PList annotationContentList;
01075
01076
01077
01078
DVPSPresentationLUT_PList presentationLUTList;
01079
01080
01081
01082
01084 DcmUniqueIdentifier sOPInstanceUID;
01086 DcmCodeString specificCharacterSet;
01088 DcmDate instanceCreationDate;
01090 DcmTime instanceCreationTime;
01091
01093 DcmUniqueIdentifier imageSeriesInstanceUID;
01094
01096 OFBool
currentValuesValid;
01098 unsigned long currentNumCols;
01100 unsigned long currentNumRows;
01101
01103 DVPSDecimateCropBehaviour
decimateCropBehaviour;
01104
01106 OFString filmSessionInstanceUID;
01107
01109 OFString filmBoxInstanceUID;
01110
01117 OFString presentationLUTInstanceUID;
01118
01120 DVPSPresentationLUT globalPresentationLUT;
01121
01123 OFBool
globalPresentationLUTValid;
01124
01126 OFBool
transmitImagesIn12Bit;
01127
01129 OFBool
renderPresentationLUTinSCP;
01130
01132 OFString tempDensity;
01133
01136 OFConsole *
logstream;
01137
01140 OFBool
verboseMode;
01141
01144 OFBool
debugMode;
01145
01146 };
01147
01148
#endif
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282