dicom

How to fix encoding issues of pydicom in python

假如想象 提交于 2019-12-06 05:21:50
This is the code: import dicom ds = dicom.read_file(FILE_PATH) print(ds) Error: LookupError: unknown encoding: ISO 2022 IR 100 When using pydicom in order to look at data, I got the error above. I found 'ISO 2022 IR 100': 'latin_1' ,according to here . However, I didn't get how to fix this problem. Can you help me to solve this error? As indicated in the comments, the culprit was an out-of-date version of pydicom. Upgrading to a more recent version fixed this issue. 来源: https://stackoverflow.com/questions/45528897/how-to-fix-encoding-issues-of-pydicom-in-python

Validating DICOM File

隐身守侯 提交于 2019-12-06 05:10:54
问题 I have to pick all valid DICOM Files from folder. I can recursively pick all the files from the folder which have *.DCM extension. But any file with *.DCM also picked up and such file is not valid DICOM File. What is best way. I thought of reading few byte of the file and validating. Or Any Other Method or any other EXEs we have which validates. Thank you, Harsha Edit: Solution for the problem: I finally used the dcmftest.exe for verification. Hope I am on right track. -Harsha 回答1: Validating

Is the “Other Word” VR legal for an 8-bit RGB image?

南楼画角 提交于 2019-12-06 04:47:13
Recently I have seen some color DICOM files with big endian transfer syntax, where pixel data had OW (Other Word) value representation. Byte order in file is R1G1B1R2G2B2 etc AFAIK, according to DICOM standard (part 5, Section 8.1, The only difference between OW and OB being that OB, a string of bytes, shall be unaffected by Byte Ordering ), when converting this image to little endian, the byte order should be changed so that it will become G1R1R2B2B2G2 etc but this does not make any sense! This image was obviously intended to have Other Byte value representation. As interesting detail, the

Sending dicom file to a remote AE using c# in visual studio 2010

∥☆過路亽.° 提交于 2019-12-06 03:52:54
My goal is to send a dicom file to a remote AE using c# in visual studio 2010, I plan to implement the clearcanvas library, I have divided the task into 5 parts: // //1 initiate tcp\ip connection // //2 negotiate the association parameters to agree what can be done // //3 send the dicom object // //4 close the association // //5 close the TCP/IP connection I know storagescu will be involved in the sending part3), I tried looking things up on clearcanvas forum, the codes do not make much sense yet, so I do not know where to start from exactly, can anyone who had experience in sending dicom file

convert 16 bit grayscale DICOM image to 8 bit: the correct procedure

和自甴很熟 提交于 2019-12-06 00:32:13
I have been trying to create an image viewer for DICOM image. My program reads all the 8 bit colour and grayscale image almost correctly. But when I try to open a 16 bit image using the first 8 bits of the image, some parts are missing (pixels which uses 16 bit will be shown as dark instead of whilte). I don't really know how to use the window centre, window width, rescale slop and intercept. Please help me by giving the exact steps to convert 16 bit image to 8 bit image. Also I don't need to view the files which uses any compression technique to store the pixels. Thanks in advance. About

How to decide if a DICOM series is a 3D volume or a series of images?

喜欢而已 提交于 2019-12-05 21:29:05
问题 We are writing an importer for dicom files. How does one generally deceide if a series of images forms a 3D-Volume or is just a series of 2D images? Is there a universal way to decide this for most vendors? I looked a the DICOM tags and could no find an apparent solution. 回答1: The DICOM standard defines UIDs for describing the hierarchy. These are from top to bottom: Study UID - Identifier of the study or scanning session. Series UID - The same within a series acquired in one scan. Image UID

Best IEEE 754-1985 representation for X3.9-1978 based standard

蹲街弑〆低调 提交于 2019-12-05 16:07:21
As per DICOM standard, a type of floating point can be stored using a Value Representation of Decimal String. See Table 6.2-1. DICOM Value Representations : Decimal String: A string of characters representing either a fixed point number or a floating point number. A fixed point number shall contain only the characters 0-9 with an optional leading "+" or "-" and an optional "." to mark the decimal point. A floating point number shall be conveyed as defined in ANSI X3.9, with an "E" or "e" to indicate the start of the exponent. Decimal Strings may be padded with leading or trailing spaces.

Storage Commitment Service: why I really need a what is the real purpose?

送分小仙女□ 提交于 2019-12-05 13:14:20
I'm wondering why I really need of commitment after a c-store command; I can understand the commit is a sort of assurance about the fact the message was actually taken in charge by the storage and the storage takes the responsibility of it, but I wonder why is not safe enough to rely on the response status ? I read some explanations about that but none convinced me all the way. As far as I understood a commit can be required or better desirable basically because you can not totally trust the system you are sending the message to. Well it sound like: when you insert a record in a database table

Android development: how to open a .dcm file as a bitmap?

谁都会走 提交于 2019-12-05 05:33:15
问题 I'm currently trying to make an android dicom app Following code opens pictures drom res/drawable in "ussual" image formats, but it doesn't work with .dcm public class BitmapView extends View { public BitmapView(Context context) { super(context); } @Override public void onDraw(Canvas canvas) { Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.test); canvas.drawColor(Color.BLACK); canvas.drawBitmap(bmp, 10, 10, null); } } in the main activity: protected void onCreate(Bundle

how to replace pixel data on same dicom file using pydicom to read it again with any dicom viewer?

拥有回忆 提交于 2019-12-05 03:20:49
问题 I want to treat some DICOM files, so I'm testing pydicom for my work, which I think is considerably useful. And now I want to load existing DICOM files, replace the pixel data array with another pixel array (e.g. preprocessing or literally another DICOM pixel array) and most of all, I want to treat it again with any DICOM viewer application. For this test, I used the tutorial code below. This code loads a test data file. The size of image is 64*64. The code below does subsampling from the