Here's an example that shows how to access the individual frames of a large multi-frame image (for visualization purposes) without loading the complete pixel data into main memory.
The parameter fcount
in the DicomImage constructor specifies that initially only the first 10 frames are processed. Multiple calls of processNextFrames()
give access to the subsequent frames.
See API documentation for details.
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmimgle/dcmimage.h"
int main(int argc, char *argv[])
{
OFLog::configure(OFLogger::INFO_LOG_LEVEL);
DicomImage *image = new DicomImage("mf_image.dcm", CIF_UsePartialAccessToPixelData, 0, 10 /* fcount */);
if (image->getStatus() == EIS_Normal)
{
do {
DCMIMGLE_INFO("processing frame " << image->getFirstFrame() + 1 << " to "
<< image->getFirstFrame() + image->getFrameCount());
} while (image->processNextFrames());
}
delete image;
return 0;
}
Note
This example requires DCMTK 3.5.5 (20091222) or newer.
DicomImage::DicomImage |
( |
const char * |
filename, |
|
|
const unsigned long |
flags = 0 , |
|
|
const unsigned long |
fstart = 0 , |
|
|
const unsigned long |
fcount = 0 |
|
) |
|
|
constructor, open a DICOM file.
Opens specified file and reads image related data, creates internal representation of image data. Use getStatus() to obtain detailed information about any errors.
Parameters:
filename |
the DICOM file |
flags |
configuration flags (see diutils.h, CIF_MayDetachPixelData is set automatically) |
fstart |
first frame to be processed (optional, 0 = 1st frame), all subsequent use of parameters labeled 'frame' in this class refers to this start frame. |
fcount |
number of frames (optional, 0 = all frames) |
process next couple of frames.
If the image object has been created with less than the number of frames stored in the DICOM image, this function allows for accessing the subsequent frames. Multiple calls to this function allow for successively processing all frames stored in the file or dataset. See parameters 'fstart' and 'fcount' of the constructor for how to initially create an instance of this class. NB: Only "original" images can be processed in this way, i.e. images that were created by one of the above constructors. Images that were created by one of the createXXX() methods can not be processed since they are derived from original image data in a certain way, e.g. scaled.
Parameters:
fcount |
number of frames to be processed (0 = same number as before) |
Returns:
status, true if successful, false otherwise
------------------------------------------------------------------
柳北风儿
http://qimo601.iteye.com
转载:http://support.dcmtk.org/wiki/dcmtk/howto/multiframe
分享到:
相关推荐
多帧的DICOM文件,是学习DICOM解析必备文件
文件中附带了一张单帧dicom文件,另一个txt文档中附带了此次运行的代码,即导入数据后按照dicom图像的行和列依次读入到txt中,后期经过matlab验证,得到的图像与原始图像一样,希望能给你有所帮助
C++,dcmtk,gdcm实现dicom图像解压缩,信息读取,支持jpeg,jpeg2000,jpeg-ls等多种压缩格式,支持有损解压和无损解压
这是博文《第一个 DCMTK 程序:显示 DICOM 图像(DCMTK 3.6.4 + Qt 5.14.2 + VS2015)》的源码,详细内容见博客文章 https://blog.csdn.net/blackwoodcliff/article/details/109481195
基于DCMTK的DICOM医学图像显示及其调窗方法研究
DICOM DCMTK显示DICOM图像 VC DCMTKDICOM DCMTK显示DICOM图像 VC DCMTKDICOM DCMTK显示DICOM图像 VC DCMTK
解读DICOM文件格 式并解决DICOM 医 学图像 显 示 问题是 医 学图像 处理 的基础, 对 医 学影像技 术的研 究具有重要意 义。 解读 了DICOM文件格式 并介 绍 了调 窗处理 的原理, 利 用 VC++和DCMTK实现 医 学图像显 ...
原创DICOM图像查看器,供新手参考学习。基于DCMTK工具包。
用VC++和DCMTK显示DICOM医学图像_solidtdl_Vc_dcmtk_源码.rar.rar
本人处理的CT图的格式是DICOM格式,这个用OpenCV不能直接读取,我采用了VTK进行读取,然后用OpenCV处理的思路(当然网上也有人说可以直接用ITK读
利用dcmtk显示DICOM图像以及对图像调窗
VC 使用DCMTK显示DICOM医学图像的实现教程, 从事VC 编程的程序员大概都知道,DICOM是医学影像存储和传输的国际标准,本教程来自OTI技术论坛专题讨论版,或许这本整理的简短教程对你有所帮助。
DICOM是医学影像存储和传输的国际标准,它的制定为不同的医学影像设备和用户提供了统一的接口标准和交互协议。解读 DICOM的医学图像文件格式以及用利用VC++和DCMTK显示方法显示DICOM医学图像
网上都是啥基于 DCMTK的DICOM医学图像显示及其调窗方法研究 说得文绉绉的 没啥鸟用 ,dicom没你想象的那么复杂哈 咱这个全是自主代码 顶多看了点C++的源码 然后改成c#版本的 其实都一样的。 这中间有几个 步骤, 1...
适合学习研究DICOM的初学者,本文详细介绍和解释如何使用VC++和DCMTK显示DICOM的医学图像
通过对dcmtk的源代码修改调整后,编译,目前测试在win10下面运行,可以命令行直接运行 (默认参数 端口1024,也可以命令行输入端口数字 ,图像保存路径为程序所在的目录,存储的方式使用1~198 数字的目录hash方式...
dcmtk使用手册,医学领域的东东,有学习的可以下载看看,没学过,不知道好不好学
利用DCMTK技术实现医学影像与常用格式图像的转换