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 DICOIMG_H
00035 #define DICOIMG_H
00036
00037 #include "dcmtk/config/osconfig.h"
00038 #include "dcmtk/dcmdata/dctypes.h"
00039
00040 #include "dcmtk/dcmimgle/diimage.h"
00041 #include "dcmtk/dcmimage/dicopx.h"
00042 #include "dcmtk/dcmimgle/diutils.h"
00043
00044
00045
00046
00047
00048
00049 class DiColorOutputPixel;
00050
00051
00052
00053
00054
00055
00058 class DiColorImage
00059 : public DiImage
00060 {
00061
00062 public:
00063
00071 DiColorImage(const DiDocument *docu,
00072 const EI_Status status,
00073 const int spp,
00074 const OFBool rgb = OFTrue);
00075
00078 virtual ~DiColorImage();
00079
00084 virtual EP_Interpretation getInternalColorModel() const
00085 {
00086 return (RGBColorModel) ? EPI_RGB : EPI_YBR_Full;
00087 }
00088
00095 virtual unsigned long getOutputDataSize(const int bits = 0) const;
00096
00109 const void *getOutputData(const unsigned long frame,
00110 const int bits,
00111 const int planar = 0);
00112
00127 int getOutputData(void *buffer,
00128 const unsigned long size,
00129 const unsigned long frame,
00130 const int bits,
00131 const int planar = 0);
00132
00140 const void *getOutputPlane(const int plane) const;
00141
00145 void deleteOutputData();
00146
00154 DiImage *createImage(const unsigned long fstart,
00155 const unsigned long fcount) const;
00156
00175 DiImage *createScale(const signed long left_pos,
00176 const signed long top_pos,
00177 const unsigned long src_cols,
00178 const unsigned long src_rows,
00179 const unsigned long dest_cols,
00180 const unsigned long dest_rows,
00181 const int interpolate,
00182 const int aspect,
00183 const Uint16 pvalue) const;
00184
00194 int flip(const int horz,
00195 const int vert);
00196
00204 DiImage *createFlip(const int horz,
00205 const int vert) const;
00206
00215 int rotate(const int degree);
00216
00223 DiImage *createRotate(const int degree) const;
00224
00233 DiImage *createMono(const double red,
00234 const double green,
00235 const double blue) const;
00236
00241 const DiPixel *getInterData() const
00242 {
00243 return InterData;
00244 }
00245
00250 const DiColorPixel *getColorInterData() const
00251 {
00252 return InterData;
00253 }
00254
00267 unsigned long createDIB(void *&data,
00268 const unsigned long size,
00269 const unsigned long frame,
00270 const int bits,
00271 const int upsideDown,
00272 const int padding = 1);
00273
00283 unsigned long createAWTBitmap(void *&data,
00284 const unsigned long frame,
00285 const int bits);
00286
00294 int writeImageToDataset(DcmItem &dataset,
00295 const int mode);
00296
00306 int writePPM(ostream &stream,
00307 const unsigned long frame,
00308 const int bits);
00309
00319 int writePPM(FILE *stream,
00320 const unsigned long frame,
00321 const int bits);
00322
00331 int writeRawPPM(FILE *stream,
00332 const unsigned long frame,
00333 const int bits);
00334
00343 int writeBMP(FILE *stream,
00344 const unsigned long frame,
00345 const int bits);
00346
00347
00348 protected:
00349
00356 DiColorImage(const DiColorImage *image,
00357 const unsigned long fstart,
00358 const unsigned long fcount);
00359
00376 DiColorImage(const DiColorImage *image,
00377 const signed long left_pos,
00378 const signed long top_pos,
00379 const Uint16 src_cols,
00380 const Uint16 src_rows,
00381 const Uint16 dest_cols,
00382 const Uint16 dest_rows,
00383 const int interpolate = 0,
00384 const int aspect = 0);
00385
00392 DiColorImage(const DiColorImage *image,
00393 const int horz,
00394 const int vert);
00395
00401 DiColorImage(const DiColorImage *image,
00402 const int degree);
00403
00408 int checkInterData(const int mode = 1);
00409
00421 const void *getData(void *buffer,
00422 const unsigned long size,
00423 const unsigned long frame,
00424 const int bits,
00425 const int planar);
00426
00432 virtual void updateImagePixelModuleAttributes(DcmItem &dataset);
00433
00435 const OFBool RGBColorModel;
00436
00438 DiColorPixel *InterData;
00439
00440
00441 private:
00442
00444 DiColorOutputPixel *OutputData;
00445
00446
00447
00448 DiColorImage(const DiColorImage &);
00449 DiColorImage &operator=(const DiColorImage &);
00450 };
00451
00452
00453 #endif
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538