Skip to content

Commit fc3bf0e

Browse files
committed
clipped cmin and cmax
1 parent 639bb29 commit fc3bf0e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/visualizing-mri-volume-slices.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ r, c = volume[0].shape
5353
# Visualize data
5454
import plotly.graph_objects as go
5555

56-
nb_frames = 68
56+
nb_frames = 10
5757

5858
# Define frames
5959
fig = go.Figure(frames=[go.Frame(data=go.Surface(
6060
z=(6.7 - k * 0.1) * np.ones((r, c)),
61-
surfacecolor=np.flipud(volume[67 - k])
61+
surfacecolor=np.flipud(volume[67 - k]),
62+
cmin=0, cmax=200
6263
))
6364
for k in range(nb_frames)])
6465

@@ -67,6 +68,7 @@ fig.add_trace(go.Surface(
6768
z=6.7 * np.ones((r, c)),
6869
surfacecolor=np.flipud(volume[67]),
6970
colorscale='Gray',
71+
cmin=0, cmax=200,
7072
colorbar=dict(thickness=20, ticklen=4)
7173
))
7274

@@ -110,6 +112,10 @@ Here's where you can find her:
110112
- Her [Twitter](https://twitter.com/mathinpython) under the handle `@mathinpython`
111113
- Her [GitHub Page](https://github.com/empet) with Username `empet`
112114

115+
```python
116+
from scipy import stats
117+
stats.scoreatpercentile(volume, 99.5)
118+
```
113119

114120
#### Reference
115121
For additional information and help setting up a slider in an animation, see https://plot.ly/python/gapminder-example/. For more documentation on creating animations with Plotly, see https://plot.ly/python/#animations.

0 commit comments

Comments
 (0)