dicom | ⚡High Performance DICOM Medical Image Parser in Go | Messaging library
kandi X-RAY | dicom Summary
kandi X-RAY | dicom Summary
High Performance Golang DICOM Medical Image Parser.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dicom
dicom Key Features
dicom Examples and Code Snippets
Community Discussions
Trending Discussions on dicom
QUESTION
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, like so:
ANSWER
Answered 2022-Apr-11 at 16:47DICOM is essentially a 'three-dimensional' image format: it can store lots of images or 'slices'. However, since colour images are already 3-dimensional (height, width, RGB channels), DICOM datasets can actually be 4-dimensional (apparently... I didn't know this). At least, I think that's why there are four elements in the shape
of your dataset.
My guess is that the dataset contains 150 images, each of which having 768 by 1024 pixels and 3 channels.
So assuming ds.pixel_array
is array-like, you should be able to see the middle slice like so:
QUESTION
I have 142 Nifti CT images of the brain, I converted them from Dicom. Every NIfti file has the dimension of 512×512×40. My plan is to work with 3d Conv Neural Network for multi-class classification. How should I feed Nifti images in a 3d CNN?
...ANSWER
Answered 2022-Mar-28 at 10:38If you wish to use TensorFlow, you might consider the folowing steps:
- Load your dataset using tf.data
QUESTION
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 tell which DICOM belongs to which series.
What I have tried is using dcmodify (dcmtk) with some generate options :
...ANSWER
Answered 2022-Mar-02 at 08:42-gst -gse and -gin
QUESTION
Am not experienced in C
stacks, but am trying to build this DICOM project, it seems it's depending on a 'no-longer' existing project, so I tried to compile mdcm instead to generate the DLLs.
the generated dlls produce DICOM
and Nlog
, NLog didn't seem to work with the target project, missing classes etc ... when I installed Nlog version 1.0
using Nuget package manager
the missing classes issues got solved but now I get the below error message.
what are possible solution to this ?
...ANSWER
Answered 2022-Feb-25 at 14:13It means a dependency references a version of a package that is greater than the one you have installed into your app but your app reference will "win" since it is a direct reference, hence the error.
To fix it, you should install/upgrade to version 2 of NLog directly into your app although there might be build/runtime issues with that depending on the changes made in v2.
QUESTION
I'm trying to convert a video file (.mp4
) to a Dicom file.
I have succeeded to do it by storing single images (one per frame of the video) in the Dicom,
but the result is a too large file, it's not good for me.
Instead I want to encapsulate the H.264 bitstream as it is stored in the video file, into the Dicom file.
I've tried to get the bytes of the file as follows:
ANSWER
Answered 2022-Feb-09 at 08:59The trick is to redirect the value of the attribute PixelData to a file stream. With this, the video is loaded in chunks and on demand (i.e. when the attribute is accessed). But you have to create the whole structure explicitly, that is:
- The Pixel Data element
- The Pixel Sequence with...
- ...the offset table
- ...a single item containing the contents of the MPEG file
Code
QUESTION
I am trying to create a TensorFlow Dataset from DICOM images using the tf.data API and tensorflow_io, and I want to perform some pre-processing using Hounsfield units from the images. The DICOM images have a shape of (512,512). I have extracted the PixelData from the image and want to convert it to a numpy array of appropriate shape using the following code:
...ANSWER
Answered 2022-Feb-01 at 20:02The function tfio.image.decode_dicom_data
decodes the tag information and not the pixel information.
To read the pixel data use tfio.image.decode_dicom_image
instead.
QUESTION
I'm trying to read a number of Siemens DICOM images with DCMTK, some of which are mosaic images. I'm looking for a quick way to find those.
What I can see with mosaic images is that this is specified in the ImageType tag, e.g.
...ANSWER
Answered 2022-Jan-26 at 11:17Image Type (0008,0008) is a multi-valued attribute. That is, it may include several values which are separated by the backslash character. Note, that "officially", the backslash is not part of the attribute's value. It is a delimiter between several values of the attribute. This is what you have. So in terms of DICOM, there is no "one value" but multiple ones. The DCMTK API allows you to handle this (of course).
findAndGetOFString() has a third parameter ("index") to define which of the multiple values you want to obtain.
The behavior that you probably expect is what findAndGetOFStringArray() does.
As an alternative, you could iterate through the multiple values of the attribute by obtaining the "Value Multiplicity" first and then loop through the values like
QUESTION
I am trying to take in an RGB fMRI scan as input and output the same scan but in grayscale with the color parts "burned" white essentially.
Whenever I try and modify any of the Data Elements, such as Photometric Interpretation and Samples Per Pixel, and use save_as to write the new dicom file, I am unable to open that dicom scan with the dicom viewer giving me the error that it isn't a dicom image.
My code is below.
Any help is appreciate. Thanks in advance.
...ANSWER
Answered 2021-Dec-21 at 06:51The main problem is that your array has the wrong type - it is float instead of byte, so what is saved to the pixel data is a byte representation of float values (which are 4 bytes each). Also, you are setting BitsAllocated
to 16, meaning that you expect 2 bytes per pixel, but in your computation you only have a byte range, e.g. you need only 8 bits per pixel.
Lastly, you had a typo in PhotometricInterpretation
("MONOCRHOME2" instead of "MONOCHROME2").
Here is a possible solution, that converts the float array to a byte array:
QUESTION
I am working on a project to fuse two DICOM Image by myself.
Image 1 (168x168) When the images of Image 2 (512x512) are combined, the two images do not match at all.
I don't think there's a problem with the merging script, but If you think the merging code is the problem, you can ask for it.
Image 2 (512x512)
Image 1 (168x168)
Upsizing is finished Image 1 (168x168) => Image 1 (512x512)Image
fusion result
The red part of the picture should match the gray part.
If you look closely at the picture, you can see that the scale is slightly small and does not exactly match up, down, left and right.
Problem (I guess)
When changing from 168 to 512, the decimal points are multiplied and the pixel values of small points are lost.
Since the 512x512 Image 1 is not fixed in the center, if I increase the scale and do not give a padding value, it will not fit.
it is resize code
...ANSWER
Answered 2021-Dec-20 at 07:24thankyou for nucleaR
i make
- The ImageOrientationPatient value is the XYZ value of the cropped position
- PixelSpacing This is the data value of this voxel. The actual size of one pixel can be calculated from this.
- Before resizing the image, since the PT coordinates are larger, the corresponding pixels must be cut from the pt coordinates. How to calculate cropping this pixel is important
- If you cut pixels, you have to cut 168 because it will be based on 512 pixels.
QUESTION
I am trying to understand which attributes are required and which are not. As far as I understood you look at the corresponding IOD to your SOP class and then check which modules are mandatory or not. Then in the modules you can see which attributes are required and which are not. For example if my SOP class is multi frame ultrasound images, I look at the corresponding IOD, which can be seen on this page: https://dicom.nema.org/dicom/2013/output/chtml/part03/sect_A.7.html
Then I see a module called "Clinical Trial Subject", it's usage says U, which means it's optional. However when I check the module on this page, I see multiple attributes which are listed as type 1, which means these attributes are required. I was wondering if I should add these attributes in the DICOM header or if I can ignore it because in the IOD it says this module is optional.
...ANSWER
Answered 2021-Dec-16 at 14:39What this means is that the module itself is optional, but if you have the module then those elements are mandatory within the module.
This makes sense logically: obviously a single study may, or may not, be a clinical trial - hence the clinical trial module is optional.
However if a study is part of a clinical trial, then there are definitely some information you always want to know. So those elements within the trial module are mandatory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dicom
To build manually, ensure you have make and go installed. Clone (or go get) this repo into your $GOPATH and then simply run:. Which will build the dicomutil binary and include it in a build/ folder in your current working directory.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page