How do I set the window location and window width when Itk reads CT DICOM?

Source: Internet
Author: User

Keywords: DICOM Itk CT unclear window width

Fragment:

I recently used Itk to read DICOM. Before hearing the task, I didn't even know what Itk and DICOM are. of course, when I first heard the task, I only had the "what is this code? "" What is this code? "...

After being disgusted with the progress for a few days, I may have some knowledge of these concepts. then, when trying to display DICOM into JPEG, I changed it according to the example in the Guide. The result shows that the JPEG image is not as clear as that of another software.

In the process of trying, the concept is limited, and the search capability is also greatly reduced, so you can only experience it yourself.

Of course, after a few days, this problem has been solved. To facilitate the use of Chinese, let's make a simple record here.

============================

Concept of Itk: omitted

DICOM concept: omitted

 

Problem:

(CT image) DICOM files are read using Itk and then recompressed. The resulting images are unclear or have a strange contrast or the background color is not pure black and many other difficult to describe strange scenes.

Solution:

After reading the file, find the DICOM window center and window width, and use the two parameters to convert them using the itkintensitywindowingimagefilter filter and write them into the new file.

 

Key points:

1. When searching for the window space and window width, you can refer to the example ("printing DICOM tags from one slice") provided in the Guide and use itkmetadatadictionary and itkmetadataobject.
2. When setting, you can refer to the built-in example of Itk source code (filtering \ resamplevolumestobeisotropic. cxx) and use itkintensitywindowingimagefilter.

Note that the maximum value (setwindowmaximum) and minimum value (setwindowminimum) must be calculated based on the window space and window width.

(Max = Window center + window width/2.0f; min = Window center-window width/2.0f)

3. (CT only) if you still think there is a problem,Do not use intercept and slope for calculation.The two parameters are calculated when the Itk reads DICOM. Theoretically, it does not need to be calculated again.

 

The above is the content that has been around for a few days.

In addition, don't ask me why I don't like to post code. The advantage of code pasting is that the code language is universal around the world and everyone can understand it, and everyone can copy it directly, but the disadvantage is that many people directly copy the Code regardless of the Code strength, and they don't know what the problem is. so I just wrote my thoughts and implementation, which is the most annoying.

How do I set the window location and window width when Itk reads CT DICOM?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.