dicom

Length of PixelStream in EvilDicom library

巧了我就是萌 提交于 2019-12-13 07:19:55
问题 I can't reconcile the length of the PixelStream containing the image, with the parameters for this particular image. 0028,0002 (SamplesPerPixel): 1 0028,0004 (PhotometricInterpretation): MONOCHROME2 0028,0010 (Rows): 432 0028,0011 (Columns): 432 0028,0100 (BitsAllocated): 16 0028,0101 (BitsStored): 12 0028,0102 (HighBit): 11 So it seems to me that this stream should be 432*432*2=365472 bytes long, however, EvilDicom reports a length of 155868, based on the debug in Visual Studio 2013. I

Extract sagittal and coronal cuts from axial view using pydicom

放肆的年华 提交于 2019-12-13 03:45:25
问题 I am trying to read a series of .dcm files which are by default show axial view. Below is the code: import os import numpy as np import pydicom as dicom from matplotlib import pyplot as plt root_dir = 'mydcomDir' def sortDcm(): print('Given Path to the .dcm directory is: {}'.format(root_dir)) slices = [dicom.read_file(root_dir + '/' + s) for s in os.listdir(root_dir)] slices.sort(key = lambda x: float(x.ImagePositionPatient[2])) pos1 = slices[int(len(slices)/2)].ImagePositionPatient[2] pos2 =

How to convert the ordinary jpeg image bytes to the DICOM native image bytes using C#

荒凉一梦 提交于 2019-12-13 02:04:54
问题 Currently I'm writing a module for the conversion of JPEG to DICOM Image Conversion. On analysis I've completed the tag rendering, now the image is not properly rendered in the DICOM file. Is there any algorithm to convert the JPEG to DICOM . 回答1: Continuing from Matthieu's response, here is a very simple way of creating a DICOM envelope for a JPEG stream using the excellent GDCM library and his referenced example (note I have used some helper classes, but is quite simple): ImageReader r =

Viewing dicom image with Bokeh

情到浓时终转凉″ 提交于 2019-12-12 17:41:01
问题 I'm trying to set the graph background to a dicom image. I followed this example, but the image data given from dicom.pixel_array isn't RGBA. I'm not sure how to convert it, either. I'm also not sure what exactly bokeh is expecting. I've tried finding specifics in the documentation, but not such luck. from bokeh.plotting import figure, show, output_file import dicom import numpy as np path = "/pathToDicomImage.dcm" data = dicom.read_file(path) img = data.pixel_array p = figure(x_range=(0,10),

Understanding the BPP inside DICOM images

痴心易碎 提交于 2019-12-12 11:38:35
问题 I'm working with DICOM files since a few days, using FO-DICOM. I'm using a set of dicom files for my tests, and I've been printing the "Photometric Interpretation" and the "Sample Per Pixel" values, to have a better understanding of what kind of images I'm working with. The result was "MONOCHROME2" for the Photometric Interpretation, and "1" for the Sample Per Pixel. What I understood by reading the part3 of the standard is that MONOCHROME2 represent a gray scale, starting from black for its

Connecting to dcm4chee using dcm4che from a JAVA program

僤鯓⒐⒋嵵緔 提交于 2019-12-12 11:08:11
问题 Update I dug deeper in dcm4che's source code and found that an IncompatibleConnectionException is thrown if either a connection is "not installed" or the types of protocols are not set or don't match. I don't know what it means that a connection is "installed" but this flag can be set manually, so I set it for both the local and remote connections to true (even checked them with getInstalled() whether they are "installed" - and yes they are now - previously this property was null ). And as to

how to add metadata to an image (with java code) and then convert it to dicom

家住魔仙堡 提交于 2019-12-12 06:52:07
问题 I found a java code that converts a jpg and a Dicom(it takes the metadata fri¡om that one) files to a final Dicom one. What I want to do is convert the jpg image into a Dicom one, generating the metadata with java code. BufferedImage jpg = ImageIO.read(new File("myjpg.jpg")); // Convert the image to a byte array DataBuffer buff = jpg.getData().getDataBuffer(); DataBufferUShort buffer = new DataBufferUShort(buff.getSize()); for (int i = 0; i < buffer.getSize(); ++i) buffer.setElem(i, buff

Dependency library not recognized during installation octave forge dicom package in debian linux

无人久伴 提交于 2019-12-12 04:56:29
问题 I ask this question on this stack exchange because it has (by far) the most posts about octave. I started using a linux environment and want to use octave for my work, for which the dicom package is essential (my data is in the dicom format and not readily converted to nifti because of its high dimensionality, it would require many,many seperate files). The dicom package is dependend on the gdcm library, which I have installed. The when installing the dicom package I get this error: fatal

Modifying a dicom image and saving it as raw data?

你离开我真会死。 提交于 2019-12-12 03:36:08
问题 Here is the matlab data, where I'm trying to modify the dicom image pixels. The dicom image is of 4D, 3d for the Rgb image and other dimension represents the fames. I take each frame and I modify the some specific pixel values and I try to save them whole dicom image data in raw format. The reason why I'm saving it in raw format is that I want to use this data as file in dcmodify command of dcmtk. So, my first question is, am I saving the raw data in correct format? If not, kindly suggest me

Converting DICOM files to text files [closed]

核能气质少年 提交于 2019-12-12 02:19:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I wanted to know if there's any ways i could convert DICOM files to text files(.txt or .doc)? Which would show me the attribute tags, name (if possible, not a ncecessity) , value and VR? Thanks. 回答1: The open source DICOM toolkit (DCMTK, http://dcmtk.org/) includes an application dcmdump which converts any DICOM