view OrthancStone/Sources/Toolbox/DicomStructuredReport.h @ 2088:b98d159c7545 dicom-sr

created branch dicom-sr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Nov 2023 18:12:35 +0100
parents 51c8b21b81e4
children 63d77859edee 7c3d65166c26
line wrap: on
line source

/**
 * Stone of Orthanc
 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
 * Department, University Hospital of Liege, Belgium
 * Copyright (C) 2017-2023 Osimis S.A., Belgium
 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 **/


#pragma once

#if !defined(ORTHANC_ENABLE_DCMTK)
#  error The macro ORTHANC_ENABLE_DCMTK must be defined
#endif

#if ORTHANC_ENABLE_DCMTK != 1
#  error Support for DCMTK must be enabled
#endif

#include <DicomParsing/ParsedDicomFile.h>

#include <dcmtk/dcmdata/dcitem.h>
#include <list>

namespace OrthancStone
{
  class DicomStructuredReport : public boost::noncopyable
  {
  private:
    class Structure;
    class Point;
    class Polyline;

    class ReferencedInstance
    {
    private:
      std::string  studyInstanceUid_;
      std::string  seriesInstanceUid_;
      std::string  sopClassUid_;

    public:
      ReferencedInstance(const std::string& studyInstanceUid,
                         const std::string& seriesInstanceUid,
                         const std::string& sopClassUid) :
        studyInstanceUid_(studyInstanceUid),
        seriesInstanceUid_(seriesInstanceUid),
        sopClassUid_(sopClassUid)
      {
      }

      ReferencedInstance()
      {
      }

      const std::string& GetStudyInstanceUid() const
      {
        return studyInstanceUid_;
      }

      const std::string& GetSeriesInstanceUid() const
      {
        return seriesInstanceUid_;
      }

      const std::string& GetSopClassUid() const
      {
        return sopClassUid_;
      }
    };

    void AddStructure(const std::string& sopInstanceUid,
                      DcmItem& group,
                      bool hasFrameNumber,
                      unsigned int frameNumber,
                      bool hasProbabilityOfCancer,
                      float probabilityOfCancer);

    std::map<std::string, ReferencedInstance>  instancesInformation_;
    std::vector<std::string>                   orderedInstances_;
    std::list<Structure*>                      structures_;

  public:
    DicomStructuredReport(Orthanc::ParsedDicomFile& dicom);

    ~DicomStructuredReport();
  };
}