stack multiple 2D images
47 次查看(过去 30 天)
显示 更早的评论
Hi,
I have 2D images pertaining to different Z positions (lets say 10 mm, 20 mm, 30 mm etc), Now I would like to stack images belongs to all Z positions on the single plot.. Could some one help how to do this ??
Right now, I plotting the image indivdual 2D image as follows
imagesc (x,y,B); % Where B is the matrix which got the intensity values
0 个评论
回答(2 个)
Bjorn Gustavsson
2021-5-21
Unfortunately matlab is a bit weak when it comes to displaying volumetric data. You can use the slice function and use the alpha-parameters to modify the transparency. Something like this:
for iZ = nZ:-1:1
V(:,:,iZ) = Bcell{iZ}; % just to get all the images into a 3-D array
end
idx_X = [12 37]; % Just example slices
idx_Y = [13 29];
idx_Z = [2 7];
ph = slice(X,Y,Z,V,idx_X,idx_Y,idx_Z),shading flat
and then setting the alpha and face-alpha-properties of ph (I have had some success using this earlier, when toying with this today, not so fortunate).
There's also a number of submissions on the FEX:
image3, imshow3d, 4-dimensional-visualization, hypervolume-viewer, sliceomatic, 3d-volume-slicer, 4d-volume-visualization and 3d-volume-visualizationviewer3d (I have surely missed a few...).
HTH
0 个评论
Tim
2021-5-21
Matlab's volume visualization got a big boost with volshow a couple years ago, if you have the image processing toolbox. Using the volume V from the comment above, use:
volshow(V);
There's a lot of rendering options. For example, I frequently prefer using a MIP's on a black background. E.g. try:
volshow(randn(100, 100, 100), 'Renderer', 'MaximumIntensityProjection', 'BackgroundColor', [0, 0, 0]);
It's tricker to visualize volume data if you have RGB voxels but there are some FEX options out there.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Basic Display 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!