annotate OrthancStone/Sources/Scene2D/GrayscaleStyleConfigurator.h @ 1910:f81cdf283859

display RT-STRUCT before the referenced slices get loaded
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Feb 2022 10:40:35 +0100
parents 7053b8a0aaec
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * 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
9 * modify it under the terms of the GNU Lesser General Public License
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * 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
15 * 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
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
17 *
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
18 * 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
19 * 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
20 * <http://www.gnu.org/licenses/>.
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "ILayerStyleConfigurator.h"
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 namespace OrthancStone
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 /**
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 Creates layers to display the supplied image in grayscale. No dynamic
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 style is available.
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 */
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 class GrayscaleStyleConfigurator : public ILayerStyleConfigurator
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 private:
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
37 uint64_t revision_;
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
38 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
39 bool hasWindowingOverride_;
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
40 ImageWindowing windowing_;
913
2b4b6b86520a Re-enabled gl debug output in GuiAdapter +
Benjamin Golinvaux <bgo@osimis.io>
parents: 836
diff changeset
41 float customWindowWidth_;
2b4b6b86520a Re-enabled gl debug output in GuiAdapter +
Benjamin Golinvaux <bgo@osimis.io>
parents: 836
diff changeset
42 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
43 bool hasInversionOverride_;
914
4d1f57773b5b Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents: 913
diff changeset
44 bool inverted_;
1163
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
45 bool applyLog_;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 public:
1179
177e7d431cd1 log scale in textures, remove redundant code for LUTs
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1163
diff changeset
48 GrayscaleStyleConfigurator();
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
49
836
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 835
diff changeset
50 void SetWindowing(ImageWindowing windowing);
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
51
1061
eb28dfe432f7 fixed typo in assert. msg. + getters for custom windowing in grayscale layer configurator.
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
52 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
53
eb28dfe432f7 fixed typo in assert. msg. + getters for custom windowing in grayscale layer configurator.
Benjamin Golinvaux <bgo@osimis.io>
parents: 914
diff changeset
54 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
55
914
4d1f57773b5b Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents: 913
diff changeset
56 void SetInverted(bool inverted);
4d1f57773b5b Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
Benjamin Golinvaux <bgo@osimis.io>
parents: 913
diff changeset
57
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
58 void SetLinearInterpolation(bool enabled);
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
59
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
60 bool IsLinearInterpolation() const
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
61 {
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
62 return linearInterpolation_;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
1163
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
65 void SetApplyLog(bool apply);
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
66
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
67 bool IsApplyLog() const
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
68 {
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
69 return applyLog_;
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
70 }
ba9db2ad317c test log
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1061
diff changeset
71
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
72 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 {
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 return revision_;
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
77 virtual TextureBaseSceneLayer* CreateTextureFromImage(
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
78 const Orthanc::ImageAccessor& image) const ORTHANC_OVERRIDE;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
835
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
80 virtual TextureBaseSceneLayer* CreateTextureFromDicom(
0965b665c653 windowing and linear interpolation in GrayscaleStyleConfigurator
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 814
diff changeset
81 const Orthanc::ImageAccessor& frame,
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
82 const DicomInstanceParameters& parameters) const ORTHANC_OVERRIDE;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
84 virtual void ApplyStyle(ISceneLayer& layer) const ORTHANC_OVERRIDE;
814
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 };
aead999345e0 reorganization
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 }