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

How to call command line command (AFNI command)?

I am trying to read a dicom header tag in dicom file. Now, there are two ways to read this dicom header tag. 1) Using pydicom package in python which apparently is not working well on my python installed version(python 3). 2) or when i call AFNI…
0
votes
2 answers

Bug in pydicom function

I wanted to work with pydicom for processing dicom images. Unfortunately I get the error File "/usr/local/lib/python2.7/dist-packages/dicom/dataset.py", line 372, in _pixel_data_numpy raise TypeError(msg % (numpy_format,…
arc_lupus
  • 3,942
  • 5
  • 45
  • 81
0
votes
1 answer

Parsing Dicom results with Python

I'm trying to parse the results page from a dicom study. I've tried with pydicom but it only parses the "header" info (patient info, device info, etc.). I'd like to extract the numeric results from the study in text format. In the following…
Neurus
  • 657
  • 4
  • 27
-1
votes
1 answer

How to read value length (but not value) in pydicom?

It seems I cannot find a way to read only the value length of some long tag in pydicom. I have tried the following, and while dcmread is very fast, dataset[tag] takes half a second to load 1.5 GB of data. However, I am not interested in reading…
bers
  • 4,817
  • 2
  • 40
  • 59
-1
votes
1 answer

(PyCharm) Pydicom ValueError

Python3.8 in PyCharm pydicom==2.1.2 numpy==1.20.2 When calling pydicom, I get this error: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject Tried upgrading/re-installing…
Stack_Protégé
  • 302
  • 1
  • 15
-1
votes
1 answer

Using Pseudo Color Softcopy Presentation State with Weasis dicom viewer

I plan to use Pseudo Color Softcopy presentation state(PCSPS) to map pixel values from grayscale space to rgb space. I don't want set the photometric interpretation in the original dicom file to 'Palette color'(it's MONOCHROME2) and add color lut to…
bharys
  • 182
  • 2
  • 10
-1
votes
1 answer

Python DICOM--pixel dimension

I beginner in DICOM file, how to find pixel dimension or dim in these files? As we find these elements in the nifti files!
leila mm
  • 17
  • 3
-1
votes
1 answer

Error while converting DICOM tags to Excel using Python

I am trying to convert and list DICOM tags from .dcm files into Excel (using pydicom), but certain tags are showing errors (Patient's Name, Patient ID etc) during conversion. Some of the tags are showing 'None' in the Excel file although they…
-1
votes
1 answer

How can I obtain axial slices of a 3D medical image saved as numpy array in python?

I have 3D volume medical image of size [284,143,143]. I want to extract axial slices from them and save them separatley in a folder. Can anyone tell me how can I acheive this in python.
-1
votes
1 answer

How does one read multiple DICOM and PNG files at once using pydicom.read_file() and cv2.imread()?

Currently working on a Fully CNN for renal segmentation in MR images. Have 40 images and their ground truth labels, attempting to load all of the images for pre-processing purposes. Using Google Colab, with the latest versions of pydicom and pip…
user13349602
-1
votes
1 answer

Comparison two values from two different classes "" and in Python

I want to compare some values using "if" in the code below, but it doesn't work: if Slice_num[person][i, [1]] == Z_pos: # Slice_num[0][15, [1]] is ['-10.000000'] and Z_pos = -10.000000 absname = os.path.join(root, dcmfile) Example: Values…
Ellie
  • 303
  • 2
  • 16
-1
votes
1 answer

How to pass a value to callback for anonymization without global variables?

I am trying to anonymize accession numbers with a fake custom AN with pydicom: def an_callback(ds, data_element): if data_element.tag == Tag(0x00080050): data_element.value = '0000000000' ds.walk(an_callback) I would like to pass a…
user252046
  • 399
  • 2
  • 11
-1
votes
1 answer

How to invoke C-STORE when trying to query from SCP

I've been using the following code, which is from the pynetdicom library to query and store some images from a remote server SCP, on my machine(SCU). """ Query/Retrieve SCU AE example. This demonstrates a simple application entity that support the…
Samimoti
  • 19
  • 5
-1
votes
1 answer

Trouble finding certain tag values

I'm trying to find the value of several tags using pydicom. For some reason only certain tags work while others do not. Below is a traceback explaining my problem. Can anyone see a way around the int() base 16 problem? >>>…
G Warner
  • 1,309
  • 1
  • 15
  • 27
-1
votes
1 answer

Exchanging the pixel_array for a DICOM RT Dose file - values change - pydicom

I have a DICOM RT Dose file that I want to change the original pixel_array with a new one. The problem is that when I give a certain pixel its new value, somewhere in the process it changes randomly. The block of code for the exchange is given…
1 2 3
18
19