Mercurial > hg > orthanc-java
comparison JavaSDK/be/uclouvain/orthanc/DicomWebBinaryMode.java @ 0:3ecef5782f2c
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Oct 2023 17:59:44 +0200 |
parents | |
children | 26c08ff926a3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3ecef5782f2c |
---|---|
1 package be.uclouvain.orthanc; | |
2 | |
3 /** | |
4 * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium | |
5 * SPDX-License-Identifier: GPL-3.0-or-later | |
6 */ | |
7 | |
8 /** | |
9 * Java plugin for Orthanc | |
10 * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium | |
11 * | |
12 * This program is free software: you can redistribute it and/or | |
13 * modify it under the terms of the GNU General Public License as | |
14 * published by the Free Software Foundation, either version 3 of the | |
15 * License, or (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, but | |
18 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 * General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program. If not, see http://www.gnu.org/licenses/. | |
24 **/ | |
25 | |
26 | |
27 /** | |
28 * The available modes to export a binary DICOM tag into a DICOMweb JSON or XML | |
29 * document. | |
30 **/ | |
31 public enum DicomWebBinaryMode { | |
32 /** | |
33 * Don't include binary tags | |
34 **/ | |
35 IGNORE(0), | |
36 /** | |
37 * Inline encoding using Base64 | |
38 **/ | |
39 INLINE_BINARY(1), | |
40 /** | |
41 * Use a bulk data URI field | |
42 **/ | |
43 BULK_DATA_URI(2); | |
44 | |
45 private int value; | |
46 | |
47 private DicomWebBinaryMode(int value) { | |
48 this.value = value; | |
49 } | |
50 | |
51 /** | |
52 * Return the enumeration value that corresponds to an integer value of interest. | |
53 * @param value The integer value. | |
54 * @return The enumeration value. | |
55 **/ | |
56 protected static DicomWebBinaryMode getInstance(int value) { | |
57 if (value == 0) { | |
58 return IGNORE; | |
59 } | |
60 if (value == 1) { | |
61 return INLINE_BINARY; | |
62 } | |
63 if (value == 2) { | |
64 return BULK_DATA_URI; | |
65 } | |
66 | |
67 throw new IllegalArgumentException("Value out of range for enumeration DicomWebBinaryMode: " + value); | |
68 } | |
69 | |
70 /** | |
71 * Get the integer value corresponding to this enumeration value. | |
72 * @return The integer value. | |
73 **/ | |
74 public int getValue() { | |
75 return value; | |
76 } | |
77 } |