65.9K
CodeProject 正在变化。 阅读更多。
Home

为实际应用开发 DICOM 查看器

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0投票)

2012 年 9 月 10 日

CPOL

4分钟阅读

viewsIcon

42329

downloadIcon

2846

LEADTOOLS 医学影像 SDK 凭借 20 多年的影像开发经验,解决了这一问题,并提供了一个高级、对开发人员友好且功能丰富的 DICOM 查看器控件。

引言

涉及 DICOM 图像显示的医学影像应用程序比表面看起来要复杂得多。当然,显示图像的方法有很多,但您的医疗保健行业的客户期望并要求您为他们开发的应用程序具有特定的规格和功能,尤其是在查看 DICOM 图像方面。

LEADTOOLS 医学影像 SDK 凭借 20 多年的影像开发经验,解决了这一问题,并提供了一个高级、对开发人员友好且功能丰富的 DICOM 查看器控件。LEAD Technologies 已与众多客户合作,并 incorporated 了所有行业标准功能以及许多大多数第三方 SDK 未提供的先进功能。除了其在实际应用中经过测试和验证的全面功能集所带来的安心感之外,其易用性还将为您节省大量的开发时间和金钱。

LEADTOOLS SDK 中的主要 DICOM 查看器功能

  • 完全可定制的单元格和子单元格布局
  • 自动图像同步,用于查看多个序列
  • 在图像上显示叠加信息
  • 支持患者方向、定位、MPR 和参考线
  • 内置工具,用于
    • 测量(标尺、吸附标尺、量角器、统计、探针)
    • 图像显示(窗口级别、缩放、平移、放大镜、空间定位器、用户显微镜)
    • 图像 Alpha(Sigmoid、指数、对数)
    • 注释(文本、箭头、矩形、椭圆、Cobb 角、自定义等)
    • 感兴趣区域(魔术棒、微调、收缩等)
  • 专门的诊断评估工具,如 PET-CT 融合
  • 直接与 LEADTOOLS Medical 3D SDK 技术集成
  • 查看大型研究时低内存使用选项
  • 内置标尺,可根据图像 DPI、缩放比例因子和自定义校准设置进行调整
  • 低级别程序化访问,用于定制和事件处理

包含 DICOM 查看器技术的 SDK 产品

DICOM 查看器代码

每个 DICOM 图像查看器都应具备的标准功能,例如窗口级别、滚动、缩放、多帧布局等。LEADTOOLS MedicalViewer 控件通过使这些常用功能极其易于使用和实现来脱颖而出。它包含许多重载函数,为您提供了所需的控制程度。在下面的示例中,我们指定了一个文件名、一个用于将图像拟合到单元格的布尔值,以及用于多帧图像显示子单元格的行数和列数。

// Create cell, set options and add image
MedicalViewerMultiCell cell = new MedicalViewerMultiCell(
   _codecs.Load(strFile),
   true,
   nRows,
   nCols);

// Add the cell to the viewer
_medicalViewer.Cells.Add(cell);

放射科医生和医疗保健专业人员需要许多工具来进行相互协作和做出诊断。窗口级别、堆栈、缩放、注释等都是基本要求,涉及大量的事件处理、图像处理和图像显示操作。要在 LEADTOOLS 中使用这些功能,您只需要两个函数:AddActionSetAction。第一个函数 AddAction 告知查看器单元格哪些操作可用。然后 SetAction 将其中一个添加的操作分配给鼠标事件,并在用户希望切换工具时随时调用。

// Add the actions we want to make available to the user
cell.AddAction(MedicalViewerActionType.WindowLevel);
cell.AddAction(MedicalViewerActionType.Scale);
cell.AddAction(MedicalViewerActionType.Offset);
cell.AddAction(MedicalViewerActionType.Stack);
cell.AddAction(MedicalViewerActionType.AnnotationLine);
cell.AddAction(MedicalViewerActionType.AnnotationRectangle);
cell.AddAction(MedicalViewerActionType.AnnotationEllipse);
cell.AddAction(MedicalViewerActionType.AnnotationText);

// Assign some actions added actions to a mouse button
cell.SetAction(MedicalViewerActionType.WindowLevel,
   MedicalViewerMouseButtons.Left, MedicalViewerActionFlags.Active);
