1,149 questions
-1
votes
0
answers
38
views
PyQtGraph ImageView: ViewBoxes are Linked, How to Separate Them? [closed]
I am building a DICOM viewer using pyqtgraph.ImageView, but I'm facing an issue where all the views seem to share the same ViewBox.
I can display different images in each ImageView, but when I set the ...
0
votes
1
answer
42
views
Duplicate Frames When Converting NIfTI to DICOM SEG Using itkimage2segimage [closed]
I'm converting a NIfTI file with multiple segmentations (e.g., Liver and Spleen) into a DICOM SEG file using the itkimage2segimage tool from dcmqi.
For example:
Input NIfTI: 203 slices with 2 labels (...
0
votes
1
answer
39
views
How to use BitsAllocated and PixelRepresentation to read image
I am using dcmtk to read dicom. In this dicom, the BitsAllocated=16, and PixelRepresentation=1. It means the type of pixel data is a signed int 16. Then, I use e->getSInt16Array(pImg) to read ...
0
votes
1
answer
59
views
How to read the per-frame info from a multi-frame dicom
I am using dcmtk to read a dicom. This dicom file contains 100 image. Each image has a PatientPosition. How can I get these 100 PatientPosition?
If DicomImage can provide the 100 PatientPosition?
If ...
1
vote
1
answer
33
views
Problem with PixelData when writing 3D numpy array to DICOM
I want to write a grayscale 3D pixel array to DICOM, but I have no previous experience with this daunting file format.
Minimum reproducible example:
I've used pydicom and get error that I think is ...
1
vote
1
answer
74
views
How to sort DICOM images in reverse order (by Slice Location) with SimpleITK?
I am new to SimpleITK, so I would really appreciate any help! My question is specific to SimpleITK (not Pydicom).
I imported CT DICOM slices from a directory and opened them using SimpleITK. The ...
1
vote
1
answer
55
views
multiplying a constant value in a dicom RT Dose
I am beginner in Python. I have exported the RT Dose file from treatment planning system and I want to multiply its voxel values in a constant value (int or float). I have written the following code ...
3
votes
1
answer
154
views
16-byte offset in MPEG-4 video export from DICOM file
Short version: Where is the 16-byte offset coming from when exporting an MPEG-4 video stream from a DICOM file with Pydicom via the following code? (And, bonus question, is it always a 16-byte offset?)...
1
vote
1
answer
68
views
Z-orientation of 3D RTDOSE pixel data
I am in a position where I have a 3D numpy array with dose values, along with the ImagePositionPatient DICOM values for each slice. These position values are extracted from a CT DICOM series which I ...
1
vote
1
answer
181
views
Is there really no pixel data in DICOM files of SOP Class RawDataStorage?
I'm working on a project that securely moves DICOM files from one facility to another (PACS to PACS link, much like a VPN but without all the associated headaches in management and maintenance etc) ...
2
votes
1
answer
214
views
Which DICOM Tag should we use to differentiate between the series?
We've been working on DICOM datasets for a while and we have the following problem right now. We have been dealing with the Prostate-MRI case and we have the difficulty to distinguish between ...
0
votes
1
answer
287
views
How do I use dcmtk to create images in DICOM format?
I want to create multiple frames of images in DICOM format, and the format of the images can be viewed using dcmdump as follows:
Tag
Value
(7fe0,0010)
OB (PixelSequence #=2)
(fffe,e000)
pi (no ...
0
votes
1
answer
158
views
Save compressed DICOM image without having to temporally save uncompressed DICOM
I have a DicomInterface class that inherits from DcmDataset class. After setting the DICOM tags, I want to save the DICOM image with JPEG Process 14 transfer syntax. If I first save the DICOM file ...
1
vote
1
answer
223
views
Why my DICOM MWL SCP only sends SUCCESS response without dataset?
I am trying to code a simple DICOM MWL Worklist SCP using pynetdicom. There is no example provided from the documentation besides saying its the same as C-FIND.
Below code only sends the status ...
0
votes
2
answers
308
views
Use DCMTK to read a JSON-formatted DICOM dataset
OFFIS DICOM Toolkit (DCMTK) offers functionality to convert a DICOM dataset to JSON (see below) but can the toolkit be used to read a JSON-formatted dataset somehow?
The C++ implementation can write ...
0
votes
1
answer
234
views
Import standard tags to a DICOM file with pydicom
I am trying to create a program that can add multiple undefined tags in DICOM files.
For the moment, I'd import the tags and values thanks to a CSV file.
This is my current code, it parse through the ...
1
vote
1
answer
190
views
Receive private SOPClassUID images in pydicom
I am trying to accept all the presentation contexts in the association negotiation.
After adding the abstract syntax to the supported context, the association is getting aborted. Logs -
D: Accept ...
1
vote
0
answers
149
views
Are DICOM attributes always sorted by tag?
It seems to me that in all DICOM files I checked, the attributes are sorted by their tag, in increasing order, with the pixel data at the end. I checked the DICOM standard, but I cannot find anything ...
0
votes
1
answer
534
views
Create a new private tags in a DICOM file
I am currently trying to build a plug-in for Orthanc, an open-source server for DICOM Images.
That plug-in will be a viewer that will need some metadata of the images to work properly. Metadata that ...
0
votes
3
answers
992
views
How can I fix "unable to convert dataset from 'JPEG Baseline' transfer syntax to 'Little Endian Explicit'" while using DCMTK-Toolkit?
I'm trying to send an image as a DICOM-file ((0002,0002) Media Storage SOP Class UID 1.2.840.10008.5.1.4.1.1.7 --> Secondary Capture Image Storage) with the DCMTK-Toolbox storescu to the ORTHANC ...
1
vote
1
answer
761
views
Pydicom error while resizing dicom file - ValueError: The length of the pixel data in the dataset doesn't match the expected length
I am new to working with DICOM files.
I want to resize a non-square DICOM image, e.g., 512 x 768 pixels and rescale it to 512 x 512 without either dimension being squashed or stretched. So this ...
0
votes
1
answer
396
views
How do I decompress/unencapsulate Pixel Data fragments using dcm4che?
When reading the Pixel Data with dcm4che, it returns an object of type Fragment, which has a byte array with a size of 219576 bytes, however the image size is 512x512 with each pixel occupying 16 bits,...
0
votes
1
answer
382
views
How to get the Study Instance UID (0020,000d) from DOS and display it in a memo with Delphi/Delphi 5 correctly? (DICOM)
i'm currently trying to implement a procedure called "GetDosOutput" in Delphi 5/ Delphi 10. In this procedure I want to get the DOS output from a worklist query (via DCMTK toolbox) and ...
1
vote
1
answer
217
views
get scale of image (px/cm^2) in pydicom
I have multiple ultrasound images in dicom file. I need to extract information about scale of the image, i.e pixels/cm^2. Is there any dicom tag containing following information? Or should I calculate ...
1
vote
1
answer
77
views
DICOM images displaying strangely
See Image
I wish to write Python code to perform these functions:
Among the DCM files entered in TE_lineedit, pair 2 files so that TE2 is greater than TE1.
The T2 value for each pixel array is ...
0
votes
1
answer
323
views
Range of Pixel Data for a Dicom File
I am trying to combine several dicom files in a larger one using python3 with pydicom library and encounters an error message I do not understand.
Let several dicom files be given. We assume that each ...
0
votes
1
answer
213
views
Multiframe Dicom file not readable by some viewers
I have developed a program in C++ that works in 2 major steps :
extract frames from a video with ffmpeg and convert them to jpeg
ffmpeg -i videofile.mp4 -q:v 1 -r desired_framerate tmp_04%d.jpeg
...
0
votes
1
answer
948
views
SimpleITK WriteImage Error, DICOM does not support this component type
I am getting this error when running my program:
RuntimeError: Exception thrown in SimpleITK ImageFileWriter_Execute: D:\a\1\sitk-build\ITK\Modules\IO\GDCM\src\itkGDCMImageIO.cxx:1392:
ITK ERROR: ...
2
votes
2
answers
2k
views
DICOM slice thickness in Python
I'm working on a project that requires slicing a 3D .stl file into a stack of DICOM slices, and I need to get the distance between the slices. I have figured out how to include the real .stl ...
0
votes
1
answer
678
views
Edit private tag with Pydicom
I am trying to edit a private tag from a RTPLAN with Pydicom
First, I read the dicom file :
ds = dicom.read_file('dicomfile')
The tag I want to modify is
I tried the command : ds[0x4001, 0x1012] = '...
2
votes
1
answer
1k
views
How to mask a DICOM image?
I would like to analyze only "Bone" regions extracted from Head CT.
For that, I read the DICOM files and masked regions where pixel values were less than 200 by filling in "0".
...
1
vote
1
answer
913
views
Extract DICOMDIR slices and convert to mp4 file
I have a DICOMDIR file with a lot of dcm files in it. I have extracted the .dcm file with Instance Number 1. It has 49 slices/frames. I wnat to convert those frames into an mp4 format. My code gives ...
0
votes
1
answer
193
views
Count number of responses to a findscu query
What is the best way to get the number of responses of a findscu query?
For now I am thinking of exporting the responses to an .xml file and count the tags. Is there a better way?
-2
votes
1
answer
212
views
Fo-Dicom Window Change is slow
I am using the following render code. This is a slightly modified code because, in the actual code, I am getting all the files from the FTP server. CurrentWindowCenter and CurrentWindowWidth hold the ...
0
votes
1
answer
514
views
How can I get my dicom splitter/divider to save split/divided images?
I have cobbled together some code on python, to try and work through a folder of dicom files, splitting each image in two.
All my dicom files are X-rays of both the left and right feet, and I need to ...
0
votes
1
answer
482
views
What exactly are the conditions for DICOM Type 1C or 2C key attributes?
I am trying to understand DICOM modality worklist information model and its associated matching and return key attributes. In the DICOM specs (DICOM PS3.4 2022d - Service Class Specifications -> K....
2
votes
1
answer
811
views
PyDICOM Returns KeyError Even Though Field Exists
I'm reading in a DICOM with pydicom.read_file() like this:
x = pydicom.read_file(/path/to/dicom/)
This returns an instance of FileDataset but I get an error when trying to access a value like this:
x[...
0
votes
1
answer
257
views
Window width and Center and Hounsfield units [closed]
I am currently adjusting the brightness and contrast of a grayscale image using fo-dicom.
Loading the image:
_dicomFile = DicomFile.Open(GetImageFileName());
_dicomImage = new DicomImage(...
0
votes
1
answer
472
views
Invert grayscale using fo-dicom
I'm currently using fo-dicon to build a simple dicom viewer in C#. I am currently increasing or decreasing the brightness and contrast by adjusting window width & center values.
How do I invert ...
0
votes
1
answer
290
views
Is it possible to let DCMTK's writeJson() write tag names?
I am using the DCMTK library in my program, which among others writes a JSON. With the DcmDataset::writeJson() function I can put the whole header in the JSON in one call, which is very handy, but the ...
-1
votes
1
answer
238
views
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 '...
-1
votes
1
answer
2k
views
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!
2
votes
1
answer
788
views
Fo-dicom: How to add "empty, if unknown" integer string type 2 attribute
There is a tag which is of type 2 ("required, empty if unknown"), with value representation Integer String which I would like to leave empty. I have tried creating the attribute like so:
var ...
0
votes
1
answer
244
views
Is it possible to retrieve beam real world position from RT PLAN
I am currently working on some radiotherapy plan generation and I am trying to retrieve the beam source position from a DICOM RTPLAN file and point it on a related CT-Scan 3D image.
With the RTPLAN, I ...
0
votes
1
answer
311
views
Image note correctly displayed after transforming to Hounsfield Units
I am working on CT scans and specifically interested in the liver area. I am trying to convert pixel values to Hounsfield Units using the following function in python:
def transform_to_hu(slices):
...
1
vote
1
answer
4k
views
Get all images of a multi-frame DICOM file
I'm trying get all images in a multi-frame DICOM file. Right now I was successfully able to see and save a single image in a single-frame DICOM file, by using the pydicom and matplotlib libraries, ...
2
votes
1
answer
1k
views
How can I update all UIDs of a DICOM study while maintaining its structure?
I have a DICOM study with 3 series and want to refresh its UIDs (StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID) to do some tests. All the data is in a single directory so it's not possible to ...
1
vote
1
answer
684
views
With Fo-Dicom, how do you make a case-insensitive MWL CFindRequest?
I can make these great worklist queries like this one...
//Worklist MWL PATIENTID query
var cf = DicomCFindRequest.CreateWorklistQuery();
cf.Dataset.AddOrUpdate(DicomTag.PatientID, szPatientIDsearch);
...
1
vote
1
answer
388
views
finding the size of an item in a Siemens DICOM tag
I am tryying to read a multi-slice (Mosaic) DICOM image from a Siemens scanner in C++, using DCMTK to read the tag and information on the nibabel pages.
As I understand, Mosaic images have a CSA ...
1
vote
2
answers
336
views
Dicom Windowing: Difference between linear default standard formula and window width changes
What is the difference between applying the Default Linear function for windowing to get the pixel value to display like so
These Attributes are applied according to the following pseudo-code, where ...