Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dicom Files
#1
Hi,
I am using the following code to read one dicom file and write the info from that file to a text file.

ds=dicom.dcmread("mw_test.dcm")
file=open("mw_test.txt","w+")
file.write(str(ds))
file.close()
How can I expand this code for reading multiple dicom files from a directory and write the contents in a text fie with the same file name?
Yoriz write Oct-12-2021, 02:15 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Dicom Files - by spillai - Oct-12-2021, 02:08 PM
RE: Dicom Files - by Underscore - Oct-12-2021, 03:35 PM
RE: Dicom Files - by menator01 - Oct-12-2021, 06:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dicom image reading smitha 2 3,279 Feb-09-2020, 03:12 AM
Last Post: Larz60+
  DICOM Structure Files jcozzi1 1 2,306 Jul-20-2019, 07:40 AM
Last Post: scidam
  Trying to invert DICOM image with Python 3.6 newmanf 1 5,763 Feb-28-2018, 08:49 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020