Skip to content

Commit f6484b7

Browse files
committed
More documentation of display2D and display3D
1 parent 8a48bd6 commit f6484b7

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

source/FAST/Visualization/Shortcuts.hpp

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ class ImagePyramid;
1212

1313
#ifndef SWIG
1414

15+
/**
16+
* @defgroup shortcuts Shortcuts
17+
* Functions for reducing boiler plate code such as display2D and display3D.
18+
*/
19+
1520
/**
1621
* @brief Arguments for display2D function.
22+
* @ingroup shortcuts
1723
*/
1824
struct Display2DArgs {
1925
std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<ProcessObject>> image; /**< Source of Image data to display (optional) **/
@@ -34,13 +40,13 @@ struct Display2DArgs {
3440
float vertexMinSize = 1.0f;
3541
Color vertexColor = Color::Null();
3642
float vertexOpacity = 1.0f;
37-
Color bgcolor = Color::White();
38-
int width = 0;
39-
int height = 0;
40-
std::optional<int> timeout;
41-
bool renderToImage = false;
42-
bool returnWindow = false;
43-
std::variant<std::monostate, std::vector<QWidget*>, std::map<WidgetPosition, std::vector<QWidget*>>> widgets;
43+
Color bgcolor = Color::White(); /**< Background color to use for the View. **/
44+
int width = 0; /**< Width of window, set to 0 to use default width. **/
45+
int height = 0; /**< Height of window, set to 0 to use default height. **/
46+
std::optional<int> timeout; /**< Milliseconds until closing window automatically. If not setm the window will not automatically close. **/
47+
bool renderToImage = false; /**< If set to true, the data is rendered to an Image and returned, instead of displaying it using a window. **/
48+
bool returnWindow = false; /**< If set to true, the window is returned by the function, else display2D will call run on the window and return nothing. **/
49+
std::variant<std::monostate, std::vector<QWidget*>, std::map<WidgetPosition, std::vector<QWidget*>>> widgets; /**< Widgets to attach to window. **/
4450
};
4551

4652
/**
@@ -54,39 +60,42 @@ struct Display2DArgs {
5460
* @param args See the Display2DArgs struct
5561
* @return A variant which is either empty, Window or Image depending on the choice of Display2DArgs.returnWindow
5662
* and Display2DArgs.renderToImage
63+
* @ingroup shortcuts
5764
*/
5865
FAST_EXPORT std::variant<std::monostate, Window::pointer, Image::pointer> display2D(Display2DArgs args);
5966

6067
/**
6168
* @brief Enum to choose how to display 3D data in display3D
6269
* @sa display3D
70+
* @ingroup shortcuts
6371
*/
6472
enum class DisplayType {
65-
SLICER = 1,
66-
ALPHA_BLENDING = 2,
67-
MAXIMUM_INTENSITY_PROJECTION = 3
73+
SLICER = 1, /**< Display 3D image and segmentation using SlicerWindow. **/
74+
ALPHA_BLENDING = 2, /**< Display 3D image using AlphaBlendingVolumeRenderer. **/
75+
MAXIMUM_INTENSITY_PROJECTION = 3 /**< Display 3D image using MaximumIntensityProjection. **/
6876
};
6977

7078
/**
7179
* @brief Arguments for display3D function.
80+
* @ingroup shortcuts
7281
*/
7382
struct Display3DArgs {
74-
std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<ProcessObject>> image;
75-
std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<ProcessObject>> segmentation;
76-
std::optional<float> intensityLevel;
77-
std::optional<float> intensityWindow;
83+
std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<ProcessObject>> image; /**< Source of Image data to display (optional) **/
84+
std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<ProcessObject>> segmentation; /**< Source of segmentation Image data to display (optional) **/
85+
std::optional<float> intensityLevel; /**< Intensity level used by ImageRenderer. Only used with DisplayType::SLICER **/
86+
std::optional<float> intensityWindow; /**< Intensity window used by ImageRenderer. Only used with DisplayType::SLICER **/
7887
LabelColors segmentationColors;
7988
float segmentationOpacity = 0.5f;
8089
float segmentationBorderOpacity = -1.0f;
8190
int segmentationBorderRadius = 1;
82-
TransferFunction transferFunction;
91+
TransferFunction transferFunction; /**< Transfer function to use by AlphaBlendingVolumeRenderer when displayType == DisplayType::ALPHA_BLENDING **/
8392
DisplayType displayType = DisplayType::SLICER;
84-
Color bgcolor = Color::White();
85-
int width = 0;
86-
int height = 0;
87-
std::optional<int> timeout;
88-
bool returnWindow = false;
89-
std::variant<std::monostate, std::vector<QWidget*>, std::map<WidgetPosition, std::vector<QWidget*>>> widgets;
93+
Color bgcolor = Color::White(); /**< Background color to use for the View. **/
94+
int width = 0; /**< Width of window, set to 0 to use default width. **/
95+
int height = 0; /**< Height of window, set to 0 to use default height. **/
96+
std::optional<int> timeout; /**< Milliseconds until closing window automatically. If not setm the window will not automatically close. **/
97+
bool returnWindow = false; /**< If set to true, the window is returned by the function, else display2D will call run on the window and return nothing. **/
98+
std::variant<std::monostate, std::vector<QWidget*>, std::map<WidgetPosition, std::vector<QWidget*>>> widgets; /**< Widgets to attach to window. **/
9099
};
91100

92101
/**
@@ -103,6 +112,7 @@ struct Display3DArgs {
103112
*
104113
* @param args See the Display3DArgs struct
105114
* @return A variant which is either empty or a Window depending on whether Display3DArgs.returnWindow is set to true or not.
115+
* @ingroup shortcuts
106116
*/
107117
FAST_EXPORT std::variant<std::monostate, Window::pointer> display3D(Display3DArgs args);
108118

0 commit comments

Comments
 (0)