We help IT Professionals succeed at work.

How to find similarity between 2 dicom images in matlab

Medium Priority
1,230 Views
Last Modified: 2016-03-02
How to find similarity between 2 dicom images in matlab :

I have tryed PCA but it is not working due to dimensions issue while calculating eig values .

Do I need to first convert the images into jpg and the do ..., because using jpg images it works


Is there any we can do it directly on dicom images
Comment
Watch Question

CERTIFIED EXPERT

Commented:
How different are the images?  Where are they coming from?

What is PCA?  What are the specific dimension issues you are having?

Matlab have functions for cropping and rescaling images.

If you can make them the same size, centered on the areas of interest,
you shouldn't have any trouble.

Conversion to JPEG is a lossy process?  You may be losing information.
What happens if you convert to BMP, PNG, or TIFF?  They are not lossy.

If it "works" with JPEG conversion, what is the problem?
Puneet AroraFounder

Author

Commented:
I do not want to do conversion of the dicom images and directly find dicom similar images using
Principal Component Analysis + Finding Min Distance between the data points  or some other tech
CERTIFIED EXPERT

Commented:
I am not familiar with the Dicom format, but Matlab claims to have the tools you need.
Do you have the Image Processing Toolbox?

     http://www.mathworks.com/company/newsletters/digest/nov02/dicom.html
Puneet AroraFounder

Author

Commented:
I all ready have image processing toolbox

Commented:
DICOMREAD from Image Processing Toolbox reads DICOM file into 2D int16 array.
z = dicomread('dcmfilename.dcm');

Open in new window

If you use IMREAD to read JPG file, it returns 3D uint8. May be this is the source of your problem?

I'd recommend you to convert dicom image to double format with:
z = double(z)./double(max(z(:)));
imshow(z)

Open in new window


If you need 3D array you can replicate your image to 3 channels. It grayscale anyway:
z = repmat(z,[1,1,3]);

Open in new window


Try if it will work with your PCA.

If it does not work, can you show how you calculate the similarities? Are you doing it in MATLAB? Can you show the code?
Puneet AroraFounder

Author

Commented:
Yes I m doing using matlab .. will send the code tomorrow  , I have been traveling ..
Let me try the code suggested by yuk99:
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Commented:
I believe my solution is very close to answer and will be helpful as PAQ. The main problem is the data representation after reading dicom file. After running my code the author should have no problems with PCA or other methods to find similarities between images. The code was fully tested with MATLAB.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.