Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
irp
HoloTomoToolbox
Commits
4bef7355
Commit
4bef7355
authored
Jul 03, 2019
by
Simon Maretzke
Browse files
Improved auto-determination of color axis
parent
9fa19a53
Changes
1
Hide whitespace changes
Inline
Side-by-side
functions/plotting/showOrthoslices.m
View file @
4bef7355
...
...
@@ -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
(
s
queeze
(
getSlice
(
real
(
obj
),
settings
.
sliceIndices
(
sliceDim
),
sliceDim
))
);
imagesc
(
s
lices
{
sliceDim
}
);
caxis
(
settings
.
caxis
);
colormap
(
settings
.
cmap
);
axis
'equal'
'tight'
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment