GDCM
2.0.18
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMJPEGLSCODEC_H 00015 #define GDCMJPEGLSCODEC_H 00016 00017 #include "gdcmImageCodec.h" 00018 00019 namespace gdcm 00020 { 00021 00022 class JPEGLSInternals; 00030 class GDCM_EXPORT JPEGLSCodec : public ImageCodec 00031 { 00032 public: 00033 JPEGLSCodec(); 00034 ~JPEGLSCodec(); 00035 bool CanDecode(TransferSyntax const &ts) const; 00036 bool CanCode(TransferSyntax const &ts) const; 00037 00038 unsigned long GetBufferLength() const { return BufferLength; } 00039 void SetBufferLength(unsigned long l) { BufferLength = l; } 00040 00041 bool Decode(DataElement const &is, DataElement &os); 00042 bool Decode(DataElement const &in, char* outBuffer, uint32_t inBufferLength, 00043 uint32_t inXMin, uint32_t inXMax, uint32_t inYMin, 00044 uint32_t inYMax, uint32_t inZMin, uint32_t inZMax); 00045 bool Code(DataElement const &in, DataElement &out); 00046 00047 bool GetHeaderInfo(std::istream &is, TransferSyntax &ts); 00048 00049 void SetLossless(bool l); 00050 bool GetLossless() const; 00051 00052 /* 00053 * test.acr can look pretty bad, even with a lossy error of 2. Explanation follows: 00054 * I agree that the test image looks ugly. In this particular case I can 00055 * explain though. 00056 * 00057 * The image is 8 bit, but it does not use the full 8 bit dynamic range. The 00058 * black pixels have value 234 and the white 255. If you set allowed lossy 00059 * error to 2, you allow an error of about 10% of the actual dynamic range. 00060 * That is of course very visible. 00061 */ 00063 void SetLossyError(int error); 00064 00065 private: 00066 unsigned long BufferLength; 00067 bool Lossless; 00068 int LossyError; 00069 }; 00070 00071 } // end namespace gdcm 00072 00073 #endif //GDCMJPEGLSCODEC_H