# gdcmImageChangeTransferSyntax.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004   Module:  $URL$
    00005
    00006   Copyright (c) 2006-2009 Mathieu Malaterre
    00007   All rights reserved.
    00008   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00009
    00010      This software is distributed WITHOUT ANY WARRANTY; without even
    00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00012      PURPOSE.  See the above copyright notice for more information.
    00013
    00014 =========================================================================*/
    00015 #ifndef __gdcmImageChangeTransferSyntax_h
    00016 #define __gdcmImageChangeTransferSyntax_h
    00017
    00018 #include "gdcmImageToImageFilter.h"
    00019 #include "gdcmTransferSyntax.h"
    00020
    00021 namespace gdcm
    00022 {
    00023
    00024 class DataElement;
    00025 class ImageCodec;
    00033 class GDCM_EXPORT ImageChangeTransferSyntax : public ImageToImageFilter
    00034 {
    00035 public:
    00036   ImageChangeTransferSyntax():TS(TransferSyntax::TS_END),Force(false),CompressIconImage(false),UserCodec(0) {}
    00037   ~ImageChangeTransferSyntax() {}
    00038
    00040   void SetTransferSyntax(const TransferSyntax &ts) { TS = ts; }
    00042   const TransferSyntax &GetTransferSyntax() const { return TS; }
    00043
    00045   bool Change();
    00046
    00049   void SetCompressIconImage(bool b) { CompressIconImage = b; }
    00050
    00055   void SetForce( bool f ) { Force = f; }
    00056
    00057   void SetUserCodec(ImageCodec *ic) { UserCodec = ic; }
    00058
    00059 protected:
    00060   bool TryJPEGCodec(const DataElement &pixelde, Bitmap const &input, Bitmap &output);
    00061   bool TryJPEG2000Codec(const DataElement &pixelde, Bitmap const &input, Bitmap &output);
    00062   bool TryJPEGLSCodec(const DataElement &pixelde, Bitmap const &input, Bitmap &output);
    00063   bool TryRAWCodec(const DataElement &pixelde, Bitmap const &input, Bitmap &output);
    00064   bool TryRLECodec(const DataElement &pixelde, Bitmap const &input, Bitmap &output);
    00065
    00066 private:
    00067   TransferSyntax TS;
    00068   bool Force;
    00069   bool CompressIconImage;
    00070
    00071   ImageCodec *UserCodec;
    00072 };
    00073
    00079 } // end namespace gdcm
    00080
    00081 #endif //__gdcmImageChangeTransferSyntax_h
    00082