Questions tagged [pydicom]

pydicom is a pure Python package for working with DICOM files such as medical images, reports, and radiotherapy objects.

pydicom is a pure Python package for working with DICOM files. pydicom makes it easy to read these complex files into natural pythonic structures for easy manipulation. Modified datasets can be written again to DICOM format files.

Resources

276 questions
0
votes
2 answers

Can pydicom tags be accessed by dot notation?

A very simple pydicom examples involves reading a file and then outputting the Series Time: import pydicom info = pydicom.dcmread("file.dcm") print(info.SeriesTime) So for an object having been read, dot notation is a working alternative to more…
bers
  • 4,817
  • 2
  • 40
  • 59
0
votes
2 answers

Import image data sets in order

I am trying to import 3D images in-order and link the identifying labels to each folder. Currently I have the code to do this for dicom files but I am trying to work with .tiff image files also: data_dir = "\\tiff\\" patients = …
rzaratx
  • 756
  • 3
  • 9
  • 29
0
votes
2 answers

How to convert DICOM-RT structure Contour data into image coordinate?

I use Python-pydicom module to load a patient sample: def load_data(sample): data=dict() # dcms data dcms_data=dict() for dcm_file in sample['dcm_files']: # 遍历读取数据 ds = pydicom.dcmread(dcm_file) array =…
yooongchun
  • 3
  • 1
  • 3
0
votes
1 answer

TypeError: iteration over a 0-d array, using numpy and pydicom

I am trying to create a simple DICOM viewer, in which I plot the image using matplotlib and I want to show that same plot(which is a DICOM image) in tkinter, but when I run the code I get this error. please help. The error occurs when I try to plot…
0
votes
1 answer

Align two Dicom series

I am completely new to CT image world. So thank you in advance I have two dicom series of Same patient. For both of the series, first slice information is Series 1 'ImagePositionPatient', ['-205.0966796875', '-384.0966796875',…
Makau
  • 71
  • 2
  • 10
0
votes
0 answers

Is there a way to construct a single dicom image from multiple dicom images in python (pydicom)?

I have 4 different dicom images of a particular patient. I want to recreate a dicom image from them such that the final image shows the details of patient and 4 images on top of it. Output DCIM
zender
  • 1
  • 2
0
votes
1 answer

Orthanc anonymize dcm file, is there a way to directly convert dcm file without generate an anonymized file first

From the official web site of Orthanc, we may find that the way Orthanc anonymize the file: curl http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/anonymize -X POST -d '{}' > Anonymized.dcm So this step will create a…
0
votes
1 answer

AttributeError: 'FileDataset' object has no attribute 'ImagePosition'

for person in range(0, len(dirs1)): for root, dirs, files in os.walk(os.path.join(path, dirs1[person])): dcmfiles = [_ for _ in files if _.endswith('.dcm')] for dcmfile in dcmfiles: dcm_image =…
Ellie
  • 303
  • 2
  • 16
0
votes
1 answer

Permission denied when run python script whnich is trying to open dicom file

I was running a local python flask service to open/analyze the dicom file in windows env python -V => 3.6.5 pydicom => 1.1.0 ... import pydicom but when i run into this line ds = pydicom.dcmread(dicom) the "Permission error"happened the…
0
votes
2 answers

Processing Xray Images (.dcm files) using pydicom (could not find SliceThickness Attribute)

I am new to Image Processing and want to know how can I pre-process dicom images using python. I am following the below tutorial:dicom in python I do not have the SliceThickness attribute in my data. How can I calculate it? This is a sample dataset…
Trisa Biswas
  • 555
  • 1
  • 3
  • 17
0
votes
2 answers

when i use pydicom, errror printed..IndexError: list index out of range

Using pydicom to try to read a test file like so: from pydicom.data import get_testdata_files pass_dicom = "CT-MONO2-16-ankle.dcm" filename = get_testdata_files(pass_dicom)[0] I get an error Traceback (most recent call last): File "t.py", line…
0
votes
1 answer

Read new DICOM files in folder with pyinotify and pydicom

I'm trying to process new files in given folder with pyinotify watchdog with this code: import pyinotify import pydicom as pyd class EventHandler(pyinotify.ProcessEvent): def process_IN_CREATE(self, event): if not event.dir: …
0
votes
1 answer

AttributeError: 'FileDataset' object has no attribute 'PixelSpacing'

I want to convert the filetype of a series of images from .dcm to .mha. Following is my code: import numpy import pydicom import os PathDicom ='./DicomResource' lstFilesDCM = [] for dirName, subdirList, fileList in os.walk(PathDicom): for filename…
dudu114
  • 21
  • 4
0
votes
1 answer

Display an array as an image Tkinter

I'm attempting to display an image from a compressed DICOM data array using tkinter. I compressed the image to an 8-bit numpy array. I know that the array can be visualized, as I have visualized it using both cv2 and matplotlib. Below is how I…
ekil
  • 1
  • 1
0
votes
2 answers

Is there a way to send DICOM data to specific directories on remote PACS server?

I am getting a hang of communication between SCU and SCP for DICOM servers and images. I am using a ClearCanas PACS server and have access to the web GUI. Using the following code, I am able to send DICOM dt from SCU(my computer) to SCP(remote…
SamAtWork
  • 455
  • 5
  • 17