Commit 4bef7355 authored by Simon Maretzke's avatar Simon Maretzke
Browse files

Improved auto-determination of color axis

parent 9fa19a53
......@@ -81,25 +81,31 @@ else
end
clf;
%
% Plot central slices if no slice indices given
if isempty(settings.sliceIndices)
settings.sliceIndices = ceil(size(obj)/2);
end
for sliceDim = 1:3
slices{sliceDim} = squeeze(getSlice(real(obj), settings.sliceIndices(sliceDim), sliceDim));
end
%
% Automatically determine color-axis if not assigned
if isempty(settings.caxis)
if islogical(obj)
settings.caxis = [0,1];
else
settings.caxis = [min(real(obj(:))), max(real(obj(:)))];
sliceValues = [slices{1}(:); slices{2}(:); slices{3}(:)];
settings.caxis = [min(sliceValues), max(sliceValues)];
end
end
if isempty(settings.sliceIndices)
settings.sliceIndices = ceil(size(obj)/2);
end
% Plot 2D-slices along the three different coordinate planes
for sliceDim = 3:-1:1
s = subplot('position', [0.02+(sliceDim-1)*0.32, 0.04, 0.29, 0.9]);
imagesc(squeeze(getSlice(real(obj), settings.sliceIndices(sliceDim), sliceDim)));
imagesc(slices{sliceDim});
caxis(settings.caxis);
colormap(settings.cmap);
axis 'equal' 'tight';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment