reorienting 3D image stack
Show older comments
We have a set of xray images im(x,y)
They are a 3D set in height im(x,y,h) through hte plane of an object.
The object is on a xray platfrom and the planes are between the source and detector.
I can make a movie going through the planes without a problelm.
However, I want to be able to see it as if i was looking from the side of the image set rather than the top but I keep getting errors
figure, imshow(image2(50,:,:))
Error using images.internal.imageDisplayValidateParams>validateCData (line 118)
Multi-plane image inputs must be RGB images of size MxNx3.
clear
path = ['C:\Users\\OneDrive - \Desktop\alabama concepts\image sets\3D images\ImageData-Reconstructed slices DICOM\mini1\mini1\0\']
y = VideoWriter("newfile4.mp4", 'MPEG-4');
y.FrameRate = 3
y.Quality=100
open(y)
for n = 2:24+1
file = ['mini1_mini1_0_', num2str(n) '.DCM'];
im = double(dicomread([path, file]))/2^16;
im = imcrop(im,[200,500,2700-200-400,1800-500]);
imshow(im);
m = n-1;
image2(:,:,m) = im;
hold on;
text(50, 50, ' Example - - Mouse', 'FontSize', 16, 'Color', 'white');
text(50, 100, 'sample - \0\mini1_mini\', 'FontSize', 16, 'Color', 'white');
text(50, 150, ['ZAxis: ', num2str(n-1), 'mm'], 'FontSize', 16, 'Color', 'white');
text(50, 200, ['Contact - no magnification '], 'FontSize', 16, 'Color', 'white');
text(50, 250, ['33kv 900uA'], 'FontSize', 16, 'Color', 'white');
F = getframe(gca);
im2 = frame2im(F);
writeVideo(y,im2);
end
close(y)
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic 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!