VTK读入DICOM数据

date: 2019-04-02 16:26:00

VTK读入DICOM数据

DICOM示例:

图像来自www.dicomlibrary和medDream

准备图像

公开数据库

  • DICOM Library:链接,少量CT(Computed Tomography,计算机断层扫描),MR( Magnetic resonance imaging),OT(other)其他格式。更多关于医学影像格式的信息,这里
  • 链接,比较老的DICOM图像,大小较小
  • visualdata:链接
  • Rubo:一些血管造影
  • 其他,aycan,[2], [3]

读入数据

读入DICOM样例Java程序

来源

import vtk.vtkNativeLibrary;
import vtk.vtkRenderWindowInteractor;
import vtk.vtkImageViewer2;
import vtk.vtkDICOMImageReader;


public class ReadDICOM 
{
  // -----------------------------------------------------------------
  // Load VTK library and print which library was not properly loaded
  static 
  {
    if (!vtkNativeLibrary.LoadAllNativeLibraries()) 
    {
      for (vtkNativeLibrary lib : vtkNativeLibrary.values()) 
      {
        if (!lib.IsLoaded()) 
        {
          System.out.println(lib.GetLibraryName() + " not loaded");
        }
      }
    }
    vtkNativeLibrary.DisableOutputWindow(null);
  }
  // -----------------------------------------------------------------

  public static void main(String args[]) 
  {

    //parse command line arguments
    if (args.length != 1) 
    {
      System.err.println("Usage: java -classpath ... Filename(.img) e.g prostate.img");
      return;
    }
    String inputFilename = args[0];

    vtkDICOMImageReader reader = new vtkDICOMImageReader();
    reader.SetFileName(inputFilename);
    reader.Update();

    // Visualize
    vtkImageViewer2 imageViewer = new vtkImageViewer2();
    imageViewer.SetInputConnection(reader.GetOutputPort());
    vtkRenderWindowInteractor renderWindowInteractor =new vtkRenderWindowInteractor();
    imageViewer.SetupInteractor(renderWindowInteractor);
    imageViewer.Render();
    imageViewer.GetRenderer().ResetCamera();
    imageViewer.Render();

    renderWindowInteractor.Start();

   }
}

参考

[1] https://blog.csdn.net/yunzhaoqiang/article/details/26005009

[2] https://www.researchgate.net/post/Can_anyone_suggest_me_any_website_for_downloading_DICOM_files

[3] https://talk.openmrs.org/t/sources-for-sample-dicom-images/6019

你可能感兴趣的:(java,开发语言,VTK,医学图像)