ImageServer“EndpointAddress”的 Clearcanvas 连接字符串

发布于 2024-10-15 01:08:56 字数 932 浏览 8 评论 0原文

注意::我还在 Clearcanvas 论坛上问过这个问题: http://www.clearcanvas.ca/dnn/tabid/69/afv/topic/aff/11/aft/15086/Default.aspx

嗨,我正在制作我自己的 WPF 和 ImageViewer现在需要使用 ImageServer 加载 DICOM 文件。我没有使用工作站作为起点,而是使用(ClearCanvas.Dicom.dll)从头开始制作查看器。我已经在我的计算机上设置了 ImageServer 用于测试和安装可以使用工作站应用程序连接到它,但不能使用我的应用程序连接(这是我的问题)。

当我尝试通过下面的代码连接到 ImageServer 时,连接超时。我可以使用 Workstation 应用程序连接到我的 ImageServer。我不确定如何配置我的连接字符串。

{
    EndpointAddress endpoint = new EndpointAddress("http://localhost:104/ClearCanvas/ImageViewer/Automation?wsdl");
    StudyRootQueryServiceClient client = new StudyRootQueryServiceClient(binding, endpoint);
    client.Open();    
}

这是我在工作站中用于连接的设置,那么如何将其转换为连接字符串?

{
    Server Name= ImageServer
    Host= localhost
    AE Title= SERVERAE
    Port= 104
}

NOTE:: I have also asked this question on the Clearcanvas forums at:: http://www.clearcanvas.ca/dnn/tabid/69/afv/topic/aff/11/aft/15086/Default.aspx

Hi, i'm making my own ImageViewer in WPF & now need to load DICOM files with the ImageServer. I'm NOT using the Workstation as a starting point, i'm making a viewer from scratch using the (ClearCanvas.Dicom.dll). I have set up the ImageServer on my computer for testing & can connect to it with the workstation app, but not with my app(& that is my problem).

When I try to connect to the ImageServer via the code below the connection times out. I can connect to my ImageServer with the Workstation app. I'm not sure how to configure my connection string I think.

{
    EndpointAddress endpoint = new EndpointAddress("http://localhost:104/ClearCanvas/ImageViewer/Automation?wsdl");
    StudyRootQueryServiceClient client = new StudyRootQueryServiceClient(binding, endpoint);
    client.Open();    
}

Here is the setting I use in the Workstation to connect, so how do I translate this to a connection string??

