Slicer
5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
Modules
Loadable
Colors
VTKWidgets
vtkSlicerScalarBarActor.h
Go to the documentation of this file.
1
/*==============================================================================
2
3
Program: 3D Slicer
4
5
Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6
7
See COPYRIGHT.txt
8
or http://www.slicer.org/copyright/copyright.txt for details.
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
16
This file was originally developed by Kevin Wang, Princess Margaret Cancer Centre
17
and was supported by Cancer Care Ontario (CCO)'s ACRU program
18
with funds provided by the Ontario Ministry of Health and Long-Term Care
19
and Ontario Consortium for Adaptive Interventions in Radiation Oncology (OCAIRO)
20
21
==============================================================================*/
22
27
28
#ifndef __vtkSlicerScalarBarActor_h
29
#define __vtkSlicerScalarBarActor_h
30
31
// VTK includes
32
#include "vtkScalarBarActor.h"
33
#include "vtkStringArray.h"
34
#include "vtkVersion.h"
35
36
// MRMLLogic includes
37
#include "vtkSlicerColorsModuleVTKWidgetsExport.h"
38
39
class
VTK_SLICER_COLORS_VTKWIDGETS_EXPORT
vtkSlicerScalarBarActor
:
public
vtkScalarBarActor
40
{
41
public
:
42
// The usual VTK class functions
43
static
vtkSlicerScalarBarActor
*
New
();
44
vtkTypeMacro(
vtkSlicerScalarBarActor
, vtkScalarBarActor);
45
void
PrintSelf
(ostream& os, vtkIndent indent)
override
;
46
48
vtkGetMacro(
UseAnnotationAsLabel
,
int
);
50
vtkSetMacro(
UseAnnotationAsLabel
,
int
);
52
vtkBooleanMacro(
UseAnnotationAsLabel
,
int
);
53
56
vtkGetMacro(
CenterLabel
,
bool
);
59
vtkSetMacro(
CenterLabel
,
bool
);
62
vtkBooleanMacro(
CenterLabel
,
bool
);
63
64
protected
:
65
vtkSlicerScalarBarActor
();
66
~vtkSlicerScalarBarActor
()
override
;
67
68
// Description:
69
// Determine the size and placement of any tick marks to be rendered.
70
//
71
// This method must set this->P->TickBox.
72
// It may depend on layout performed by ComputeScalarBarLength.
73
//
74
// The default implementation creates exactly this->NumberOfLabels
75
// tick marks, uniformly spaced on a linear or logarithmic scale.
76
//
77
// It centers labels on color swatches instead of placing labels
78
// at the edge.
79
void
LayoutTicks
()
override
;
80
81
// It centers labels on color swatches instead of placing labels
82
// at the edge.
83
void
ConfigureTicks
()
override
;
84
85
// Modify original behavior by aligning title to the left/right when orientation is vertical.
86
// This allows moving the color bar to the edge of the view, even if the title is long.
87
void
PrepareTitleText
()
override
;
88
void
ConfigureTitle
()
override
;
89
93
static
bool
ValidateFormatString
(std::string& validatedFormat, std::string& prefix, std::string& suffix,
const
std::string& requestedFormat,
const
std::string& typeString);
94
96
int
UseAnnotationAsLabel
;
97
98
bool
CenterLabel
;
99
100
private
:
101
vtkSlicerScalarBarActor
(
const
vtkSlicerScalarBarActor
&) =
delete
;
102
void
operator=(
const
vtkSlicerScalarBarActor
&) =
delete
;
103
};
104
105
#endif
vtkSlicerScalarBarActor::ValidateFormatString
static bool ValidateFormatString(std::string &validatedFormat, std::string &prefix, std::string &suffix, const std::string &requestedFormat, const std::string &typeString)
vtkSlicerScalarBarActor::LayoutTicks
void LayoutTicks() override
vtkSlicerScalarBarActor::PrepareTitleText
void PrepareTitleText() override
vtkSlicerScalarBarActor::ConfigureTitle
void ConfigureTitle() override
vtkSlicerScalarBarActor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSlicerScalarBarActor::UseAnnotationAsLabel
int UseAnnotationAsLabel
flag for setting color name as label
Definition
vtkSlicerScalarBarActor.h:96
vtkSlicerScalarBarActor::CenterLabel
bool CenterLabel
Definition
vtkSlicerScalarBarActor.h:98
vtkSlicerScalarBarActor::vtkSlicerScalarBarActor
vtkSlicerScalarBarActor()
vtkSlicerScalarBarActor::ConfigureTicks
void ConfigureTicks() override
vtkSlicerScalarBarActor::New
static vtkSlicerScalarBarActor * New()
vtkSlicerScalarBarActor::~vtkSlicerScalarBarActor
~vtkSlicerScalarBarActor() override
Generated on Wed Sep 3 2025 23:51:42 for Slicer by
1.13.0