- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个小型 C++ 项目,需要从 DICOM TAG 中提取信息。
我正在使用 VSCode 管理 C++ 代码并使用 CMake 进行构建。
DCMTK 通过 Macport 安装:port install dcmtk。
如何将 DCMTK 作为库添加到我的项目中?有没有一步一步的教程?
谢谢!
这是我根据@mattdibi 所做的
在我的 CMakeLists.txt 中添加了以下行
find_package(DCMTK REQUIRED)
include_directories(${DCMTK_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} tinyxml2 ${DCMTK_LIBRARIES})
然后将包含路径“/opt/local/include”添加到文件 c_cpp_properties.json 中的“includePath”部分。
在我的源文件中添加了包含行:
#include "dcmtk/dcmdata/dctk.h"
#include "dcmtk/dcmimgle/dcmimage.h"
cd 到项目根目录下的 Debug 文件夹,运行 cmake -DCMAKE_BUILD_TYPE=Debug ..
最后,在Debug文件夹下运行make,下面是错误的构建日志:
[ 50%] Built target tinyxml2
[ 75%] Building CXX object CMakeFiles/SURMaker.dir/MakerApp.cpp.o
In file included from /Users/adminuser/Documents/Playground/SURMaker/MakerApp.cpp:5:
In file included from /opt/local/include/dcmtk/dcmdata/dctk.h:28:
In file included from /opt/local/include/dcmtk/dcmdata/dctypes.h:27:
In file included from /opt/local/include/dcmtk/oflog/oflog.h:32:
In file included from /opt/local/include/dcmtk/ofstd/ofconapp.h:29:
In file included from /opt/local/include/dcmtk/ofstd/ofcmdln.h:32:
In file included from /opt/local/include/dcmtk/ofstd/offile.h:30:
In file included from /opt/local/include/dcmtk/ofstd/ofstd.h:33:
In file included from /opt/local/include/dcmtk/ofstd/oflimits.h:88:
In file included from /opt/local/include/dcmtk/ofstd/ofstdinc.h:219:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace; did you
mean 'sigwait'?
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h:101:5: note: 'sigwait' declared here
int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
^
In file included from /Users/adminuser/Documents/Playground/SURMaker/MakerApp.cpp:5:
In file included from /opt/local/include/dcmtk/dcmdata/dctk.h:28:
In file included from /opt/local/include/dcmtk/dcmdata/dctypes.h:27:
In file included from /opt/local/include/dcmtk/oflog/oflog.h:32:
In file included from /opt/local/include/dcmtk/ofstd/ofconapp.h:29:
In file included from /opt/local/include/dcmtk/ofstd/ofcmdln.h:32:
In file included from /opt/local/include/dcmtk/ofstd/offile.h:30:
In file included from /opt/local/include/dcmtk/ofstd/ofstd.h:33:
In file included from /opt/local/include/dcmtk/ofstd/oflimits.h:88:
In file included from /opt/local/include/dcmtk/ofstd/ofstdinc.h:219:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: error: no member named 'isfinite' in the global namespace; did you
mean 'finite'?
using ::isfinite;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from /Users/adminuser/Documents/Playground/SURMaker/MakerApp.cpp:5:
In file included from /opt/local/include/dcmtk/dcmdata/dctk.h:28:
In file included from /opt/local/include/dcmtk/dcmdata/dctypes.h:27:
In file included from /opt/local/include/dcmtk/oflog/oflog.h:32:
In file included from /opt/local/include/dcmtk/ofstd/ofconapp.h:29:
In file included from /opt/local/include/dcmtk/ofstd/ofcmdln.h:32:
In file included from /opt/local/include/dcmtk/ofstd/offile.h:30:
In file included from /opt/local/include/dcmtk/ofstd/ofstd.h:33:
In file included from /opt/local/include/dcmtk/ofstd/oflimits.h:88:
In file included from /opt/local/include/dcmtk/ofstd/ofstdinc.h:219:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: error: no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:7: error: no member named 'isgreater' in the global namespace; did you
mean '::std::greater'?
using ::isgreater;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:720:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from /Users/adminuser/Documents/Playground/SURMaker/MakerApp.cpp:5:
In file included from /opt/local/include/dcmtk/dcmdata/dctk.h:28:
In file included from /opt/local/include/dcmtk/dcmdata/dctypes.h:27:
In file included from /opt/local/include/dcmtk/oflog/oflog.h:32:
In file included from /opt/local/include/dcmtk/ofstd/ofconapp.h:29:
In file included from /opt/local/include/dcmtk/ofstd/ofcmdln.h:32:
In file included from /opt/local/include/dcmtk/ofstd/offile.h:30:
In file included from /opt/local/include/dcmtk/ofstd/ofstd.h:33:
In file included from /opt/local/include/dcmtk/ofstd/oflimits.h:88:
In file included from /opt/local/include/dcmtk/ofstd/ofstdinc.h:219:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:7: error: no member named 'isgreaterequal' in the global namespace;
did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:749:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from /Users/adminuser/Documents/Playground/SURMaker/MakerApp.cpp:5:
In file included from /opt/local/include/dcmtk/dcmdata/dctk.h:28:
In file included from /opt/local/include/dcmtk/dcmdata/dctypes.h:27:
In file included from /opt/local/include/dcmtk/oflog/oflog.h:32:
In file included from /opt/local/include/dcmtk/ofstd/ofconapp.h:29:
In file included from /opt/local/include/dcmtk/ofstd/ofcmdln.h:32:
In file included from /opt/local/include/dcmtk/ofstd/offile.h:30:
In file included from /opt/local/include/dcmtk/ofstd/ofstd.h:33:
In file included from /opt/local/include/dcmtk/ofstd/oflimits.h:88:
In file included from /opt/local/include/dcmtk/ofstd/ofstdinc.h:219:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
make[2]: *** [CMakeFiles/SURMaker.dir/MakerApp.cpp.o] Error 1
make[1]: *** [CMakeFiles/SURMaker.dir/all] Error 2
make: *** [all] Error 2
最佳答案
有一个 CMake module为此。
在您的 CMakeLists.txt 文件中添加:
...
find_package(DCMTK REQUIRED)
include_directories(${DCMTK_INCLUDE_DIRS})
add_executable(EXE main.cpp)
target_link_libraries(EXE ${DCMTK_LIBRARIES})
...
关于c++ - 如何在macOS上的C++项目中使用DCMTK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54369556/
我是 DICOM 和 DCMTK 的新手。我试图使用 movescu 命令从公共(public)测试服务器 ( http://www.dicomserver.co.uk ) 检索 dcm 文件。但它不
我正在与 DICOM 合作图像和使用 DCMTK进行一些处理。 我的问题是我必须只检索一批图像的某些标签。但这个过程花费的时间太长。 我正在使用dcmdump -M -L +P '0010,0020'
我在我的应用程序中使用 DCMTK 并使用 cmake 文件进行编译。 cmake 找到所有库(至少是 header ,因为在将源文件编译为 .o 文件时)唯一的问题是在链接期间它会尝试找到 DCMT
我正在努力使用 DCMTK 3.6.1 库,现在我遇到了一种常见情况:访问 DICOM 图像的压缩数据像素。 正如图书馆的作者在这里建议的那样 http://support.dcmtk.org/red
我已经成功使用CCmake编译dcmtk3.6并在ios环境中构建它,但我不知道如何将这些编译文件包含在新的ios项目中。 我在编译到新的 iphone 项目后已经将 dcmtk 移至新的 iphon
我正在研究一个必须读取 dicom 图像的项目。 我无法安装 dcmtk。我使用的是 win7 64 位和 vs2010。 请解释在我的程序中包含 dcmtk 的过程。 最佳答案 使用 Windows
我要处理 DICOM 图像,所以我需要在 iOS 中编译/安装 DCMTK。 最佳答案 如果您打算在 Xcode 4.3 下构建 DCMTK,我建议您从 DCMTK Git 存储库中的最新版本开始。首
我想在我的应用程序中使用 DCMTK,并已为 iOS 模拟器成功编译 DCMTK 3.6.0。然后我创建了一个工作区,在其中添加了 DCMTK 项目和我的应用程序。我将 .a 文件添加为目标依赖项并链
我想在可以创建 DICOM 图像的现有项目中使用 DCMTK 3.6.1 库。我想使用这个库,因为我想压缩 DICOM 图像。在一个新的解决方案(Visual Studio 2013/C++)中按照D
我目前在 C++ 中使用 DCMTK。我对这个工具包很陌生,但据我了解,我应该能够读取窗口中心和宽度以进行标准化。 我有一个包含我的 Dicom 数据的 DicomImage DCM_image 对象
我在 Visual Studio 2013 下使用 DCMTK 库。在项目的属性中,如果我设置 Character Set: Use Unicode Character Set 编译时出现错误 Err
首先,对不起我的英语不好,我不是美国人。无论如何,我正在尝试在 Ubuntu 上安装 DCMTK,当我执行 make all 步骤时,它一直给我这个错误: Error output from make
我已经在 Ubuntu 18.04 上设置了 DCMTK 的 wlmscpfs。工作列表文件通过 dump2dcm 从转储文件转换为 .wl 文件。到目前为止,当从几台超声波机器(三星、西门子)查询时
我正在使用 DCMTK 库 开发一个快速的 DICOM 查看器,我正在按照 this link 中提供的示例进行操作. 来自 API 的缓冲区始终为任何标签 ID 返回 null,例如:DCM_Pat
我是 QTCreator 的新手。我在 Visual Studio 中使用 Dcmtk 库制作了一个小程序,现在我正在尝试使用 GUI 制作它,为此我试图在 QTCreator 中制作相同的程序,以便
我正在尝试使用 dcmtk 从 DICOM 图像中提取实例编号。代码如下所示: DcmFileFormat fileformat; OFCondition status = fileforma
我正在尝试了解如何基于 Dcmtk 库进行编程。我在 C++ 编程方面非常新手和天真(我已经学习了 C++ 的基础知识并理解它们)所以这对你们来说可能只是一个简单的问题。我找到了以下代码,我明白它在做
大家好~我正在做一些关于使用 测试我的程序的工作。 DCMTK 加载 Dicom 文件和其他东西。但是我发现我的程序只能在 中运行。调试 模式 。当我更改为 发布模式,发生以下错误 DCMTK ofs
我有一个 dicom 图像,我使用 DCMTK 将其转换为 tiff,并进行了一些图像处理。我的结果图像为 .bmp,但我想知道是否可以将其保存为 .dcm 并具有原始源文件的所有属性。我的示例代码是
我试图让 DCMTK 在 Qt Creator 中工作,但我卡在了第 5 步。如果其他步骤有误,请告诉我。 工具: Qt Creator:Qt Creator 3.5.1(开源),基于 Qt 5.5.
我是一名优秀的程序员,十分优秀!