{
    Server Name= ImageServer
    Host= localhost
    AE Title= SERVERAE
    Port= 104
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

べ映画 2024-10-22 01:08:56

我假设您想通过 DICOM 从 ImageServer 加载图像。这将需要针对 ImageServer 的 DICOM C-FIND 请求来检索 ImageServer 上的研究列表。然后,您需要选择特定的研究并发出 DICOM C-MOVE 请求以将该研究移至您的应用程序。另请注意,您将需要 DICOM 存储 SCP 应用程序来侦听传入的 DICOM 关联,​​并且您的应用程序必须配置为 ImageServer 上的设备。

要使用 ClearCanvas DICOM 库发出 C-FIND 请求,可以使用以下代码:


StudyRootFindScu findScu = new StudyRootFindScu();
StudyQueryIod queryMessage = new StudyQueryIod();
queryMessage.QueryRetrieveLevel = QueryRetrieveLevel.Study;
queryMessage.SetCommonTags();

IList results = findScu.Find("LocalAETitle", "SERVERAE", "localhost", 104, queryMessage);

foreach (StudyQueryIod item in results)
{
    string AccessionNumber = item.AccessionNumber;
    string PatientID = item.PatientId;
    string Sex = item.PatientsSex;
    DateTime BirthDate = item.PatientsBirthDate;
    string StudyName = item.StudyDescription;
    string PatientName = item.PatientsName;
    string StudyUID = item.StudyInstanceUid;
    DateTime StudyDate = item.StudyDate.Value;
    string Modality = item.Modality;
    string ReferringPhysiciansName = item.ReferringPhysiciansName;
}


请注意,如果您想“过滤”查询,您可以设置其他标签以在 queryMessage 中进行匹配。

一旦您从结果中选择了一项研究,要发出 DICOM C-MOVE 请求,可以使用以下代码:


string studyInstanceUid = "1.1.1."; // Fill in with the real Study Instance UID
ClearCanvas.Dicom.Network.Scu.MoveScuBase moveScu = new ClearCanvas.Dicom.Network.Scu.StudyRootMoveScu("LocalAETitle", "SERVERAE", "localhost", 104, "LocalAETitle");
moveScu.AddStudyInstanceUid(studyInstanceUid);
moveScu.Move();

最后,ClearCanvas 源确实具有存储 SCP 实现。我建议查看 Trunk\Dicom\Samples\StorageScp.cs 中的文件。这需要大量的额外代码来实现。

I'd assume you would want to load the images from the ImageServer via DICOM. This would require a DICOM C-FIND request against the ImageServer to retrieve the list of studies on the ImageServer. You would then need to select a specific study and issue a DICOM C-MOVE request to move the study to your application. Note also that you will need a DICOM Storage SCP application to listen for incoming DICOM associations and your application will have to be configured as a device on the ImageServer.

To issue a C-FIND request using the ClearCanvas DICOM library, the following code could be used:


StudyRootFindScu findScu = new StudyRootFindScu();
StudyQueryIod queryMessage = new StudyQueryIod();
queryMessage.QueryRetrieveLevel = QueryRetrieveLevel.Study;
queryMessage.SetCommonTags();

IList results = findScu.Find("LocalAETitle", "SERVERAE", "localhost", 104, queryMessage);

foreach (StudyQueryIod item in results)
{
    string AccessionNumber = item.AccessionNumber;
    string PatientID = item.PatientId;
    string Sex = item.PatientsSex;
    DateTime BirthDate = item.PatientsBirthDate;
    string StudyName = item.StudyDescription;
    string PatientName = item.PatientsName;
    string StudyUID = item.StudyInstanceUid;
    DateTime StudyDate = item.StudyDate.Value;
    string Modality = item.Modality;
    string ReferringPhysiciansName = item.ReferringPhysiciansName;
}


Note that if you want to "filter" your query, you could set additional tags to match on in the queryMessage.

Once you've selected a study from the resuts, to Issue a DICOM C-MOVE request, the following code could be used:


string studyInstanceUid = "1.1.1."; // Fill in with the real Study Instance UID
ClearCanvas.Dicom.Network.Scu.MoveScuBase moveScu = new ClearCanvas.Dicom.Network.Scu.StudyRootMoveScu("LocalAETitle", "SERVERAE", "localhost", 104, "LocalAETitle");
moveScu.AddStudyInstanceUid(studyInstanceUid);
moveScu.Move();

Finally, the ClearCanvas source does have a Storage SCP implementation. I would suggest looking at the file in Trunk\Dicom\Samples\StorageScp.cs. This takes a fair amount of extra code to implement.

一世旳自豪 2024-10-22 01:08:56

这是给其他人的注释/信息::

正如“Steve Wranovsky”所述,请查看clearcanvas src 中的StarageScp.cs。在那里您将找到 StorageScp 类,我已成功使用它来完成从 ImageServer 检索文件的任务。
首先确保您在 Admin/Configure/Devices 下的 ImageServer 中将设备端口配置为 106 或其他端口。

然后这就是启动 StorageScp 类以侦听端口的方法。

StorageScp.StorageLocation = @"C:\Users\USER\Downloads\DICOM\ScpTEST";
StorageScp.StartListening("LocalAETitle", 106);
while(!StorageScp.Started) System.Threading.Thread.Sleep(10);

请记住在关闭应用程序时停止监听。

StorageScp.StopListening(106);

然后,您只需在 StorageScp 类监听时进行 C-Move 调用即可接收 DICOM 文件。

MoveScuBase moveScu = new StudyRootMoveScu("LocalAETitle", "SERVERAE", "localhost", 104, "LocalAETitle");
moveScu.AddStudyInstanceUid(StudyUID);
moveScu.Move();

另外,如果您想将文件发送到 ImageServer,请查看 StorageScu.cs &使用该类做这样的事情......

StorageScu scu = new StorageScu();
scu.AddFileToSend(d.FileName);
scu.Send("LocalAETitle", "SERVERAE", "localhost", 104);

This is a NOTE / INFO for others::

As "Steve Wranovsky" stated, take a look at StarageScp.cs in the clearcanvas src. In there you will find the StorageScp class that I have successfully used to accomplish retrieving a file from my ImageServer.
First make sure you configure your Device port in your ImageServer under Admin/Configure/Devices to 106 or something.

Then this is how you start the StorageScp class to Listen on your port.

StorageScp.StorageLocation = @"C:\Users\USER\Downloads\DICOM\ScpTEST";
StorageScp.StartListening("LocalAETitle", 106);
while(!StorageScp.Started) System.Threading.Thread.Sleep(10);

Remember to stop Listening when you close your app.

StorageScp.StopListening(106);

Then you just make your C-Move call to receive your DICOM file while your StorageScp class is listening.

MoveScuBase moveScu = new StudyRootMoveScu("LocalAETitle", "SERVERAE", "localhost", 104, "LocalAETitle");
moveScu.AddStudyInstanceUid(StudyUID);
moveScu.Move();

Also if you would like to send a file to the ImageServer look at StorageScu.cs & to use the class do something like this...

StorageScu scu = new StorageScu();
scu.AddFileToSend(d.FileName);
scu.Send("LocalAETitle", "SERVERAE", "localhost", 104);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文