Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerContext.cpp @ 4465:fe774d8e904b
New configuration option: "DicomScuPreferredTransferSyntax" to control transcoding in C-STORE SCU
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 21 Jan 2021 17:08:32 +0100 |
parents | 6831de40acd9 |
children | 68f52897c119 |
comparison
equal
deleted
inserted
replaced
4464:e8c7be7a02a9 | 4465:fe774d8e904b |
---|---|
305 overwriteInstances_(false), | 305 overwriteInstances_(false), |
306 dcmtkTranscoder_(new DcmtkTranscoder), | 306 dcmtkTranscoder_(new DcmtkTranscoder), |
307 isIngestTranscoding_(false), | 307 isIngestTranscoding_(false), |
308 ingestTranscodingOfUncompressed_(true), | 308 ingestTranscodingOfUncompressed_(true), |
309 ingestTranscodingOfCompressed_(true), | 309 ingestTranscodingOfCompressed_(true), |
310 preferredTransferSyntax_(DicomTransferSyntax_LittleEndianExplicit), | |
310 deidentifyLogs_(false) | 311 deidentifyLogs_(false) |
311 { | 312 { |
312 try | 313 try |
313 { | 314 { |
314 unsigned int lossyQuality; | 315 unsigned int lossyQuality; |
345 { | 346 { |
346 isIngestTranscoding_ = true; | 347 isIngestTranscoding_ = true; |
347 LOG(WARNING) << "Incoming DICOM instances will automatically be transcoded to " | 348 LOG(WARNING) << "Incoming DICOM instances will automatically be transcoded to " |
348 << "transfer syntax: " << GetTransferSyntaxUid(ingestTransferSyntax_); | 349 << "transfer syntax: " << GetTransferSyntaxUid(ingestTransferSyntax_); |
349 | 350 |
351 // New options in Orthanc 1.8.2 | |
350 ingestTranscodingOfUncompressed_ = lock.GetConfiguration().GetBooleanParameter("IngestTranscodingOfUncompressed", true); | 352 ingestTranscodingOfUncompressed_ = lock.GetConfiguration().GetBooleanParameter("IngestTranscodingOfUncompressed", true); |
351 ingestTranscodingOfCompressed_ = lock.GetConfiguration().GetBooleanParameter("IngestTranscodingOfCompressed", true); | 353 ingestTranscodingOfCompressed_ = lock.GetConfiguration().GetBooleanParameter("IngestTranscodingOfCompressed", true); |
352 | 354 |
353 LOG(WARNING) << " Ingest transcoding will " | 355 LOG(WARNING) << " Ingest transcoding will " |
354 << (ingestTranscodingOfUncompressed_ ? "be applied" : "*not* be applied") | 356 << (ingestTranscodingOfUncompressed_ ? "be applied" : "*not* be applied") |
368 { | 370 { |
369 isIngestTranscoding_ = false; | 371 isIngestTranscoding_ = false; |
370 LOG(INFO) << "Automated transcoding of incoming DICOM instances is disabled"; | 372 LOG(INFO) << "Automated transcoding of incoming DICOM instances is disabled"; |
371 } | 373 } |
372 | 374 |
375 // New options in Orthanc 1.8.2 | |
373 if (lock.GetConfiguration().GetBooleanParameter("DeidentifyLogs", true)) | 376 if (lock.GetConfiguration().GetBooleanParameter("DeidentifyLogs", true)) |
374 { | 377 { |
375 deidentifyLogs_ = true; | 378 deidentifyLogs_ = true; |
376 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is enabled"; | 379 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is enabled"; |
377 | 380 |
385 else | 388 else |
386 { | 389 { |
387 deidentifyLogs_ = false; | 390 deidentifyLogs_ = false; |
388 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is disabled"; | 391 CLOG(INFO, DICOM) << "Deidentification of log contents (notably for DIMSE queries) is disabled"; |
389 } | 392 } |
393 | |
394 // New option in Orthanc 1.9.0 | |
395 if (lock.GetConfiguration().LookupStringParameter(s, "DicomScuPreferredTransferSyntax") && | |
396 !LookupTransferSyntax(preferredTransferSyntax_, s)) | |
397 { | |
398 throw OrthancException(ErrorCode_ParameterOutOfRange, | |
399 "Unknown preferred transfer syntax: " + s); | |
400 } | |
401 | |
402 CLOG(INFO, DICOM) << "Preferred transfer syntax for Orthanc C-STORE SCU: " | |
403 << GetTransferSyntaxUid(preferredTransferSyntax_); | |
390 } | 404 } |
391 | 405 |
392 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); | 406 jobsEngine_.SetThreadSleep(unitTesting ? 20 : 200); |
393 | 407 |
394 listeners_.push_back(ServerListener(luaListener_, "Lua")); | 408 listeners_.push_back(ServerListener(luaListener_, "Lua")); |
1716 connection.Store(sopClassUid, sopInstanceUid, data, dicom.size(), | 1730 connection.Store(sopClassUid, sopInstanceUid, data, dicom.size(), |
1717 hasMoveOriginator, moveOriginatorAet, moveOriginatorId); | 1731 hasMoveOriginator, moveOriginatorAet, moveOriginatorId); |
1718 } | 1732 } |
1719 else | 1733 else |
1720 { | 1734 { |
1721 connection.Transcode(sopClassUid, sopInstanceUid, *this, data, dicom.size(), | 1735 connection.Transcode(sopClassUid, sopInstanceUid, *this, data, dicom.size(), preferredTransferSyntax_, |
1722 hasMoveOriginator, moveOriginatorAet, moveOriginatorId); | 1736 hasMoveOriginator, moveOriginatorAet, moveOriginatorId); |
1723 } | 1737 } |
1724 } | 1738 } |
1725 | 1739 |
1726 | 1740 |