Skip to content

Commit

Permalink
update example to fix threshold() call
Browse files Browse the repository at this point in the history
heads up: in the current example, I expected the plot for
`threshold(lower='2.5%', upper='97.5%')`
to reproduce the original plot from
`threshold(threshold='95%')`
but the call that reproduces the original plot is the wrong-looking
`threshold(upper='95%')`

I also changed a variable name mask_b to prevent overwriting of examples main mask

Former-commit-id: 3bf9c3e
  • Loading branch information
enfascination authored Apr 27, 2018
1 parent 3d284fa commit 0d658eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/01_DataOperations/plot_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@
import numpy as np

high = data[np.where(data.X['PainLevel']==3)[0]]
high.mean().threshold(threshold='95%').plot()
high.mean().threshold(lower='2.5%', upper='97.5%').plot()

#########################################################################
# We might be interested in creating a binary mask from this threshold.

mask = high.mean().threshold(threshold='95%',binarize=True)
mask.plot()
mask_b = high.mean().threshold(lower='2.5%', upper='97.5%',binarize=True)
mask_b.plot()

#########################################################################
# We might also want to create separate images from each contiguous ROI.

region = high.mean().threshold(threshold='95%').regions()
region = high.mean().threshold(lower='2.5%', upper='97.5%').regions()
region.plot()

0 comments on commit 0d658eb

Please sign in to comment.