iOS上的ITK库-加载DICOM [英] ITK library on iOS - Loading DICOM

查看:246
本文介绍了iOS上的ITK库-加载DICOM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为ipad构建了ITK库-它可以工作。然后,我尝试举一个ITK示例-像这样:

I have built the ITK library for the ipad - and it works. Then I tried to make an ITK example - something like that:

// Load DICOM files
typedef itk::ImageSeriesReader< InputImageType > ReaderType;
ReaderType::Pointer reader = ReaderType::New();
typedef itk::GDCMImageIO ImageIOType;
typedef itk::GDCMSeriesFileNames NamesGeneratorType;
ImageIOType::Pointer gdcmIO = ImageIOType::New();
NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New();
namesGenerator->SetInputDirectory( "C:/test" );

但是我尝试了很多可能性来加载 DICOM 堆叠在ipad文件文件夹的目录中,而不是 c:/ test 路径。但这没用。

But I tried a lot of possibilites to load a DICOM stack in a directory on the documents folder of the ipad instead of the c:/test path. But that didn't work.

所以我的想法是通过Internet加载 DICOM

So my idea is to load a DICOM like that over the internet:

NSData *dicomImage = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.someurl.ch/dicom/blabla.dcm"]];   

现在我想尝试获取dicom数据(患者姓名等)并将其与图像数据。然后,我认为最后必须有一个UIImage可以显示在IPAD上。

And now I think about trying to get out the dicom data (patient name etc) and separate it from the image data. Then I think it must be possible to have at the end an UIImage to display on the IPAD.

我为此寻找了一个例子,但可悲的是……我没有发现什么好东西。如果有人知道如何通过 ITK 在ipad上加载dcm,或者知道如何从 NSData中获取图像数据对象?

I searched for an example for that, but sadly...i didnt found something good. If anybody has got an idea how to load a dcm on the ipad through ITK or an idea how to get the image data out of the NSData object?

推荐答案

ITK实际上使用GDCM读取DICOM文件,因此直接使用GDCM可能更容易。
http://sourceforge.net/apps/mediawiki/gdcm/index。 php

ITK actually uses GDCM to read DICOM files, so it's probably easier to use GDCM directly. http://sourceforge.net/apps/mediawiki/gdcm/index.php

在iPad(或任何移动设备)上加载DICOM文件时,我会特别小心。某些DICOM文件非常大(约为GB),这可能会使您的应用程序崩溃。当然,无论如何,您可能都很难在iPad上加载大文件:)

As for loading DICOM files on the iPad (or any mobile device), I would be careful when doing so. Some DICOM files are very large (on the order of GBs), and that would probably just crash your application. Of course, you'd probably have a difficult time loading files that large onto the iPad anyway :)

像素数据不一定是JPEG数据中所期望的RGB数据。检查光度学解释。如果是RGB,则可以继续使用(解码和解压缩后)。如果是单色,则可能需要转换为RGB值(请参见如何将DICOM图像的宽度和水平转换为JPEG亮度和对比度?),然后再将数据传递给UIImage。

The pixel data is not necessarily RGB data as you would expect to find in a JPEG. Check the photometric interpretation. If it's RGB, then you're good to go (after decoding & decompression). If it's monochrome, you may need to convert to RGB values (see How to translate DICOM image width and level to JPEG brightness and contrast?) before passing the data to UIImage.

这篇关于iOS上的ITK库-加载DICOM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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