Dicom network communication (1)

Source: Internet
Author: User

The more you look at the standard, the more obscure it is. The root cause is that dicom is very abstract, which is obtained by "experts. No way.

 

What kind of service is and what kind of sop, I believe you don't know how to start with the dicom standard. Isn't it socket? How hard is this. First of all, you have to understand that the magic horse is called a pdu. Pdu is the pdu protocol data unit. You can understand it as a socket packet. Its structure is that the first 1 byte is the pdu type, and then the first byte is always 0, then 4 byte indicates the Data Length and then the data with the specified length.

Diagram:

Then I made some test data to write this blog, all of which are binary files.

 

Well, then we will design a program immediately and then we will do the following:

                   Main(              TcpClient client =              client.Connect(,              NetworkStream stream=              [] data = dump(             [] data_res =  [              len =              stream.Write(data,              stream.Read(data_res, ,              stream.Read(data_res, ,                           Array.Reverse(data_res, ,              len = BitConverter.ToUInt32(data_res,              stream.Read(data_res, , (              data = dump(             stream.Write(data,              stream.Read(data_res, ,              stream.Read(data_res, ,              Array.Reverse(data_res, ,              len = BitConverter.ToUInt32(data_res,              stream.Read(data_res, , (              data = dump(             stream.Write(data,               [] dump(              [] datas =  [             datas[] =                            datas[] =                   datas[] =               datas[indx] = datas[indx].Trim().Replace( ,              datas[indx] = datas[indx].Replace(,              datas[indx] = datas[indx].Replace(,               [] data =  [datas[indx].Length /               ( i = ; i < data.Length; i++                  data[i] = ()Convert.ToInt32(datas[indx].Substring(i * , ),                  }

Well, let's test, we always use this program for testing: http://www.mrxstudio.com/is also compiled by myself.
Success, echo response test successful:

After understanding this, you can't put this shit to someone else every time. The parameters are different and the request's various instance uid dimse commands and data are different, no error is reported. This is a dicom protocol program. It is not a common socket program, although it is based on socket. Understand what you have to do. Frankly speaking, there is no technical content, but this is a very large project and it will take a long time. This is the process flow chart from the negotiation connection to the printing process:

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.