程序示例精选
VS+VTK+Dicom(dcm)+CT影像切片窗体界面显示源码
如需安装运行环境或远程调试,可点击 博主头像进入个人主页查看博主联系方式,由专业技术人员远程协助!
前言
这篇博客针对《VS+VTK+Dicom(dcm)+CT影像切片窗体界面显示源码》编写代码,代码整洁,规则,易读。 学习与应用推荐首选。运行结果
文章目录
一、所需工具软件二、使用步骤
1. 主要代码
2. 运行结果
三、在线协助
一、所需工具软件
1. VS2019, C++2. VTK
二、使用步骤
代码如下(示例):
#include <memory>
#include "../../QvtkDicomViewer.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'QvtkDicomViewer.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.13.2. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_QvtkDicomViewer_t {
QByteArrayData data[52];
char stringdata0[863];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_QvtkDicomViewer_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_QvtkDicomViewer_t qt_meta_stringdata_QvtkDicomViewer = {
{
QT_MOC_LITERAL(0, 0, 15), // "QvtkDicomViewer"
QT_MOC_LITERAL(1, 16, 18), // "CursorValueChanged"
},
"QvtkDicomViewer\0CursorValueChanged\0\0"
"WindowWLChanged\0AppStateChanged\0"
"OnPlayerTimerOut\0OnChangeAppState\0"
"OnChangeCursorValue\0OnChangeWindowsWL\0"
"OnOpenSeriesFolder\0OnOpenDicomFile\0"
"OnOpenDicomDirFile\0OnForward\0OnBackward\0"
"OnResetToFirst\0OnSelectedPointer\0"
"OnSelectedProtractor\0OnSelectedRuler\0"
"OnSelectedContour\0OnSelectedBiDimensional\0"
"OnSelectedGrayLevel\0OnSelectedZoom\0"
"OnSelectedMove\0OnNegative\0OnReset\0"
"OnPlay\0OnStop\0OnSwitchProperty\0"
"on_treeView_customContextMenuRequested\0"
"pos\0OnShowDicomCurrentTags\0"
"OnShowSelectedSeries\0OnShowSelectedImage\0"
"OnSliceScrollBarValueChange\0a\0receiveData\0"
"data\0OnLatterPatient\0OnPreviousPatient\0"
"OnWindowWL_Defaut\0OnWindowWL_All\0"
"OnWindowWL_CT_Abdomen\0OnWindowWL_CT_BloodVessel\0"
"OnWindowWL_CT_Bones\0OnWindowWL_CT_Brain\0"
"OnWindowWL_CT_Medias\0OnWindowWL_CT_Lungs\0"
"OnTestEntrance_01\0OnTestEntrance_02\0"
"On3D_Reconstruction\0OnSegmentImage\0"
"OnRegistration"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_QvtkDicomViewer[] = {
// content:
8, // revision
0, // classname
};
void QvtkDicomViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
auto *_t = static_cast<QvtkDicomViewer *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->CursorValueChanged(); break;
case 1: _t->WindowWLChanged(); break;
case 2: _t->AppStateChanged(); break;
case 3: _t->OnPlayerTimerOut(); break;
case 4: _t->OnChangeAppState(); break;
case 5: _t->OnChangeCursorValue(); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
{
using _t = void (QvtkDicomViewer::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QvtkDicomViewer::CursorValueChanged)) {
*result = 0;
return;
}
}
{
using _t = void (QvtkDicomViewer::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QvtkDicomViewer::WindowWLChanged)) {
*result = 1;
return;
}
}
{
using _t = void (QvtkDicomViewer::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&QvtkDicomViewer::AppStateChanged)) {
*result = 2;
return;
}
}
}
}
QT_INIT_METAOBJECT const QMetaObject QvtkDicomViewer::staticMetaObject = {
{
&QMainWindow::staticMetaObject,
qt_meta_stringdata_QvtkDicomViewer.data,
qt_meta_data_QvtkDicomViewer,
qt_static_metacall,
nullptr,
nullptr
} };
const QMetaObject *QvtkDicomViewer::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *QvtkDicomViewer::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_QvtkDicomViewer.stringdata0))
return static_cast<void*>(this);
return QMainWindow::qt_metacast(_clname);
}
int QvtkDicomViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 47)
qt_static_metacall(this, _c, _id, _a);
_id -= 47;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 47)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 47;
}
return _id;
}
// SIGNAL 0
void QvtkDicomViewer::CursorValueChanged()
{
QMetaObject::activate(this, &staticMetaObject, 0, nullptr);
}
// SIGNAL 1
void QvtkDicomViewer::WindowWLChanged()
{
QMetaObject::activate(this, &staticMetaObject, 1, nullptr);
}
// SIGNAL 2
void QvtkDicomViewer::AppStateChanged()
{
QMetaObject::activate(this, &staticMetaObject, 2, nullptr);
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
运行结果
三、在线协助:
如需安装运行环境或远程调试,可点击博主头像,进入个人主页查看博主联系方式,由专业技术人员远程协助!
1)远程安装运行环境,代码调试
2)Visual Studio, Qt, C++, Python编程语言入门指导
3)界面美化
4)软件制作
博主个人主页:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc
博主所有文章点这里:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc
博主联系方式点这里:https://developer.aliyun.com/profile/expert/rfnzgp3sk3ahc