Mercurial > hg > orthanc
comparison Core/DicomNetworking/RemoteModalityParameters.cpp @ 3785:763533d6dd67 SylvainRouquette/fix-issue169-95b752c
add PreferredTransferSyntax to RemoteModalityParameters
DicomUserConnection can now use RemoteModalityParameters.PreferredTransferSyntax instead of using the default transfer syntax (LE-implicit).
This way we can transcode by default in LE-explicit.
fix issue #169
author | sylvain.rouquette@incepto-medical.com |
---|---|
date | Wed, 18 Mar 2020 08:59:06 +0100 |
parents | 4e43e67f8ecf |
children | 3801435e34a1 |
comparison
equal
deleted
inserted
replaced
3541:4beabcea3a5c | 3785:763533d6dd67 |
---|---|
36 | 36 |
37 #include "../Logging.h" | 37 #include "../Logging.h" |
38 #include "../OrthancException.h" | 38 #include "../OrthancException.h" |
39 #include "../SerializationToolbox.h" | 39 #include "../SerializationToolbox.h" |
40 | 40 |
41 #include <dcmtk/dcmdata/dcuid.h> | |
42 | |
41 #include <boost/lexical_cast.hpp> | 43 #include <boost/lexical_cast.hpp> |
42 #include <stdexcept> | 44 #include <stdexcept> |
43 | 45 |
44 | 46 |
45 static const char* KEY_AET = "AET"; | 47 static const char* KEY_AET = "AET"; |
47 static const char* KEY_ALLOW_FIND = "AllowFind"; | 49 static const char* KEY_ALLOW_FIND = "AllowFind"; |
48 static const char* KEY_ALLOW_GET = "AllowGet"; | 50 static const char* KEY_ALLOW_GET = "AllowGet"; |
49 static const char* KEY_ALLOW_MOVE = "AllowMove"; | 51 static const char* KEY_ALLOW_MOVE = "AllowMove"; |
50 static const char* KEY_ALLOW_STORE = "AllowStore"; | 52 static const char* KEY_ALLOW_STORE = "AllowStore"; |
51 static const char* KEY_HOST = "Host"; | 53 static const char* KEY_HOST = "Host"; |
54 static const char* KEY_PREFERRED_TRANSFER_SYNTAX = "PreferredTransferSyntax"; | |
52 static const char* KEY_MANUFACTURER = "Manufacturer"; | 55 static const char* KEY_MANUFACTURER = "Manufacturer"; |
53 static const char* KEY_PORT = "Port"; | 56 static const char* KEY_PORT = "Port"; |
54 | 57 |
55 | 58 |
56 namespace Orthanc | 59 namespace Orthanc |
57 { | 60 { |
58 void RemoteModalityParameters::Clear() | 61 void RemoteModalityParameters::Clear() |
59 { | 62 { |
60 aet_ = "ORTHANC"; | 63 aet_ = "ORTHANC"; |
61 host_ = "127.0.0.1"; | 64 host_ = "127.0.0.1"; |
65 preferredTransferSyntax_ = UID_LittleEndianImplicitTransferSyntax; | |
62 port_ = 104; | 66 port_ = 104; |
63 manufacturer_ = ModalityManufacturer_Generic; | 67 manufacturer_ = ModalityManufacturer_Generic; |
64 allowEcho_ = true; | 68 allowEcho_ = true; |
65 allowStore_ = true; | 69 allowStore_ = true; |
66 allowFind_ = true; | 70 allowFind_ = true; |
165 { | 169 { |
166 assert(serialized.type() == Json::objectValue); | 170 assert(serialized.type() == Json::objectValue); |
167 | 171 |
168 aet_ = SerializationToolbox::ReadString(serialized, KEY_AET); | 172 aet_ = SerializationToolbox::ReadString(serialized, KEY_AET); |
169 host_ = SerializationToolbox::ReadString(serialized, KEY_HOST); | 173 host_ = SerializationToolbox::ReadString(serialized, KEY_HOST); |
174 preferredTransferSyntax_ = SerializationToolbox::ReadString(serialized, KEY_PREFERRED_TRANSFER_SYNTAX); | |
170 | 175 |
171 if (serialized.isMember(KEY_PORT)) | 176 if (serialized.isMember(KEY_PORT)) |
172 { | 177 { |
173 port_ = ReadPortNumber(serialized[KEY_PORT]); | 178 port_ = ReadPortNumber(serialized[KEY_PORT]); |
174 } | 179 } |
287 IsAdvancedFormatNeeded()) | 292 IsAdvancedFormatNeeded()) |
288 { | 293 { |
289 target = Json::objectValue; | 294 target = Json::objectValue; |
290 target[KEY_AET] = aet_; | 295 target[KEY_AET] = aet_; |
291 target[KEY_HOST] = host_; | 296 target[KEY_HOST] = host_; |
297 target[KEY_PREFERRED_TRANSFER_SYNTAX] = preferredTransferSyntax_; | |
292 target[KEY_PORT] = port_; | 298 target[KEY_PORT] = port_; |
293 target[KEY_MANUFACTURER] = EnumerationToString(manufacturer_); | 299 target[KEY_MANUFACTURER] = EnumerationToString(manufacturer_); |
294 target[KEY_ALLOW_ECHO] = allowEcho_; | 300 target[KEY_ALLOW_ECHO] = allowEcho_; |
295 target[KEY_ALLOW_STORE] = allowStore_; | 301 target[KEY_ALLOW_STORE] = allowStore_; |
296 target[KEY_ALLOW_FIND] = allowFind_; | 302 target[KEY_ALLOW_FIND] = allowFind_; |