How to convert 2D images to 1 3D image
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have about 170 2D image slices of a brain. These are all saved in a .tif file. I want to take all these slices and put them all together to form a 3D image of the brain. I'm not sure where to even start, can anyone help?
Thanks
Update: This is what I have tried so far
FileTif='C:\Users\Taylor\Desktop\P_TH1_S_2237_29-Nov-2016_13.52.30_OCT.tif';
InfoImage=imfinfo(FileTif);
mImage=InfoImage(1).Width;
nImage=InfoImage(1).Height;
NumberImages=length(InfoImage);
FinalImage=zeros(nImage,mImage,NumberImages,'uint16');
for i=1:NumberImages
FinalImage(:,:,i)=imread(FileTif,'Index',i);
end
imshow(FinalImage)
Here are the errors I receive:
Error using images.internal.imageDisplayValidateParams>validateCData (line 115)
Multi-plane image inputs must be RGB images of size MxNx3.
Error in images.internal.imageDisplayValidateParams (line 27)
common_args.CData = validateCData(common_args.CData,image_type);
Error in images.internal.imageDisplayParseInputs (line 78)
common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 222)
images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});
Error in SignalsProject2 (line 18)
7 comentarios
zahra ghadery
el 30 de Ag. de 2021
hello
i have the same problem. Did you solve it? Would you please help me?
Image Analyst
el 30 de Ag. de 2021
@zahra ghadery if your images are color, then you'll have to convert them to gray scale to use this:
grayImage = imread(FileTif, 'Index', i);
FinalImage(:, :, i) = grayImage; % Gray scale
Otherwise you can try inserting the color image into a 4-D matrix:
FinalImage(:, : , :, i) = imread(FileTif, 'Index', i); % Color
Respuestas (2)
Image Analyst
el 30 de Nov. de 2016
MATLAB's 3-D volume visualization capabilities are pretty primitive. They're pretty much limited to cutaway views (slices) and isosurfaces, as you can see from Adam's links. If you need anything more advanced you'll have to use a program like Avizo: https://www.fei.com/software/avizo-3d/ which can do virtually anything you can possibly think of.
0 comentarios
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!