Mercurial > hg > orthanc
annotate OrthancFramework/Sources/DicomFormat/DicomInstanceHasher.h @ 5853:4d932683049d get-scu tip
very first implementation of C-Get SCU
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Tue, 29 Oct 2024 17:25:49 +0100 |
parents | f7adfb22e20e |
children |
rev | line source |
---|---|
178 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5640
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
f7adfb22e20e
updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5485
diff
changeset
|
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium |
5485
48b8dae6dc77
upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
178 | 8 * |
9 * This program is free software: you can redistribute it and/or | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
10 * modify it under the terms of the GNU Lesser General Public License |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
11 * as published by the Free Software Foundation, either version 3 of |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
12 * the License, or (at your option) any later version. |
178 | 13 * |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
17 * Lesser General Public License for more details. |
178 | 18 * |
4119
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
19 * You should have received a copy of the GNU Lesser General Public |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
20 * License along with this program. If not, see |
bf7b9edf6b81
re-licensing the OrthancFramework to LGPL, in order to license Stone of Orthanc under LGPL
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4110
diff
changeset
|
21 * <http://www.gnu.org/licenses/>. |
178 | 22 **/ |
23 | |
24 | |
25 #pragma once | |
26 | |
27 #include "DicomMap.h" | |
28 | |
29 namespace Orthanc | |
30 { | |
31 /** | |
32 * This class implements the hashing mechanism that is used to | |
33 * convert DICOM unique identifiers to Orthanc identifiers. Any | |
34 * Orthanc identifier for a DICOM resource corresponds to the SHA-1 | |
35 * hash of the DICOM identifiers. | |
36 | |
37 * \note SHA-1 hash is used because it is less sensitive to | |
38 * collision attacks than MD5. <a | |
39 * href="http://en.wikipedia.org/wiki/SHA-256#Comparison_of_SHA_functions">[Reference]</a> | |
40 **/ | |
4110
d99739cbe94c
make DicomInstanceHasher and ParsedDicomDir public classes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
41 class ORTHANC_PUBLIC DicomInstanceHasher |
178 | 42 { |
43 private: | |
44 std::string patientId_; | |
179 | 45 std::string studyUid_; |
178 | 46 std::string seriesUid_; |
179 | 47 std::string instanceUid_; |
48 | |
4985 | 49 mutable std::string patientHash_; |
50 mutable std::string studyHash_; | |
51 mutable std::string seriesHash_; | |
52 mutable std::string instanceHash_; | |
178 | 53 |
315 | 54 void Setup(const std::string& patientId, |
55 const std::string& studyUid, | |
56 const std::string& seriesUid, | |
57 const std::string& instanceUid); | |
58 | |
178 | 59 public: |
4199 | 60 explicit DicomInstanceHasher(const DicomMap& instance); |
178 | 61 |
315 | 62 DicomInstanceHasher(const std::string& patientId, |
63 const std::string& studyUid, | |
64 const std::string& seriesUid, | |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
65 const std::string& instanceUid); |
315 | 66 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
67 const std::string& GetPatientId() const; |
178 | 68 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
69 const std::string& GetStudyUid() const; |
178 | 70 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
71 const std::string& GetSeriesUid() const; |
178 | 72 |
4296
3b70a2e6a06c
moving inline methods to source files for ABI compatibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4199
diff
changeset
|
73 const std::string& GetInstanceUid() const; |
178 | 74 |
4985 | 75 const std::string& HashPatient() const; |
178 | 76 |
4985 | 77 const std::string& HashStudy() const; |
178 | 78 |
4985 | 79 const std::string& HashSeries() const; |
178 | 80 |
4985 | 81 const std::string& HashInstance() const; |
178 | 82 }; |
83 } |