Slice only returns black images even after importing the colormap

3 次查看(过去 30 天)
I have some trouble building the slice plots.
even with the thread https://de.mathworks.com/matlabcentral/answers/496845-slice-plot-gives-black-surfaces it didnt help me alot because even when i set the edgecolor to none it return black images as if it only plots the data without the colormap.
How can it be fixed? Is there a way to import the colormap into slice?
This is my code:
[pzt,map] = imread('*.gif');
A(:,:,:)=double(pzt(:,:,1,:));
slice(1:size(A(:,:,:),1), 1:size(A(:,:,:),2), 1:size(A(:,:,:),3)/10, double(A(:,:,1:10:50)), [], [], 1:size(A(:,:,:),3)/10)
colormap(map)
h.FaceColor = 'interp';
h.EdgeColor = 'none';
This is my result:

采纳的回答

Sascha Power
Sascha Power 2021-4-24
The answer was simple. Line 3 had to be changed. The new line is:
h=slice(1:size(A(:,:,:),1), 1:size(A(:,:,:),2), 1:size(A(:,:,:),3)/10, double(A(:,:,1:10:50)), [], [], 1:size(A(:,:,:),3)/10)
Then lines 4 and 5 had to be changed accordingly:
set(h,'EdgeColor','interp');
set(h,'EdgeColor','none');
colormap(map)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 White 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by