有谁知道如何从DICOM文件中提取像素数据并将其传递给iOS上的图像查看器?
很抱歉,如果这是一个简单的问题,但它似乎是我打开的大量蠕虫的主要组成部分.
我在iOS上使用GDCM.我还没有非常努力地推动它,但到目前为止它仍然运作良好.在这篇关于ITK的优秀文章中,我基本上遵循了在iOS上运行XCode项目的指导.
以下是我为iOS编译的方法:
以下是您如何调用库并将结果放在Objective-C字典中的粗略摘要:
NSMutableDictionary * imageDictionary = [[NSMutableDictionary alloc] initWithCapacity:40];
// The output of gdcm::Reader is a gdcm::File
gdcm::File &file = reader.GetFile();
// the dataset is the the set of element we are interested in:
gdcm::DataSet &ds = file.GetDataSet();
const Tag studyInstance(0x0020,0x000d); // Study Instance UID
const DataElement &dicomVal = ds.GetDataElement(studyInstance);
std::string stringVal( dicomVal.GetByteValue()->GetPointer(), dicomVal.GetByteValue()->GetLength() );
NSString *val = [NSString stringWithCString:stringVal.c_str() encoding:[NSString defaultCStringEncoding]];
[imageDictionary setObject:val forKey:@"studyInstanceUID"];
Run Code Online (Sandbox Code Playgroud)
(注意:这是一个混合了C++和ObjectiveC的*.mm文件)
| 归档时间: |
|
| 查看次数: |
3639 次 |
| 最近记录: |