summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2021-09-07 14:39:36 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2021-09-07 14:39:36 +0200
commitd3194b1a9c4404ba93afac43d97172ab24c57098 (patch)
treea1604130e1401dc1cbd084518ed72869dc92b86f /examples
parentb3bea947efa55d2c0f198b6c6795b3177be27f45 (diff)
New upstream version 0.15.2+dfsg
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/imageview.py5
-rw-r--r--examples/stackView.py10
2 files changed, 12 insertions, 3 deletions
diff --git a/examples/imageview.py b/examples/imageview.py
index 5c7eddb..81741b1 100755
--- a/examples/imageview.py
+++ b/examples/imageview.py
@@ -88,7 +88,10 @@ def main(argv=None):
if not args.filename:
logger.warning('No image file provided, displaying dummy data')
edfFile = None
- data = numpy.arange(1024 * 1024.).reshape(1024, 1024)
+ size = 512
+ xx, yy = numpy.ogrid[-size:size, -size:size]
+ data = numpy.cos(xx / (size//5)) + numpy.cos(yy / (size//5))
+ data = numpy.random.poisson(numpy.abs(data))
nbFrames = 1
else:
diff --git a/examples/stackView.py b/examples/stackView.py
index 4737251..a4b6e8c 100644
--- a/examples/stackView.py
+++ b/examples/stackView.py
@@ -2,7 +2,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016-2018 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2021 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -47,12 +47,18 @@ dim2_calib = (-5., 15. / 120.)
# sv = StackView()
sv = StackViewMainWindow()
-sv.setColormap("jet", autoscale=True)
sv.setStack(mystack,
calibrations=[dim0_calib, dim1_calib, dim2_calib])
sv.setLabels(["dim0: -10 to 10 (200 samples)",
"dim1: -10 to 5 (150 samples)",
"dim2: -5 to 10 (120 samples)"])
+sv.setColormap("jet")
+sv.scaleColormapRangeToStack()
+
+# Enable use of mask in other tools: colormap autoscale, histogram, profile
+maskToolsWidget = sv.getPlotWidget().getMaskToolsDockWidget().widget()
+maskToolsWidget.setItemMaskUpdated(True)
+
sv.show()
app.exec_()