Storing a surface slice in a .mat file and plotting the stored slice
Show older comments
Hi,
I use the slice function in matlab to slice through an echocardiopgrahic volume. As i create several slices from the volume, i want to increase the speed of my function. I want to create all the slices I want to plot (180 x 30ish slices) and store them somewhere (.mat or something simmilar). Then I want to be able to extract one of the slices and plot it. Here is what i want to do:
create several slices s,s1,s2....
s=slice(X,Y,Z,vol,X_1,Y_1,Z_1,'linear');
s1=slice(X,Y,Z,vol,X_2,Y_2,Z_2,'linear');
s2..
save(s,s1,s2....)
If i want to plot s2:
plot(s2)
I know that it will take some time to store all the slices, but then i omit to use the slice function everytime i want a new slice. I have experienced that the interp3 function is rather slow. I do not want to store them as a image, but i want the surface structure to be the same.
Is this possible?
Accepted Answer
More Answers (1)
KSSV
on 16 Oct 2020
You save all the slices into a cell and save them into .mat file.
S = cell(N,1) ;
S{1} = slice(X,Y,Z,vol,X_1,Y_1,Z_1,'linear');
S{2} = slice(X,Y,Z,vol,X_2,Y_2,Z_2,'linear');
Now you can save S alone which is a cell into a .mat file.
3 Comments
Hans Martin
on 16 Oct 2020
Edited: Hans Martin
on 16 Oct 2020
KSSV
on 16 Oct 2020
You save the required X, Y, Z also,,,
Hans Martin
on 16 Oct 2020
Categories
Find more on DICOM Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!