Dicom Examples

0 views
Skip to first unread message

Matilda Equiluz

unread,
Aug 5, 2024, 4:12:17 AM8/5/24
to profusecad
hellosir,I like to know that when we upload dicom images to the dcm4chee, how to map that images to the patient added to the modality worklist and what parameters are required to configure in to xml of dcm image

On the following site you can find a few DICOM lossless JPEG files, in particular with the transfer syntaxes 1.2.840.10008.1.2.4.57 and .70. Consult the Transfer Syntax section for easy identification of which data sets that provide the requested transfer syntax.


Here's a large collection of dicom sample images: There are some JPEG lossless images among them. Some subfolders have images that are not valid DICOM, but that is usually documented. By the same maintainer there is also this list of links.


You could also setup a free PACS like DCM4CHEE or conquest, send it uncompressed images and have them forward the images jpeg-lossless compressed. The advantage of this is that you can create images of different color spaces, bit depths, planar/bypixel, etcetera. Color spaces are interesting: people sometimes make mistakes to transform the color space like for Jpeg lossy, which you should not do.


I'm very happy with the continued improvement of the Dicom import and export functionality and speed. However, there is one issue with the current implementation that makes it very unuseful if you do quantitative image analysis. It might be that I miss an option if not I think this should be fixed.


In the Mathematica documentation and examples, Dicom data is typically shown and imported as images which I understand for display purposes. But I consider the information in Dicom files as data, very well curated and standardized. For many (MRI) applications, the actual quantitative values of voxels stored in Dicom actually have meaning, values, and even units. For example in the image below each voxel value is actually a quantitative measure of T2 relaxation time in the heart, where the values are stored in milliseconds as voxel values as is also mentioned in the metadata.


Eventually, if I import this Dicom file into Mathematica I have to use a lot of tricks to get to the correct stored values. The Dicom images I use are stored as 12-bit Integers but are converted by Mathematica to a Numerical array with type Int16. Also, I have to specifically specify that I don't want any "DataTransformation" which by default rescales the data and actually changes some voxel values!!!!


Below are the obtained PF valued data I need with and without DataTransformation. Although the image on the right might look less appealing with default range and scaling it is actually correct when scaled apropriately.


Am I missing a correct option for getting the actual data stored? If not this should definitely be changed. Dicom is the international standard to transmit, store, retrieve, print, process, and display medical imaging information. With the current implementation, it is impossible to Import and Export such files without actually changing the stored data.


Importing a list of specific tags in one call to Import is not possible right now, but we will try to add support for this in the next release. Currently, MetaInformation can only handle one subelement which must be a string. In the simplest case this will be a name of a DICOM tag, e.g. "PixelData", but it is possible to pass a simple pattern to import a bunch of related tags at once, for instance:


That being said, you can still read a list of tags without calling Import multiple times if you are willing to use DICOMTools paclet directly (Import uses this paclet under the hood). Paclet functions are not documented and we don't guarantee backwards compatibility for them, but they often offer more flexibility then Import interface:


Two things to notice: paclet only works with full paths and does not handle compressed DICOMs, so we need an extra step to uncompress the sample file and secondly, values are imported as they are stored in the file, without post-processing or formatting (so for instance, numbers are imported as strings and dates will not be automatically converted to WolframLanguage DateObjects).


To answer your second question - Import only supports tag keywords, but the paclet can read tags using (group, elem) values. They can be specified in the form: "GGGG", "EEEE" (leading 0s can be omitted). For example:


I'm sorry to hear that you are having a hard time working with DICOM files in the Wolfram Language. As you correctly noticed, Import["f.dcm", "Image"] applies a number of transformations under the hood. We went for this design because otherwise a vast majority of DICOM files would return an all-black image by default, which wouldn't be very useful.


