Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/GrayscaleStyleConfigurator.h @ 1808:797633f48a9c
display series description if hovering pdf or video
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 May 2021 17:28:16 +0200 |
parents | 9ac2a65d4172 |
children | 3889ae96d2e9 |
rev | line source |
---|---|
814 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1739
9ac2a65d4172
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
814 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public License |
814 | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
15 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
16 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
18 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
19 * <http://www.gnu.org/licenses/>. |
814 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "ILayerStyleConfigurator.h" | |
26 | |
27 namespace OrthancStone | |
28 { | |
29 /** | |
30 Creates layers to display the supplied image in grayscale. No dynamic | |
31 style is available. | |
32 */ | |
33 class GrayscaleStyleConfigurator : public ILayerStyleConfigurator | |
34 { | |
35 private: | |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
36 uint64_t revision_; |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
37 bool linearInterpolation_; |
1209
b5dec783ba08
Fixed the style configurator to only set inversion on the image if it has been
Benjamin Golinvaux <bgo@osimis.io>
parents:
1061
diff
changeset
|
38 bool hasWindowingOverride_; |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
39 ImageWindowing windowing_; |
913
2b4b6b86520a
Re-enabled gl debug output in GuiAdapter +
Benjamin Golinvaux <bgo@osimis.io>
parents:
836
diff
changeset
|
40 float customWindowWidth_; |
2b4b6b86520a
Re-enabled gl debug output in GuiAdapter +
Benjamin Golinvaux <bgo@osimis.io>
parents:
836
diff
changeset
|
41 float customWindowCenter_; |
1209
b5dec783ba08
Fixed the style configurator to only set inversion on the image if it has been
Benjamin Golinvaux <bgo@osimis.io>
parents:
1061
diff
changeset
|
42 bool hasInversionOverride_; |
914
4d1f57773b5b
Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents:
913
diff
changeset
|
43 bool inverted_; |
1163 | 44 bool applyLog_; |
814 | 45 |
46 public: | |
1179
177e7d431cd1
log scale in textures, remove redundant code for LUTs
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1163
diff
changeset
|
47 GrayscaleStyleConfigurator(); |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
48 |
836 | 49 void SetWindowing(ImageWindowing windowing); |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
50 |
1061
eb28dfe432f7
fixed typo in assert. msg. + getters for custom windowing in grayscale layer configurator.
Benjamin Golinvaux <bgo@osimis.io>
parents:
914
diff
changeset
|
51 void SetCustomWindowing(float windowCenter, float windowWidth); |
eb28dfe432f7
fixed typo in assert. msg. + getters for custom windowing in grayscale layer configurator.
Benjamin Golinvaux <bgo@osimis.io>
parents:
914
diff
changeset
|
52 |
eb28dfe432f7
fixed typo in assert. msg. + getters for custom windowing in grayscale layer configurator.
Benjamin Golinvaux <bgo@osimis.io>
parents:
914
diff
changeset
|
53 void GetCustomWindowing(float& windowCenter, float& windowWidth) const; |
913
2b4b6b86520a
Re-enabled gl debug output in GuiAdapter +
Benjamin Golinvaux <bgo@osimis.io>
parents:
836
diff
changeset
|
54 |
914
4d1f57773b5b
Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents:
913
diff
changeset
|
55 void SetInverted(bool inverted); |
4d1f57773b5b
Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents:
913
diff
changeset
|
56 |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
57 void SetLinearInterpolation(bool enabled); |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
58 |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
59 bool IsLinearInterpolation() const |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
60 { |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
61 return linearInterpolation_; |
814 | 62 } |
63 | |
1163 | 64 void SetApplyLog(bool apply); |
65 | |
66 bool IsApplyLog() const | |
67 { | |
68 return applyLog_; | |
69 } | |
70 | |
1571 | 71 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE |
814 | 72 { |
73 return revision_; | |
74 } | |
75 | |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
76 virtual TextureBaseSceneLayer* CreateTextureFromImage( |
1571 | 77 const Orthanc::ImageAccessor& image) const ORTHANC_OVERRIDE; |
814 | 78 |
835
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
79 virtual TextureBaseSceneLayer* CreateTextureFromDicom( |
0965b665c653
windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
814
diff
changeset
|
80 const Orthanc::ImageAccessor& frame, |
1571 | 81 const DicomInstanceParameters& parameters) const ORTHANC_OVERRIDE; |
814 | 82 |
1571 | 83 virtual void ApplyStyle(ISceneLayer& layer) const ORTHANC_OVERRIDE; |
814 | 84 }; |
85 } |