Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CTK Framework-- getting started with CTK Widgets

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

CTK framework-- CTK Widgets Quick start 1, introduction to CTK Widgets module 1, introduction to CTK Widgets module

CTK Widgets module is a CTK-packaged Qt component library for general functions and biomedical imaging.

There is a lot of test-related code in all parts of CTK, in the Libs/xxx/Testin/Cpp directory under the source directory.

CTK official documentation:

Http://www.commontk.org/docs/html/modules.html

ImageGallery demonstrates the effects of most of the components of the CTK Widgets module:

Http://www.commontk.org/index.php/Documentation/ImageGallery

2. CTK Widgets composition

The CTK Widgets module mainly consists of four parts:

A, DICOM Widgets: used to support applications in the field of medical digital image communication (DICOM)

B, Visualization VTK Widgets: components that support VTK

C, Widgets: general functional components

D, XNAT Widgets: components that support XNAT

Currently there is only one class ctkXnatLoginDialog.

XNAT is an open source imaging information platform developed by the Neuroinformatics Research Group at the University of Washington. It was originally developed at Buckner Lab at the University of Washington and is currently developed by Harvard University.

2. CTK Widgets Quick start 1. Import CTK Widgets module

The CTKWidgets module uses the same as other third-party libraries.

Create a QtGUI application and add the CTKWidgets module to the project file.

QT + = core guigreaterThan (QT_MAJOR_VERSION 4): QT + = widgetsTARGET = HelloCTKWidgetTEMPLATE = app#CTK installation path CTK_INSTALL_PATH = / usr/local/CTK#CTK plug-in related library path CTK_LIB_PATH = $$CTK_INSTALL_PATH/lib/ctk-0.1#CTK plug-in related header file CTK_INCLUDE_PATH = $CTK_INSTALL_PATH/include/ctk-0.1LIBS + =-L$$CTK_LIB_PATH-lCTKCore-lCTKWidgetsINCLUDEPATH + = $CTK_INCLUDE_PATH SOURCES + = main.cpp\ Widget.cppHEADERS + = Widget.h2, Use the component # ifndef WIDGET_H#define WIDGET_H#include # include class Widget: public QWidget {Q_OBJECTpublic: Widget (QWidget * parent = 0) {m_layout = new QGridLayout (this) / / check button m_ctkCheckableButton = new ctkCheckablePushButton (this); setText ("ctkCheckablePushButton"); / / collapsible button m_ctkCollapsibleButton = new ctkCollapsibleButton (this); setText ("ctkCollapsibleButton"); addWidget-> addWidget (m_ctkCheckableButton, 0,0,1,2); addWidget-> addWidget (m_ctkCollapsibleButton, 0,2,1,2) / / Color picker m_ctkColorPickerButton = new ctkColorPickerButton (this); setText ("ctkColorPickerButton"); / / Slider m_ctkRangeWidget = new ctkRangeWidget (this); masking layout-> addWidget (m_ctkColorPickerButton, 1, 0, 1, 2); masking layout-> addWidget (m_ctkRangeWidget, 1, 2, 1, 2); / / grouping box m_ctkCollapsibleGroupBox = new ctkCollapsibleGroupBox (this) MacroctkCollapsibleGroupBox-> setTitle ("GroupBox"); massively layout-> addWidget (m_ctkCollapsibleGroupBox, 3,0,3,4); / / coordinate components m_ctkCoordinatesWidget = new ctkCoordinatesWidget (this); / / Tree combinatoria m_ctkTreeComboBox = new ctkTreeComboBox (this); MacroctkTreeComboBox-> addItems (QStringList () addWidget (m_ctkTreeComboBox, 6,2,1,2) / / search box m_ctkSearchBox = new ctkSearchBox (this); / / directory button m_ctkDirectoryButton = new ctkDirectoryButton (this); masked layout-> addWidget (m_ctkSearchBox, 7, 0, 1, 2); masked layout-> addWidget (m_ctkDirectoryButton, 7, 2, 1, 2); / / combo box m_ctkCheckableComboBox with check function = new ctkCheckableComboBox (this) MacroctkCheckableComboBox-> addItems (QStringList () addWidget (m_ctkCheckableComboBox, 8,0,1,2); masking layout-> addWidget (m_ctkPathLineEdit, 8,2,1,2); / / material attribute component m_ctkMaterialPropertyWidget = new ctkMaterialPropertyWidget (this); / / Matrix component m_ctkMatrixWidget = new ctkMatrixWidget (this); masking layout-> addWidget (m_ctkMaterialPropertyWidget, 9,0,1,2) Massively layout-> addWidget (m_ctkMatrixWidget, 9, 2, 1, 2); setLayout (m_layout);} private: QGridLayout* massively layout; ctkCheckablePushButton* missuckkCheckableButton; ctkCollapsibleButton* MacroctkCollapsibleButton; ctkColorPickerButton* MacroctkColorPickerButton; ctkRangeWidget* MacroctkRangeWidget; ctkCollapsibleGroupBox* mroomctkCollapsibleGroupBoxWidget; ctkTreeComboBox* MacroctkTreeComboBox; ctkSearchBox* ctkSearchBox; ctkDirectoryButton* ctkDirectorButton; ctkCheckableComboBox* m_ctkCheckableComboBox CtkMaterialPropertyWidget* endif / / WIDGET_H#include "Widget.h" # include int main (int argc, char * argv []) {QApplication a (argc, argv); Widget w; w.show (); return a.exec ();} 3, CTK Widgets application compilation results

4. CTK Widgets learning example

The CTK Widgets test code is located in CTK/Libs/Widgets/Testing/Cpp and can be used as a learning example.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report