How to convert 2D images to 1 3D image

11 ビュー (過去 30 日間)
Taylor Heilig
Taylor Heilig 2016 年 11 月 30 日
コメント済み: Image Analyst 2021 年 8 月 30 日
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 件のコメント
zahra ghadery
zahra ghadery 2021 年 8 月 30 日
hello
i have the same problem. Did you solve it? Would you please help me?
Image Analyst
Image Analyst 2021 年 8 月 30 日
@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

サインインしてコメントする。

回答 (2 件)

Jan
Jan 2016 年 11 月 30 日
編集済み: Jan 2016 年 11 月 30 日
You find some solutions in the FileExchange, when you search for "Slice 3D":
Hint: Even asking Google for "Matlab slice 3D" might help in such cases.

Image Analyst
Image Analyst 2016 年 11 月 30 日
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.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by