首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

DCMTK读取多帧图像,不需要所有读取像素数据,即可处理数据

2012-12-24 
DCMTK读取多帧图像,不需要全部读取像素数据,即可处理数据?Howto: Access multi-frame images without load

DCMTK读取多帧图像,不需要全部读取像素数据,即可处理数据

?

Howto: Access multi-frame images without loading complete pixel data

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.

Source Code

?

#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(filename,flags?=?0,fstart?=?0,fcount?=?0?)filenamethe DICOM fileflagsconfiguration flags (see diutils.h, CIF_MayDetachPixelData is set automatically)fstartfirst frame to be processed (optional, 0 = 1st frame), all subsequent use of parameters labeled 'frame' in this class refers to this start frame.fcountnumber of frames (optional, 0 = all frames)

?

int?DicomImage::processNextFrames(fcount?=?0)[inline]
Parameters:fcountnumber 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

热点排行