MATLAB Answers


Create .mat similar to MRI for image processing

Asked by Christopher P. on 27 Apr 2013


I'm currently trying to create a .mat file similar to MRI.mat so i can load it into my workspace and display a 3D representation of MRI slices containing a malignant neoplasm. My end goal is to visualize the neoplasm in 3d space without the surrounding tissue. I plan to remove the other tissue from the images by creating binary slices with a high threshold (since the neoplasm is bright white, the surrounding tissue will = 0).

MRI.mat contains a matrix D which is 128x128x(1-27) for a total of 27 images. I have 12 images which have a height of 225 pixels and a width of 210 pixels. How can I create the same type of matrix so I contour the edges of the binary images to visualize the neoplasm in 3D space?

I've uploaded the images into matlab using this code %Load slice images into matlab I1=imread('Slice_1.jpg'); I2=imread('Slice_2.jpg'); I3=imread('Slice_3.jpg'); I4=imread('Slice_4.jpg'); I5=imread('Slice_5.jpg'); I6=imread('Slice_6.jpg'); I7=imread('Slice_7.jpg'); I8=imread('Slice_8.jpg'); I9=imread('Slice_9.jpg'); I10=imread('Slice_10.jpg'); I11=imread('Slice_11.jpg'); I12=imread('Slice_12.jpg');

%Convert slice images to binary to distinguish neoplasm BWI1=im2bw(I1,.95); BWI2=im2bw(I2,.95); BWI3=im2bw(I3,.95); BWI4=im2bw(I4,.95); BWI5=im2bw(I5,.95); BWI6=im2bw(I6,.95); BWI7=im2bw(I7,.95); BWI8=im2bw(I8,.95); BWI9=im2bw(I9,.95); BWI10=im2bw(I10,.95); BWI11=im2bw(I11,.95); BWI12=im2bw(I12,.95);



No products are associated with this question.

1 Answer

Answer by Jurgen
on 27 Apr 2013
Edited by Jurgen
on 27 Apr 2013

3D display on a 2D screen may not be the best option. Most MRI analysis programs just show slices from several directions.

I suppose you can just concatenate all the images along dimension 3. There are lots of files on the file exchange that seem to offer interesting options.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!