Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PyDicom basic use operation dicom file

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "pyDicom basic use operation dicom file", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "pyDicom basic use operation dicom file"!

Dicom file has been introduced earlier, so we need to read and write file information. I found that pydicom is a good library in python, which can help us to operate conveniently. It is said that it will be much more convenient than java.

Pydicom website introduces a more detailed https://pydicom.github.io/, as well as other modules Pynetdicom and Deid, the network is not currently used to understand.

Write a small demo here, that is, read a rtplan.dcm in the current directory (which I actually took from the dicom library from pydicom.data import get_testdata_files), then type the patient's name, and change the patient's name to save the file as newrtplan.dcm.

We can see what information ds has in debug mode, so that we can easily read tag information by using names, such as PatientName above.

Of course, we can also use the following writing methods, both of which are numbered, for example, PatientName is 0010. 0010, we can use either of the following ways.

Of course, to determine whether the attribute exists before processing, you can use the following way, but the individual still uses the hasattr (ds,'') method.

Of course, we can also delete a tag. We can use the following two ways

Deleted, I still have to add the data back, you can use ds.add_new

Here, the additions, deletions, modifications and queries of the data tag have been collected and need to be continued.

Finally, the installation method is intercepted from the official website. If you use python language, it should be clear. Unlike my rookie, you will be prompted to use the compiler.

At this point, I believe that you have a deeper understanding of the "pyDicom basic use operation dicom file", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report