Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
ecc617cf
Commit
ecc617cf
authored
Apr 29, 2020
by
Matthijs
Browse files
default colormaps
parent
c7d75528
Changes
1
Show whitespace changes
Inline
Side-by-side
proxtoolbox/Problems/OrbitalTomog/Graphics/stack_viewer.py
View file @
ecc617cf
...
...
@@ -51,7 +51,7 @@ class SingleStackViewer:
class
XYZStackViewer
:
def
__init__
(
self
,
volume
,
limit_sliders
=
(
0
,
0
,
0
),
cmap
:
str
=
'seismic'
,
clim
:
tuple
=
(
None
,
None
),
def
__init__
(
self
,
volume
,
limit_sliders
=
(
0
,
0
,
0
),
cmap
:
str
=
None
,
clim
:
tuple
=
(
None
,
None
),
data_transform
:
callable
=
None
,
name
:
str
=
None
):
"""
Dynamic matplotlib plot showing slices out of a 3d dataset
...
...
@@ -70,14 +70,11 @@ class XYZStackViewer:
if
volume
.
ndim
==
4
and
volume
.
shape
[
-
1
]
in
[
3
,
4
]:
rgb_plot
=
True
show_colorbar
=
False
else
:
# assert volume.ndim == 3, 'Functionality is designed for 3D arrays'
rgb_plot
=
False
if
cmap
is
not
None
:
show_colorbar
=
True
else
:
show_colorbar
=
False
radio_start
=
0
if
data_transform
is
not
None
:
...
...
@@ -87,12 +84,18 @@ class XYZStackViewer:
show_colorbar
=
True
# False
rgb_plot
=
False
# True
radio_start
=
0
# 1
if
cmap
is
None
:
cmap
=
'viridis'
else
:
def
dummy
(
array
):
return
array
self
.
cast_fn
=
dummy
if
cmap
is
None
:
cmap
=
'seismic'
show_colorbar
=
True
self
.
volume
=
volume
self
.
indices
=
[
s
//
2
for
s
in
volume
.
shape
]
self
.
shape
=
self
.
volume
.
shape
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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