使用DCMTK实现DICOM文件浏览器dicom explorer

之前一直使用别人的免费浏览工具来浏览DCM图像,或多或少都存在小的问题,要么完全免费但是功能不全不好用,要么就是收费需要定期下载版本申请试用,折腾来折腾去很是费心,决定最近自己写个简单的,不求功能强大只求自己用起来得心应手。

底层文件的读取使用DCMTK3.6.3的DCMData包;考虑支持跨平台,上层显示使用QT来做。

 在Linux和windows两个平台下编译DCMTK生成的Config文件夹中的头文件内容是不同的,为了更好地组织两个平台的头文件和库文件,在dcmtk文件夹分别新建linux和win文件夹,将ubuntu下编译后的include文件夹拷贝到linux下,将win7下编译后的include文件夹拷贝到win下。读取文件主要使用DCMTK的DcmData库,该库依赖了ofstd,oflog库,为了支持RLE压缩和JPEG压缩,还需要dcmjpeg库。以linux为例,将编译后的config文件夹下的include目录和源码中的ofstd,oflog,dcmjpeg,dcmdata文件夹中的include文件夹拷贝到dcmtk/linux/include目录下,并在工程文件.pro中将这些目录添加到INCLUDEPATH中;

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/config
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/config

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/ofstd
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/ofstd

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/ofstd/diag
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/ofstd/diag

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/ofstd/variadic
else:unix:  INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/ofstd/variadic

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog
else:unix:  INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog/config
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog/config

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog/helpers
else:unix: INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog/helpers

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog/internal
else:unix:  INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog/internal

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog/thread
else:unix:  INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog/thread

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/oflog/spi
else:unix:  INCLUDEPATH += $$PWD/dcmtk/linux/include/dcmtk/oflog/spi

win32: INCLUDEPATH += $$PWD/dcmtk/win/include/dcmtk/dcmjpeg

你可能感兴趣的:(使用DCMTK实现DICOM文件浏览器dicom explorer)