如何在C中阅读dicom图像? [英] How to read dicom images in C?

查看:166
本文介绍了如何在C中阅读dicom图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ubuntu 16.04.4

我已经安装了dcmtk361,但我很难找到c代码。

有人可以帮助我吗?



我尝试了什么:



我有一个代码,但我得到了错误:

  #include     dcmimage.h 

#include osconfig.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( 处理框架< < image-> getFirstFrame()+ 1 << to
<< image-> getFirstFrame()+ image-> getFrameCount());
} while (image-> processNextFrames());
}

delete image;

return 0 ;
}





这是我试过的代码,但我收到错误>

dcmimage.h:没有这样的文件或目录

编译终止。

我包含所有目录但仍然得到相同的错误。

可以有人帮我

解决方案

检查头文件。



a)这是一个错字,文件名错了

b)你需要更新标题搜索路径或复制文件,以便编译器找到它。



我的提示是:a)

I am using Ubuntu 16.04.4
I have installed dcmtk361 but I am having a difficult time in finding c code.
Can somebody help me?

What I have tried:

I got a code, but i am getting an error:

#include "dcmimage.h"

#include "osconfig.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;
}



This is the code that I tried , but I got an error>
dcmimage.h: No such file or directory
compilation terminated.
I included all the directories but still getting the same error.
Can somebody help me

解决方案

Check the header file.

a) it is a typo and the file name wrong
b) you need to update the header search path or copy the file so the compiler finds it.

My tip is: a)


这篇关于如何在C中阅读dicom图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