fast::SlicerWindow class

Window for showing slices of 3D data.

This window shows 3 views with slices of the volume data in three different directions (X, Y, Z). This windows features a slider for each view which controls which slice of the volume is being displayed. It also has a widget for controlling intensity window and level which is often needed for CT and MRI data. Use the SlicerWindow::connectImage and SlicerWindow::connectSegmentation methods to connect data to this window. The window will setup the appropriate renderers for you.

Base classes

class Window
Abstract base class for windows.

Public functions

auto create(Color bgcolor, uint width, uint height) -> std::shared_ptr<SlicerWindow>
Create instance.
auto connectImage(std::shared_ptr<ProcessObject> processObject, float level = -1, float window = -1, uint outputPortID = 0) -> std::shared_ptr<SlicerWindow>
Connect an 3D image source to this window.
auto connectImage(std::shared_ptr<Image> image, float level = -1, float window = -1) -> std::shared_ptr<SlicerWindow>
Connect a 3D image to this window.
auto connectSegmentation(std::shared_ptr<ProcessObject> processObject, LabelColors colors = LabelColors(), float opacity = -1, float borderOpacity = -1.0f, int borderRadius = -1, uint outputPortID = 0) -> std::shared_ptr<SlicerWindow>
Connect a 3D segmentation soruce to this window.
auto connectSegmentation(std::shared_ptr<Image> image, LabelColors colors = LabelColors(), float opacity = 0.5f, float borderOpacity = -1.0f, int borderRadius = 1) -> std::shared_ptr<SlicerWindow>
Connect a 3D segmentation to this window.
void setTextLabels(LabelNames labelNames, LabelColors labelColors = LabelColors(), float areaThreshold = 1.0f)
auto connect(uint id, std::shared_ptr<DataObject> data) -> std::shared_ptr<Window> override
auto connect(uint id, std::shared_ptr<ProcessObject> PO, uint portID = 0) -> std::shared_ptr<Window> override
auto getNameOfClass() -> std::string
void setBorderRadius(int radius)
void setOpacity(float opacity, float borderOpacity = -1)
void setBorderOpacity(float borderOpacity)
auto getOpacity() const -> float
auto getBorderOpacity() const -> float
auto getBorderRadius() const -> int
void loadAttributes() override

Protected functions

void createLayout()

Protected variables

std::map<PlaneType, std::vector<SegmentationRenderer::pointer>> m_segmentationRenderers
ImageRenderer::pointer m_imageRenderers
SegmentationLabelRenderer::pointer m_labelRenderers
std::map<PlaneType, std::vector<ImageSlicer::pointer>> m_slicers
QSlider* m_sliderWidgets
QSlider* m_levelSlider
QSlider* m_windowSlider
PlaneType m_slicePlanes
int m_borderRadius
float m_borderOpacity
float m_opacity
LabelColors m_labelColors

Function documentation

std::shared_ptr<SlicerWindow> fast::SlicerWindow::create(Color bgcolor, uint width, uint height)

Create instance.

Parameters
bgcolor Background color
width Window width
height Window height

std::shared_ptr<SlicerWindow> fast::SlicerWindow::connectImage(std::shared_ptr<ProcessObject> processObject, float level = -1, float window = -1, uint outputPortID = 0)

Connect an 3D image source to this window.

Parameters
processObject Process object producing a 3D image
level Intensity level
window Intensity window
outputPortID Output port id of process object

std::shared_ptr<SlicerWindow> fast::SlicerWindow::connectImage(std::shared_ptr<Image> image, float level = -1, float window = -1)

Connect a 3D image to this window.

Parameters
image 3D image to connect
level Intensity level
window Intensity window

std::shared_ptr<SlicerWindow> fast::SlicerWindow::connectSegmentation(std::shared_ptr<ProcessObject> processObject, LabelColors colors = LabelColors(), float opacity = -1, float borderOpacity = -1.0f, int borderRadius = -1, uint outputPortID = 0)

Connect a 3D segmentation soruce to this window.

Parameters
processObject Process object producing a 3D segmentation image
colors Label colors
opacity Segmentation overlay opacity
borderOpacity Segmentation overlay border opacity
borderRadius How thick, in pixels, the border radius should be
outputPortID Output port id of process object

std::shared_ptr<SlicerWindow> fast::SlicerWindow::connectSegmentation(std::shared_ptr<Image> image, LabelColors colors = LabelColors(), float opacity = 0.5f, float borderOpacity = -1.0f, int borderRadius = 1)

Connect a 3D segmentation to this window.

Parameters
image 3D segmentation image
colors Label colors
opacity Segmentation overlay opacity
borderOpacity Segmentation overlay border opacity
borderRadius How thick, in pixels, the border radius should be