Now, with "DataTransformation" -> None you can import pixel data without any scaling or other transformations defined in the DICOM file, but it will still map the theoretical range of pixel values to the range of the NumericArray type. For instance, a 12-bit DICOM data will be returned in a NumericArray of type "UnsignedInteger16" (because we don't have a 12-bit wide in the system) and every value will be multiplied by 16 (which maps [0, 2^12) to [0, 2^16)):


Welcome to my personal blog, which serves as a sort of 'personal canvas' that helps me share my story as a software professional. I try to blogwhen I am able to, on topics such as health informatics, software development, as well as other topics such as history, science, and books. Recently, I started creating interactive quizzes on a variety of topics, which I believe are essential for any modern software development professional. Originally, these quizzes were created to help in my own learning and for presentations to my colleagues and clients, but have started making them available online so others might benefit from them. Your insights and interactions are warmly welcomed on these blog posts, articles, as well as quizzes, so we can collectively learn and grow together. Cheers!


HL7 is a family of cooperating standards which collectively help provide a set of organizational frameworks and guidelines to help in the design, implementation, administration and operationalization of systems that perform healthcare-related information exchange in an electronic format. The various standards contained within the larger HL7 umbrella (such as V2, V3, FHIR, CDA, etc) help define how patient care and any care provider-related information is communicated between the various parties involved. Kmowledge of these standards is vital to enable these disparate parties to exchange timely and critical healthcare data using standardized data types and a structured vocabulary set needed to achieve seamless integration between the various electronic health systems involved. My HL7 Tutorials should take someone with a background in any object-oriented language (C# or Java is preferrable) and illustrate how the static as well as runtime behavior of systems built using the HL7 standard will look like. I have recently added a small interactive quiz on HL7 topics to engage the learner. I plan to make this much more comprehensive in the future to benefit learners pursuing certifications in the health informatics area.


My DICOM Tutorials are a series of short and focused articles aimed at someone who is starting with DICOM and wants to understand the theory by relating to some practical code examples. DICOM is an extremely large standard (some 6000 pages and growing each day) and is intimidating even to those who work with it on a daily basis. My tutorials are an attempt to provide a "digest version" of the many areas in the standard. These articles do not require any prior healthcare background or knowledge from the readers. Only a background in any object-oriented programming language such as C#, Java or C++ is required. I have recently added a small interactive quiz on DICOM topics to engage the learner. I plan to make this much more comprehensive in the future to benefit learners pursuing certifications in the health informatics area.


In an effort to make my blog articles more engaging, I've crafted a series of interactive quizzesencompassing a variety of topics pertinent to the realm of health informatics. These include pivotal areas such as HL7 (V2, V3 and FHIR), DICOM, Web Security, REST APIs, Machine Learning, Internet of Things (IoT), regulatory standards and risk assessment frameworks (including HIPAA,SOC Framework and GDPR), on software programming including data structures and algorithms as well as software development concepts and best practices.


Over the years, I have come to strongly believe that quizzes are a great conduit for learning and act as catalysts for memory retention, allowing us to actively recall and apply information, which strengthens cognitive connections. Moving forward, my plan is to broaden the quiz topics and refine existing ones, such as HL7, DICOM and web security, to be more modular, thereby allowing learners the flexibility to engage with concise, manageable units at their preferred pace.


For example, there can be random few slices from the chest that suddenly appear in the abdomen (probably the images that were used for bolus timing). Also, what should be the ends of the data sometimes appear in the middle, like a frame shift.


If given a list of .dcm file paths, do you know if there is a specific dicom tag (eg Patient Position?) that simpleitk uses to determine how a stack of dicom files are ordered before being written into a 3D volume? Or maybe can direct me to that code?


I may not be explaining the issue well. For some scanners identical series IDs are assigned to multiple 3D images (eg small images used for bolus timing or reformatting from axial to saggittal etc). This prevents efficient use of simpleITK to convert from a clinically-derived dicom study folder.


The SimpleITK ImageSeriesReader it the class which handles a list of files when passes to sitk.ReadImage. The series reader does not sort the list of files, the files are read in the order they are specified. The method ImageSeriesReader::GetGDCMSeriesFileNames returns the files in the proper order. That is why I asked if you were using it.

3a8082e126
Reply all
Reply to author
Forward
0 new messages