annotate Plugins/Samples/GdcmDecoder/GdcmDecoderCache.h @ 3806:b100555c4d6a

fix for libp11
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 Apr 2020 17:08:43 +0200
parents 6110a4995ace
children 7e33516965f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
1900
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1837
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
3640
94f4a18a79cc upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3060
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * modify it under the terms of the GNU General Public License as
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * published by the Free Software Foundation, either version 3 of the
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * License, or (at your option) any later version.
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * General Public License for more details.
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 *
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
3768
6110a4995ace replacing std::auto_ptr by std::unique_ptr in GDCM sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
24 #include "../../../Core/Compatibility.h"
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "GdcmImageDecoder.h"
1837
fbc5522023aa refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1834
diff changeset
26 #include "OrthancImageWrapper.h"
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 #include <boost/thread.hpp>
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace OrthancPlugins
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class GdcmDecoderCache : public boost::noncopyable
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 boost::mutex mutex_;
3768
6110a4995ace replacing std::auto_ptr by std::unique_ptr in GDCM sample plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3640
diff changeset
37 std::unique_ptr<OrthancPlugins::GdcmImageDecoder> decoder_;
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 size_t size_;
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 std::string md5_;
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 static std::string ComputeMd5(OrthancPluginContext* context,
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 const void* dicom,
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 size_t size);
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 public:
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 GdcmDecoderCache() : size_(0)
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 }
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
1837
fbc5522023aa refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1834
diff changeset
50 OrthancImageWrapper* Decode(OrthancPluginContext* context,
fbc5522023aa refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1834
diff changeset
51 const void* dicom,
fbc5522023aa refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1834
diff changeset
52 const uint32_t size,
fbc5522023aa refactoring
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1834
diff changeset
53 uint32_t frameIndex);
1834
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 };
b1a6f49b21dd GDCM decoder sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 }