Processing Dicom images using Matlab

Source: Internet
Author: User

Recently, when processing CT images, CT images scan the human body layer by layer, and there are many unnecessary parts in the image, such as the ribs, as a result, there are many unnecessary parts of the 3D reconstruction image. Very difficult to handle.

As a result, I thought of a simple method to set unnecessary pixels to black for a dicom image. Originally intended to be implemented with VC ++ 6.0 + VTK, debugging is too troublesome, it is easy to directly use matlab for processing.

1. Read/write Dicom format images

I = dicomread ('e: \ CT \ 37222. dcm '); % read image metadata = dicominfo ('e: \ CT \ 37222. dcm '); % storage Information imagesc (I); % display image dicomwrite (I, 'e: \ CT \ 37222. dcm ', metadata); % write Dicom Image

2. Select the required rectangular area on the Dicom Image

This code implementation is very simple, and it also takes some twists and turns to find this method.

[Xv, yv] = ginput (2); %. In this way, you can select two points on the image, save the X coordinates to xv, and save the y coordinates to yv.

If many dots form a rectangular area, you can use in = inpolygon (x, y, xv, yv); to judge, x, whether the y coordinate is in the area surrounded by selected points.

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.