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 #ifndef DCMIMAGE_H
00035 #define DCMIMAGE_H
00036
00037 #include "osconfig.h"
00038
00039 #include "ofcast.h"
00040
00041 #include "dimoimg.h"
00042 #include "didispfn.h"
00043 #include "diutils.h"
00044
00045
00046
00047
00048
00049
00050 class DcmXfer;
00051 class DcmObject;
00052 class DcmOverlayData;
00053 class DcmLongString;
00054 class DcmUnsignedShort;
00055
00056 class DiDocument;
00057 class DiPluginFormat;
00058
00059
00060
00061
00062
00063
00066 class DicomImage
00067 {
00068
00069 public:
00070
00071
00072
00083 DicomImage(const char *filename,
00084 const unsigned long flags = 0,
00085 const unsigned long fstart = 0,
00086 const unsigned long fcount = 0);
00087
00088 #ifndef STARVIEW
00089
00101 DicomImage(DcmObject *object,
00102 const E_TransferSyntax xfer,
00103 const unsigned long flags = 0,
00104 const unsigned long fstart = 0,
00105 const unsigned long fcount = 0);
00106
00123 DicomImage(DcmObject *object,
00124 const E_TransferSyntax xfer,
00125 const double slope,
00126 const double intercept,
00127 const unsigned long flags = 0,
00128 const unsigned long fstart = 0,
00129 const unsigned long fcount = 0);
00130
00148 DicomImage(DcmObject *object,
00149 E_TransferSyntax xfer,
00150 const DcmUnsignedShort &data,
00151 const DcmUnsignedShort &descriptor,
00152 const DcmLongString *explanation = NULL,
00153 const unsigned long flags = 0,
00154 const unsigned long fstart = 0,
00155 const unsigned long fcount = 0);
00156 #endif
00157
00160 virtual ~DicomImage();
00161
00162
00163
00164
00171 static const char *getString(const EI_Status status);
00172
00179 static const char *getString(const EP_Interpretation interpret);
00180
00185 inline EI_Status getStatus() const
00186 {
00187 return (Image != NULL) ?
00188 Image->getStatus() : ImageStatus;
00189 }
00190
00198 inline unsigned long getFrameCount() const
00199 {
00200 return (Image != NULL) ?
00201 Image->getNumberOfFrames() : 0;
00202 }
00203
00210 inline unsigned long getFirstFrame() const
00211 {
00212 return (Image != NULL) ?
00213 Image->getFirstFrame() : 0;
00214 }
00215
00221 inline unsigned long getRepresentativeFrame() const
00222 {
00223 return (Image != NULL) ?
00224 Image->getRepresentativeFrame() : 0;
00225 }
00226
00231 inline unsigned long getWidth() const
00232 {
00233 return (Image != NULL) ?
00234 Image->getColumns() : 0;
00235 }
00236
00241 inline unsigned long getHeight() const
00242 {
00243 return (Image != NULL) ?
00244 Image->getRows() : 0;
00245 }
00246
00251 inline int getDepth() const
00252 {
00253 return (Image != NULL) ?
00254 Image->getBits() : 0;
00255 }
00256
00270 inline int getMinMaxValues(double &min,
00271 double &max,
00272 const int mode = 0) const
00273 {
00274 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00275 Image->getMonoImagePtr()->getMinMaxValues(min, max, mode) : 0;
00276 }
00277
00282 inline double getWidthHeightRatio() const
00283 {
00284 return (Image != NULL) ?
00285 Image->getColumnRowRatio() : 0;
00286 }
00287
00292 inline double getHeightWidthRatio() const
00293 {
00294 return (Image != NULL) ?
00295 Image->getRowColumnRatio() : 0;
00296 }
00297
00304 inline int setWidthHeightRatio(const double ratio) const
00305 {
00306 return (Image != NULL) ?
00307 Image->setColumnRowRatio(ratio) : 0;
00308 }
00309
00316 inline int setHeightWidthRatio(const double ratio) const
00317 {
00318 return (Image != NULL) ?
00319 Image->setRowColumnRatio(ratio) : 0;
00320 }
00321
00328 inline int isOutputValueUnused(const unsigned long value)
00329 {
00330 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00331 Image->getMonoImagePtr()->isValueUnused(value) : 0;
00332 }
00333
00334
00335
00347 inline unsigned long getOutputDataSize(const int bits = 0) const
00348 {
00349 return (Image != NULL) ?
00350 Image->getOutputDataSize(Image->getBits(bits)) : 0;
00351 }
00352
00371 inline const void *getOutputData(const int bits = 0,
00372 const unsigned long frame = 0,
00373 const int planar = 0)
00374 {
00375 return (Image != NULL) ?
00376 Image->getOutputData(frame, Image->getBits(bits), planar) : NULL;
00377 }
00378
00397 inline int getOutputData(void *buffer,
00398 const unsigned long size,
00399 const int bits = 0,
00400 const unsigned long frame = 0,
00401 const int planar = 0)
00402 {
00403 return (Image != NULL) ?
00404 Image->getOutputData(buffer, size, frame, Image->getBits(bits), planar) : 0;
00405 }
00406
00418 inline const void *getOutputPlane(const int plane) const
00419 {
00420 return (Image != NULL) ?
00421 Image->getOutputPlane(plane) : NULL;
00422 }
00423
00427 inline void deleteOutputData() const
00428 {
00429 if (Image != NULL)
00430 Image->deleteOutputData();
00431 }
00432
00433
00434
00439 inline int isMonochrome() const
00440 {
00441 return (PhotometricInterpretation == EPI_Monochrome1) || (PhotometricInterpretation == EPI_Monochrome2);
00442 }
00443
00448 inline EP_Interpretation getPhotometricInterpretation() const
00449 {
00450 return PhotometricInterpretation;
00451 }
00452
00457 int hasSOPclassUID(const char *uid) const;
00458
00459
00460
00461
00466 inline DiDisplayFunction *getDisplayFunction() const
00467 {
00468 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00469 Image->getMonoImagePtr()->getDisplayFunction() : OFstatic_cast(DiDisplayFunction *, NULL);
00470 }
00471
00478 inline int setDisplayFunction(DiDisplayFunction *display)
00479 {
00480 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00481 Image->getMonoImagePtr()->setDisplayFunction(display) : 0;
00482 }
00483
00491 inline int setNoDisplayFunction()
00492 {
00493 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00494 Image->getMonoImagePtr()->setNoDisplayFunction() : 0;
00495 }
00496
00503 inline int deleteDisplayLUT(const int bits = 0)
00504 {
00505 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00506 Image->getMonoImagePtr()->deleteDisplayLUT(bits) : 0;
00507 }
00508
00520 inline int convertPValueToDDL(const Uint16 pvalue,
00521 Uint16 &ddl,
00522 const int bits = 8)
00523 {
00524 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00525 Image->getMonoImagePtr()->convertPValueToDDL(pvalue, ddl, bits) : 0;
00526 }
00527
00528
00529
00530
00538 inline int setNoVoiTransformation()
00539 {
00540 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00541 Image->getMonoImagePtr()->setNoVoiTransformation() : 0;
00542 }
00543
00555 inline int setMinMaxWindow(const int idx = 0)
00556 {
00557 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00558 Image->getMonoImagePtr()->setMinMaxWindow(idx) : 0;
00559 }
00560
00569 inline int setHistogramWindow(const double thresh = 0.05)
00570 {
00571 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00572 Image->getMonoImagePtr()->setHistogramWindow(thresh) : 0;
00573 }
00574
00591 inline int setRoiWindow(const unsigned long left_pos,
00592 const unsigned long top_pos,
00593 const unsigned long width,
00594 const unsigned long height,
00595 const unsigned long frame = 0)
00596 {
00597 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00598 Image->getMonoImagePtr()->setRoiWindow(left_pos, top_pos, width, height, frame) : 0;
00599 }
00600
00609 inline int setWindow(const unsigned long window)
00610 {
00611 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00612 Image->getMonoImagePtr()->setWindow(window) : 0;
00613 }
00614
00625 inline int setWindow(const double center,
00626 const double width)
00627 {
00628 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00629 Image->getMonoImagePtr()->setWindow(center, width) : 0;
00630 }
00631
00639 inline int getWindow(double ¢er,
00640 double &width)
00641 {
00642 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00643 Image->getMonoImagePtr()->getWindow(center, width) : 0;
00644 }
00645
00651 inline unsigned long getWindowCount() const
00652 {
00653 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00654 Image->getMonoImagePtr()->getWindowCount() : 0;
00655 }
00656
00670 inline int setVoiLut(const DcmUnsignedShort &data,
00671 const DcmUnsignedShort &descriptor,
00672 const DcmLongString *explanation = NULL,
00673 const OFBool ignoreDepth = OFFalse)
00674 {
00675 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00676 Image->getMonoImagePtr()->setVoiLut(data, descriptor, explanation, ignoreDepth) : 0;
00677 }
00678
00689 inline int setVoiLut(const unsigned long table,
00690 const OFBool ignoreDepth = OFFalse)
00691 {
00692 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00693 Image->getMonoImagePtr()->setVoiLut(table, ignoreDepth) : 0;
00694 }
00695
00700 inline unsigned long getVoiLutCount() const
00701 {
00702 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00703 Image->getMonoImagePtr()->getVoiLutCount() : 0;
00704 }
00705
00710 inline const char *getVoiTransformationExplanation() const
00711 {
00712 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00713 Image->getMonoImagePtr()->getVoiTransformationExplanation() : OFstatic_cast(const char *, NULL);
00714 }
00715
00723 inline const char *getVoiWindowExplanation(const unsigned long window,
00724 OFString &explanation) const
00725 {
00726 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00727 Image->getMonoImagePtr()->getVoiWindowExplanation(window, explanation) : OFstatic_cast(const char *, NULL);
00728 }
00729
00737 inline const char *getVoiLutExplanation(const unsigned long table,
00738 OFString &explanation) const
00739 {
00740 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00741 Image->getMonoImagePtr()->getVoiLutExplanation(table, explanation) : OFstatic_cast(const char *, NULL);
00742 }
00743
00748 inline const char *getModalityLutExplanation() const
00749 {
00750 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00751 Image->getMonoImagePtr()->getModalityLutExplanation() : OFstatic_cast(const char *, NULL);
00752 }
00753
00754
00755
00761 inline EP_Polarity getPolarity() const
00762 {
00763 return (Image != NULL) ?
00764 Image->getPolarity() : EPP_Normal;
00765 }
00766
00775 inline int setPolarity(const EP_Polarity polarity)
00776 {
00777 return (Image != NULL) ?
00778 Image->setPolarity(polarity) : 0;
00779 }
00780
00793 inline int setHardcopyParameters(const unsigned int min,
00794 const unsigned int max,
00795 const unsigned int reflect,
00796 const unsigned int illumin)
00797 {
00798 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00799 Image->getMonoImagePtr()->setHardcopyParameters(min, max, reflect, illumin) : 0;
00800 }
00801
00802
00803
00810 inline ES_PresentationLut getPresentationLutShape() const
00811 {
00812 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00813 Image->getMonoImagePtr()->getPresentationLutShape() : ESP_Default;
00814 }
00815
00827 inline int setPresentationLutShape(const ES_PresentationLut shape)
00828 {
00829 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00830 Image->getMonoImagePtr()->setPresentationLutShape(shape) : 0;
00831 }
00832
00846 inline int setPresentationLut(const DcmUnsignedShort &data,
00847 const DcmUnsignedShort &descriptor,
00848 const DcmLongString *explanation = NULL,
00849 const OFBool ignoreDepth = OFFalse)
00850 {
00851 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00852 Image->getMonoImagePtr()->setPresentationLut(data, descriptor, explanation, ignoreDepth) : 0;
00853 }
00854
00859 inline const char *getPresentationLutExplanation() const
00860 {
00861 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00862 Image->getMonoImagePtr()->getPresentationLutExplanation() : OFstatic_cast(const char *, NULL);
00863 }
00864
00876 inline int setInversePresentationLut(const DcmUnsignedShort &data,
00877 const DcmUnsignedShort &descriptor,
00878 const OFBool ignoreDepth = OFFalse)
00879 {
00880 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00881 Image->getMonoImagePtr()->setInversePresentationLut(data, descriptor, ignoreDepth) : 0;
00882 }
00883
00884
00885
00886
00903 inline int addOverlay(const unsigned int group,
00904 const signed int left_pos,
00905 const signed int top_pos,
00906 const unsigned int width,
00907 const unsigned int height,
00908 const DcmOverlayData &data,
00909 const DcmLongString &label,
00910 const DcmLongString &description,
00911 const EM_Overlay mode = EMO_Default)
00912 {
00913 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00914 Image->getMonoImagePtr()->addOverlay(group, left_pos, top_pos, width, height, data, label, description, mode) : 0;
00915 }
00916
00923 inline int removeOverlay(const unsigned int group)
00924 {
00925 return ((Image != NULL) && (Image->getOverlayPtr(1) != NULL)) ?
00926 Image->getOverlayPtr(1)->removePlane(group) : 0;
00927 }
00928
00934 inline int removeAllOverlays()
00935 {
00936 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
00937 Image->getMonoImagePtr()->removeAllOverlays() : 0;
00938 }
00939
00948 inline int isOverlayVisible(const unsigned int plane,
00949 const unsigned int idx = 0)
00950 {
00951 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
00952 Image->getOverlayPtr(idx)->isPlaneVisible(plane) : 0;
00953 }
00954
00963 inline int showOverlay(const unsigned int plane,
00964 const unsigned int idx = 0)
00965 {
00966 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
00967 Image->getOverlayPtr(idx)->showPlane(plane) : 0;
00968 }
00969
00980 inline int showOverlay(const unsigned int plane,
00981 const EM_Overlay mode,
00982 const double fore = 1.0,
00983 const double thresh = 0.5,
00984 const unsigned int idx = 0)
00985 {
00986 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
00987 Image->getOverlayPtr(idx)->showPlane(plane, fore, thresh, mode) : 0;
00988 }
00989
00997 inline int showOverlay(const unsigned int plane,
00998 const Uint16 pvalue)
00999 {
01000 return ((Image != NULL) && (Image->getOverlayPtr(1) != NULL)) ?
01001 Image->getOverlayPtr(1)->showPlane(plane, pvalue) : 0;
01002 }
01003
01011 inline int showAllOverlays(const unsigned int idx = 0)
01012 {
01013 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01014 Image->getOverlayPtr(idx)->showAllPlanes() : 0;
01015 }
01016
01027 inline int showAllOverlays(const EM_Overlay mode,
01028 const double fore = 1,
01029 const double thresh = 0.5,
01030 const unsigned int idx = 0)
01031 {
01032 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01033 Image->getOverlayPtr(idx)->showAllPlanes(fore, thresh, mode) : 0;
01034 }
01035
01044 inline int hideOverlay(const unsigned int plane,
01045 const unsigned int idx = 0)
01046 {
01047 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01048 Image->getOverlayPtr(idx)->hidePlane(plane) : 0;
01049 }
01050
01058 inline int hideAllOverlays(const unsigned int idx = 0)
01059 {
01060 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01061 Image->getOverlayPtr(idx)->hideAllPlanes() : 0;
01062 }
01063
01074 inline int placeOverlay(const unsigned int plane,
01075 const signed int left_pos,
01076 const signed int top_pos,
01077 const unsigned int idx = 0)
01078 {
01079 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01080 Image->getOverlayPtr(idx)->placePlane(plane, left_pos, top_pos) : 0;
01081 }
01082
01089 inline unsigned int getOverlayCount(const unsigned int idx = 0) const
01090 {
01091 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01092 Image->getOverlayPtr(idx)->getCount() : 0;
01093 }
01094
01102 inline unsigned int getOverlayGroupNumber(const unsigned int plane,
01103 const unsigned int idx = 0) const
01104 {
01105 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01106 Image->getOverlayPtr(idx)->getPlaneGroupNumber(plane) : 0;
01107 }
01108
01116 inline const char *getOverlayLabel(const unsigned int plane,
01117 const unsigned int idx = 0) const
01118 {
01119 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01120 Image->getOverlayPtr(idx)->getPlaneLabel(plane) : OFstatic_cast(const char *, NULL);
01121 }
01122
01130 inline const char *getOverlayDescription(const unsigned int plane,
01131 const unsigned int idx = 0) const
01132 {
01133 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01134 Image->getOverlayPtr(idx)->getPlaneDescription(plane) : OFstatic_cast(const char *, NULL);
01135 }
01136
01144 inline EM_Overlay getOverlayMode(const unsigned int plane,
01145 const unsigned int idx = 0) const
01146 {
01147 return ((Image != NULL) && (Image->getOverlayPtr(idx) != NULL)) ?
01148 Image->getOverlayPtr(idx)->getPlaneMode(plane) : EMO_Default;
01149 }
01150
01178 const void *getOverlayData(const unsigned int plane,
01179 unsigned int &left_pos,
01180 unsigned int &top_pos,
01181 unsigned int &width,
01182 unsigned int &height,
01183 EM_Overlay &mode,
01184 const unsigned long frame = 0,
01185 const int bits = 8,
01186 const Uint16 fore = 0xff,
01187 const Uint16 back = 0x0,
01188 const unsigned int idx = 2) const
01189 {
01190 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
01191 Image->getMonoImagePtr()->getOverlayData(frame, plane, left_pos, top_pos, width, height, mode, idx, bits, fore, back) : NULL;
01192 }
01193
01214 const void *getFullOverlayData(const unsigned int plane,
01215 unsigned int &width,
01216 unsigned int &height,
01217 const unsigned long frame = 0,
01218 const int bits = 8,
01219 const Uint16 fore = 0xff,
01220 const Uint16 back = 0x0,
01221 const unsigned int idx = 0) const
01222 {
01223 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
01224 Image->getMonoImagePtr()->getFullOverlayData(frame, plane, width, height, idx, bits, fore, back) : NULL;
01225 }
01226
01230 inline void deleteOverlayData() const
01231 {
01232 if ((Image != NULL) && (Image->getMonoImagePtr() != NULL))
01233 Image->getMonoImagePtr()->deleteOverlayData();
01234 }
01235
01252 unsigned long create6xxx3000OverlayData(Uint8 *&buffer,
01253 const unsigned int plane,
01254 unsigned int &width,
01255 unsigned int &height,
01256 unsigned long &frames,
01257 const unsigned int idx = 0) const
01258 {
01259 return ((Image != NULL) && (Image->getMonoImagePtr() != NULL)) ?
01260 Image->getMonoImagePtr()->create6xxx3000OverlayData(buffer, plane, width, height, frames, idx) : 0;
01261 }
01262
01263
01264
01265
01274 DicomImage *createDicomImage(unsigned long fstart = 0,
01275 unsigned long fcount = 0) const;
01276
01290 DicomImage *createScaledImage(const unsigned long width,
01291 const unsigned long height = 0,
01292 const int interpolate = 0,
01293 int aspect = 0) const;
01294
01308 DicomImage *createScaledImage(const double xfactor,
01309 const double yfactor = 0,
01310 const int interpolate = 0,
01311 const int aspect = 0) const;
01312
01333 DicomImage *createScaledImage(const signed long left_pos,
01334 const signed long top_pos,
01335 unsigned long clip_width,
01336 unsigned long clip_height,
01337 unsigned long scale_width = 0,
01338 unsigned long scale_height = 0,
01339 const int interpolate = 0,
01340 int aspect = 0,
01341 const Uint16 pvalue = 0) const;
01342
01363 DicomImage *createScaledImage(const signed long left_pos,
01364 const signed long top_pos,
01365 unsigned long width,
01366 unsigned long height,
01367 const double xfactor,
01368 const double yfactor = 0,
01369 const int interpolate = 0,
01370 const int aspect = 0,
01371 const Uint16 pvalue = 0) const;
01372
01385 DicomImage *createClippedImage(const signed long left_pos,
01386 const signed long top_pos,
01387 unsigned long width = 0,
01388 unsigned long height = 0,
01389 const Uint16 pvalue = 0) const;
01390
01400 int flipImage(int horz = 1,
01401 int vert = 0) const;
01402
01411 DicomImage *createFlippedImage(int horz = 1,
01412 int vert = 0) const;
01413
01422 int rotateImage(signed int degree) const;
01423
01431 DicomImage *createRotatedImage(signed int degree) const;
01432
01444 DicomImage *createMonochromeImage(const double red = 0.299,
01445 const double green = 0.587,
01446 const double blue = 0.114) const;
01447
01472 unsigned long createWindowsDIB(void *&data,
01473 const unsigned long size,
01474 const unsigned long frame = 0,
01475 const int bits = 24,
01476 const int upsideDown = 0,
01477 const int padding = 1)
01478 {
01479 return (Image != NULL) ?
01480 Image->createDIB(data, size, frame, bits, upsideDown, padding) : 0;
01481 }
01482
01495 unsigned long createJavaAWTBitmap(void *&data,
01496 const unsigned long frame = 0,
01497 const int bits = 32)
01498 {
01499 return (Image != NULL) ?
01500 Image->createAWTBitmap(data, frame, bits) : 0;
01501 }
01502
01512 static void *create12BitPackedBitmap(const void *buffer,
01513 const unsigned long size,
01514 const unsigned long count)
01515 {
01516 return DiMonoImage::createPackedBitmap(buffer, size, count, 16, 12);
01517 }
01518
01528 DicomImage *createMonoOutputImage(const unsigned long frame,
01529 const int bits);
01530
01531
01532
01560 inline int writeFrameToDataset(DcmItem &dataset,
01561 const int bits = 0,
01562 const unsigned long frame = 0,
01563 const int planar = 0)
01564 {
01565 return (Image != NULL) ?
01566 Image->writeFrameToDataset(dataset, frame, bits, planar) : 0;
01567 }
01568
01590 inline int writeImageToDataset(DcmItem &dataset)
01591 {
01592 return (Image != NULL) ?
01593 Image->writeImageToDataset(dataset) : 0;
01594 }
01595
01609 int writePPM(const char *filename,
01610 const int bits = 0,
01611 const unsigned long frame = 0);
01612
01626 int writePPM(ostream &stream,
01627 const int bits = 0,
01628 const unsigned long frame = 0);
01629
01643 int writePPM(FILE *stream,
01644 const int bits = 0,
01645 const unsigned long frame = 0);
01646
01660 int writeRawPPM(const char *filename,
01661 const int bits = 0,
01662 const unsigned long frame= 0);
01663
01677 int writeRawPPM(FILE *stream,
01678 const int bits = 0,
01679 const unsigned long frame = 0);
01680
01693 int writeBMP(FILE *stream,
01694 const int bits = 0,
01695 const unsigned long frame = 0);
01696
01709 int writeBMP(const char *filename,
01710 const int bits = 0,
01711 const unsigned long frame = 0);
01712
01722 int writePluginFormat(const DiPluginFormat *plugin,
01723 FILE *stream,
01724 const unsigned long frame = 0);
01725
01735 int writePluginFormat(const DiPluginFormat *plugin,
01736 const char *filename,
01737 const unsigned long frame = 0);
01738
01739
01740 protected:
01741
01748 DicomImage(const DicomImage *dicom,
01749 DiImage *image,
01750 const EP_Interpretation interpret = EPI_Unknown);
01751
01755 void Init();
01756
01761 int checkDataDictionary();
01762
01767 const char *getSOPclassUID() const;
01768
01777 int normalizeDegreeValue(signed int °ree) const;
01778
01779
01780 private:
01781
01783 EI_Status ImageStatus;
01785 EP_Interpretation PhotometricInterpretation;
01786
01788 DiDocument *Document;
01790 DiImage *Image;
01791
01792
01793
01794 DicomImage(const DicomImage &);
01795 DicomImage &operator=(const DicomImage &);
01796 };
01797
01798
01799 #endif
01800
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971
01972
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028