Mercurial > hg > orthanc-stone
comparison Framework/Enumerations.cpp @ 142:f19194a11c1d wasm
ComputeWindowing in Enumerations.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 Jan 2018 18:12:42 +0100 |
parents | e2fe9352f240 |
children | a7674c0ae4ac |
comparison
equal
deleted
inserted
replaced
141:88bca952cb17 | 142:f19194a11c1d |
---|---|
20 | 20 |
21 | 21 |
22 #include "Enumerations.h" | 22 #include "Enumerations.h" |
23 | 23 |
24 #include <Core/Logging.h> | 24 #include <Core/Logging.h> |
25 #include <Core/OrthancException.h> | |
25 | 26 |
26 namespace OrthancStone | 27 namespace OrthancStone |
27 { | 28 { |
28 bool StringToSopClassUid(SopClassUid& result, | 29 bool StringToSopClassUid(SopClassUid& result, |
29 const std::string& source) | 30 const std::string& source) |
37 { | 38 { |
38 //LOG(INFO) << "Unknown SOP class UID: " << source; | 39 //LOG(INFO) << "Unknown SOP class UID: " << source; |
39 return false; | 40 return false; |
40 } | 41 } |
41 } | 42 } |
43 | |
44 | |
45 void ComputeWindowing(float& targetCenter, | |
46 float& targetWidth, | |
47 ImageWindowing windowing, | |
48 float defaultCenter, | |
49 float defaultWidth) | |
50 { | |
51 switch (windowing) | |
52 { | |
53 case ImageWindowing_Default: | |
54 targetCenter = defaultCenter; | |
55 targetWidth = defaultWidth; | |
56 break; | |
57 | |
58 case ImageWindowing_Bone: | |
59 targetCenter = 300; | |
60 targetWidth = 2000; | |
61 break; | |
62 | |
63 case ImageWindowing_Lung: | |
64 targetCenter = -600; | |
65 targetWidth = 1600; | |
66 break; | |
67 | |
68 default: | |
69 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | |
70 } | |
71 } | |
42 } | 72 } |