view Plugin/GdcmParsedDicomFile_TransferSyntaxes.impl.h @ 409:07127c525e6b transcoding

creating branch transcoding
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 12 May 2020 13:05:08 +0200
parents 346efdf7c716
children
line wrap: on
line source

/**
 * Orthanc - A Lightweight, RESTful DICOM Store
 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 * Department, University Hospital of Liege, Belgium
 * Copyright (C) 2017-2020 Osimis S.A., Belgium
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 **/

// This file is autogenerated by "../Resources/GenerateTransferSyntaxes.py"

namespace OrthancPlugins
{
  gdcm::TransferSyntax GdcmParsedDicomFile::GetGdcmTransferSyntax(Orthanc::DicomTransferSyntax syntax)
  {
    switch (syntax)
    {
      case Orthanc::DicomTransferSyntax_LittleEndianImplicit:
        return gdcm::TransferSyntax::ImplicitVRLittleEndian;

      case Orthanc::DicomTransferSyntax_LittleEndianExplicit:
        return gdcm::TransferSyntax::ExplicitVRLittleEndian;

      case Orthanc::DicomTransferSyntax_JPEGProcess1:
        return gdcm::TransferSyntax::JPEGBaselineProcess1;

      case Orthanc::DicomTransferSyntax_JPEGProcess2_4:
        return gdcm::TransferSyntax::JPEGExtendedProcess2_4;

      case Orthanc::DicomTransferSyntax_JPEGProcess14:
        return gdcm::TransferSyntax::JPEGLosslessProcess14;

      case Orthanc::DicomTransferSyntax_JPEGProcess14SV1:
        return gdcm::TransferSyntax::JPEGLosslessProcess14_1;

      case Orthanc::DicomTransferSyntax_JPEGLSLossless:
        return gdcm::TransferSyntax::JPEGLSLossless;

      case Orthanc::DicomTransferSyntax_JPEGLSLossy:
        return gdcm::TransferSyntax::JPEGLSNearLossless;

      case Orthanc::DicomTransferSyntax_JPEG2000LosslessOnly:
        return gdcm::TransferSyntax::JPEG2000Lossless;

      case Orthanc::DicomTransferSyntax_JPEG2000:
        return gdcm::TransferSyntax::JPEG2000;

      case Orthanc::DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly:
        return gdcm::TransferSyntax::JPEG2000Part2Lossless;

      case Orthanc::DicomTransferSyntax_JPEG2000Multicomponent:
        return gdcm::TransferSyntax::JPEG2000Part2;

      case Orthanc::DicomTransferSyntax_RLELossless:
        return gdcm::TransferSyntax::RLELossless;

      default:
        throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
    }
  }


  Orthanc::DicomTransferSyntax GdcmParsedDicomFile::GetOrthancTransferSyntax(gdcm::TransferSyntax syntax)
  {
    switch (syntax)
    {
      case gdcm::TransferSyntax::ImplicitVRLittleEndian:
        return Orthanc::DicomTransferSyntax_LittleEndianImplicit;

      case gdcm::TransferSyntax::ExplicitVRLittleEndian:
        return Orthanc::DicomTransferSyntax_LittleEndianExplicit;

      case gdcm::TransferSyntax::JPEGBaselineProcess1:
        return Orthanc::DicomTransferSyntax_JPEGProcess1;

      case gdcm::TransferSyntax::JPEGExtendedProcess2_4:
        return Orthanc::DicomTransferSyntax_JPEGProcess2_4;

      case gdcm::TransferSyntax::JPEGLosslessProcess14:
        return Orthanc::DicomTransferSyntax_JPEGProcess14;

      case gdcm::TransferSyntax::JPEGLosslessProcess14_1:
        return Orthanc::DicomTransferSyntax_JPEGProcess14SV1;

      case gdcm::TransferSyntax::JPEGLSLossless:
        return Orthanc::DicomTransferSyntax_JPEGLSLossless;

      case gdcm::TransferSyntax::JPEGLSNearLossless:
        return Orthanc::DicomTransferSyntax_JPEGLSLossy;

      case gdcm::TransferSyntax::JPEG2000Lossless:
        return Orthanc::DicomTransferSyntax_JPEG2000LosslessOnly;

      case gdcm::TransferSyntax::JPEG2000:
        return Orthanc::DicomTransferSyntax_JPEG2000;

      case gdcm::TransferSyntax::JPEG2000Part2Lossless:
        return Orthanc::DicomTransferSyntax_JPEG2000MulticomponentLosslessOnly;

      case gdcm::TransferSyntax::JPEG2000Part2:
        return Orthanc::DicomTransferSyntax_JPEG2000Multicomponent;

      case gdcm::TransferSyntax::RLELossless:
        return Orthanc::DicomTransferSyntax_RLELossless;

      default:
        throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
    }
  }
}