简体   繁体   English

使用C#中的DICOM文件中的ClearCanvas读取错误以及如何显示DICOM VCR标记

[英]Error from reading with ClearCanvas in DICOM file in C# and how to display the DICOM VCR tag

I'm receiving an error in runtime using the ClearCanvas libraries. 我在运行时使用ClearCanvas库收到错误。 Here is the error 这是错误

Could not find file 'C:\\Users\\Don jar\\documents\\visual studio 2010\\Projects\\DICOMCA\\DICOMCA\\bin\\Debug\\Fluro.dcm'. 找不到文件'C:\\ Users \\ Don jar \\ documents \\ visual studio 2010 \\ Projects \\ DICOMCA \\ DICOMCA \\ bin \\ Debug \\ Fluro.dcm'。

The error points to this section of the code: 错误指向代码的这一部分:

theFile.Load(DicomReadOptions.Default); theFile.Load(DicomReadOptions.Default);

I will be grateful for any help. 我将不胜感激任何帮助。 Thanks 谢谢

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        string filename = "Fluro.dcm";
        DicomFile theFile = new DicomFile(filename);
        theFile.Load(DicomReadOptions.Default);
        foreach (DicomAttribute attribute in theFile.DataSet)
        {
            Console.WriteLine("Tag: {0}, Value: {1}", attribute.Tag.Name, attribute.ToString());
        }
    }
 }

The filename parameter to the constructor to DicomFile sets the absolute path of the DicomFile. DicomFile的构造函数的filename参数设置DicomFile的绝对路径。 Just set this to the path to a DICOM file in your "picture" folder, as you mention. 如您所述,只需将其设置为“picture”文件夹中DICOM文件的路径即可。

The exception you are seeing is caused by the fact that you gave a relative path to the DICOM file, and its just trying to load it in the directory where your application is located. 您看到的异常是由于您提供了DICOM文件的相对路径,并且只是尝试将其加载到应用程序所在的目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM