how to view image from MAT file

조회 수: 33 (최근 30일)
Ashbub
Ashbub 2017년 1월 22일
댓글: blues 2018년 10월 25일
Hi, I am new in Matlab. I have saved a 3D CT image data in MAT format and loaded it on Matlab. It shows [1x61x54 uint16] and 'struct' as data type. I need to do segmentation on the image. How can I view the image so that I can work on it? I don't have much idea about data structure. I badly need the solution. Thankyou.
  댓글 수: 2
Walter Roberson
Walter Roberson 2017년 1월 22일
That size could be one single plane of an image but it cannot be an entire 3d image.
Can you attach the mat file?
Ashbub
Ashbub 2017년 1월 22일
편집: Ashbub 2017년 1월 22일
Thankyou for your reply. Yes, you are right. I cropped the image in a way so that I can have only one slice to work on it. Here is the file.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2017년 1월 22일
Try this:
filename = 'trial.mat';
s = load(filename)
% Extract array from structure.
m = s.Avizo_trial_mat;
% Get rid of 1 dimension.
m = squeeze(m);
whos m
% Display the slice:
imshow(m, [], 'InitialMagnification', 500);
axis on;
  댓글 수: 12
Walter Roberson
Walter Roberson 2018년 10월 23일
So you would combine them as if they were rgb?
Note that 256 is a power of 2 and is not divisible by 3.
blues
blues 2018년 10월 25일
Not sure! I want to combine each three slices (say) to make a single slice of thickness 3 mm, so that I can print it.
The matrix I have is 256x256x256 (voxel size 1mm^3) array and would like to transform original matrix into 256x256x84 ( 256/3 approx. 84). The new matrix will have same dimension in x and y but slice thickness will be 3mm.
Based of the code posted above, I can easily see image slices. But I am thinking about to print the image slice with white matter (say, high intensity: 1.0) as 2 mm, gray matter (medium intensity: 0.5) as 1 mm, and background (low intensity part = 0) as 3 mm in a single slice. What is the way to do this? Plan is to make a meaningful stack of image slices to that I could 3d print them.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by