cell.SetAction(MedicalViewerActionType.Offset,
   MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
cell.SetAction(MedicalViewerActionType.Scale,
   MedicalViewerMouseButtons.Middle, MedicalViewerActionFlags.Active);
cell.SetAction(MedicalViewerActionType.Stack,
   MedicalViewerMouseButtons.Wheel, MedicalViewerActionFlags.Active);

最后,几乎所有 DICOM 查看器应用程序都使用某种形式的元数据叠加。同样,LEADTOOLS 尽可能对开发人员友好,只需一个函数 SetTag 即可将元数据标签添加到任何单元格或子单元格。这包括静态标签和动态标签,后者会随着查看器操作(如窗口级别、缩放比例和帧号)而变化。

// Add some tags to show some information and metadata
cell.SetTag(4, MedicalViewerTagAlignment.TopLeft,
   MedicalViewerTagType.Frame);
cell.SetTag(6, MedicalViewerTagAlignment.TopLeft,
   MedicalViewerTagType.Scale);
cell.SetTag(2, MedicalViewerTagAlignment.BottomLeft,
   MedicalViewerTagType.WindowLevelData);
cell.SetTag(1, MedicalViewerTagAlignment.BottomLeft,
   MedicalViewerTagType.FieldOfView);

一些最重要的元数据来自 DICOM 数据集本身的大量信息。LEADTOOLS 是提取这些信息并将其用于有意义用途的不可或缺的工具。下面,我们使用 DicomDataSet 对象来获取患者姓名和图像方向信息。

// Get some information from the DICOM Data Set and 
DicomDataSet ds = new DicomDataSet();
ds.Load(strFile, DicomDataSetLoadFlags.LoadAndClose);

// Get the patients name
string strPatientName =
   ds.GetValue<string>(DicomTag.PatientName, string.Empty);
cell.SetTag(1, MedicalViewerTagAlignment.TopRight,
   MedicalViewerTagType.UserData, strPatientName);

// Get the patient's image orientation
// There might be some other tags depending on the modality but
// this is all that's needed for these example images
DicomElement element = ds.FindFirstElement(null,
   DicomTag.ImageOrientationPatient, true);
if (element != null && element.Length > 0)
{
   double[] doubleArray; doubleArray = ds.GetDoubleValue(element,
      0, 6);
   cell.ImageOrientation = new float[] { 
      (float)doubleArray[0], 
      (float)doubleArray[1], 
      (float)doubleArray[2], 
      (float)doubleArray[3], 
      (float)doubleArray[4], 
      (float)doubleArray[5] };

   // Now we set the orientation values with the orientation tags
   cell.SetTag(0, MedicalViewerTagAlignment.TopCenter,
      MedicalViewerTagType.TopOrientation);
   cell.SetTag(0, MedicalViewerTagAlignment.BottomCenter,
      MedicalViewerTagType.BottomOrientation);
   cell.SetTag(0, MedicalViewerTagAlignment.LeftCenter, 
      MedicalViewerTagType.LeftOrientation);
   cell.SetTag(0, MedicalViewerTagAlignment.RightCenter,
      MedicalViewerTagType.RightOrientation);
}

就是这样。只需大约 50 行代码,您就可以为您的应用程序添加一个功能齐全、功能丰富的 DICOM 查看器,任何医疗保健专业人员都会乐于使用。

Fusion:一个高级示例

LEADTOOLS DICOM 查看器不仅仅停留在基础功能。许多高级功能需要使用其他医学影像 SDK 进行大量定制和低级编程。由于 LEAD Technologies 在了解医疗专业人员需求方面进行了广泛的研究和行业经验,LEADTOOLS 仅用几行代码即可实现这些功能。

Fusion 是其中一项技术。它最常用于 PET 和 CT 图像,但也可以使用来自任何模态的 DICOM 图像。在下面的示例中,我们展示了如何使用 CT 和 MR 实现基本的 Fusion。

// Add two cells to the viewer
AddCell(_strMRImage, 1, 1);
AddCell(_strCTImage, 1, 1);

// Get the cell on the right
MedicalViewerMultiCell cell =
   (MedicalViewerMultiCell)_medicalViewer.Cells[1];

// Create a new fusion object, this object will hold the image
// that will be fused with the original image
MedicalViewerFusion fusion = new MedicalViewerFusion();

// Set some properties to control how the fusion will work
fusion.FusedImage = _codecs.Load(_strMRImage);
fusion.FusionScale = 0.5f;
fusion.ColorPalette = MedicalViewerPaletteType.RedHot;
cell.SubCells[0].Fusion.Add(fusion);

// adjust some tags for the cell
cell.SetTag(0, 1, MedicalViewerTagAlignment.BottomRight,
   MedicalViewerTagType.UserData, "FUSION EX. ID 230-36-5448");

结论

LEADTOOLS 以易于使用的、高级的编程接口为开发人员提供了世界上性能最佳、最稳定的成像库,从而能够快速开发关键业务应用程序。

DICOM 查看器只是 LEADTOOLS 提供的众多技术之一。有关我们其他产品的更多信息,请务必访问我们的 主页,下载免费的全功能评估 SDK,并在评估期间享受我们免费的技术支持。

下载完整的 DICOM 查看器示例

您可以下载一个完整的演示,其中包含上述功能。要运行此示例,您需要以下内容:

支持

需要帮助来设置和运行此示例? 联系我们的支持团队 以获得免费技术支持!有关定价或许可问题,您可以联系我们的销售团队(sales@leadtools.com)或致电 704-332-5532。

© . All rights reserved.