lavavu 1.8.75__cp311-cp311-win_amd64.whl → 1.8.76__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lavavu/LavaVuPython.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # This file was automatically generated by SWIG (https://www.swig.org).
2
- # Version 4.1.0
2
+ # Version 4.2.0
3
3
  #
4
4
  # Do not make changes to this file unless you know what you are doing - modify
5
5
  # the SWIG interface file instead.
Binary file
lavavu/convert.py CHANGED
@@ -110,10 +110,10 @@ def points_to_volume_histogram(verts, weights, res=8, normed=True, clamp=None, b
110
110
 
111
111
  #H, edges = numpy.histogramdd(verts, bins=RES)
112
112
  if boundingbox is None:
113
- H, edges = numpy.histogramdd(verts, weights=weights, bins=RES, normed=normed) #density=True for newer numpy
113
+ H, edges = numpy.histogramdd(verts, weights=weights, bins=RES, density=normed) #density=True for newer numpy
114
114
  else:
115
115
  rg = ((vmin[0], vmax[0]), (vmin[1], vmax[1]), (vmin[2], vmax[2])) #provide bounding box as range
116
- H, edges = numpy.histogramdd(verts, weights=weights, bins=RES, range=rg, normed=normed) #density=True for newer numpy
116
+ H, edges = numpy.histogramdd(verts, weights=weights, bins=RES, range=rg, density=normed) #density=True for newer numpy
117
117
 
118
118
  #Reverse ordering X,Y,Z to Z,Y,X for volume data
119
119
  values = H.transpose()
lavavu/html/webview.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <input id="fileinput" type="file" style="visibility:hidden" onchange="useFileInput(this)" />
29
29
 
30
- <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.75/LavaVu-amalgamated.min.js"></script>
30
+ <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.76/LavaVu-amalgamated.min.js"></script>
31
31
  <!--script src="dat.gui.min.js"></script>
32
32
  <script src="OK-min.js"></script>
33
33
 
lavavu/lavavu.py CHANGED
@@ -166,6 +166,37 @@ def _convert(data, dtype=None):
166
166
 
167
167
  return data
168
168
 
169
+ def is_documented_by(original):
170
+ def wrapper(target):
171
+ target.__doc__ = original.__doc__
172
+ return target
173
+ return wrapper
174
+
175
+ def _brightness_contrast_saturation(target, brightness=0.5, contrast=0.5, saturation=0.5):
176
+ """
177
+ Set brightness, contrast and saturation in the range [0,1]
178
+ Zero is minimum level
179
+ 0.5 is default, normal setting
180
+ 1 is maximum level
181
+
182
+ Parameters
183
+ ----------
184
+ brightness : float
185
+ Brightness level from 0 to 1, converts to lavavu brightness in range [-1,1]
186
+ 0 is full black, 0.5 is normal and 1.0 is full white
187
+ contrast : float
188
+ Contrast level from 0 to 1, converts to lavavu contrast in range [0,2]
189
+ 0 is grey, 0.5 is normal and 1.0 is maximum contrast
190
+ saturation : float
191
+ Saturation level from 0 to 1, converts to lavavu saturation in range [0,2]
192
+ 0 is greyscale, 0.5 is normal and 1.0 is maximum over-saturation
193
+ """
194
+ #Brightness in shader is [-1,1] where 0 is default
195
+ target["brightness"] = brightness * 2.0 - 1.0
196
+ #Contrast and saturation range from [0,2] where 1 is default
197
+ target["contrast"] = contrast * 2.0
198
+ target["saturation"] = saturation * 2.0
199
+
169
200
  def grid2d(corners=((0.,1.), (1.,0.)), dims=[2,2]):
170
201
  """
171
202
  Generate a 2d grid of vertices
@@ -1102,7 +1133,7 @@ class Object(dict):
1102
1133
 
1103
1134
  self._loadScalar(data, LavaVuPython.lucLuminanceData, width, height, depth)
1104
1135
 
1105
- def texture(self, data=None, flip=True, filter=2, bgr=False):
1136
+ def texture(self, data=None, flip=True, filter=2, bgr=False, label=""):
1106
1137
  """
1107
1138
  Load or clear texture data for object
1108
1139
 
@@ -1116,6 +1147,10 @@ class Object(dict):
1116
1147
  either (height, width, channels) for RGB(A) image
1117
1148
  or (height, width) for single channel grayscale image
1118
1149
  Pass a string to load a texture from given filename
1150
+ label : string
1151
+ Optional label to load a custom texture by name of uniform used
1152
+ If provided, will attempt to find the texture by this label and replace its data
1153
+ If not provided, will use the default/primary texture for the object
1119
1154
  flip : boolean
1120
1155
  flip the texture vertically after loading
1121
1156
  (default is enabled as usually required for OpenGL but can be disabled)
@@ -1129,7 +1164,7 @@ class Object(dict):
1129
1164
  self.parent.app.clearTexture(self.ref)
1130
1165
  return
1131
1166
  if isinstance(data, str):
1132
- self.parent.app.setTexture(self.ref, data, flip, filter, bgr)
1167
+ self.parent.app.setTexture(self.ref, data, flip, filter, bgr, label)
1133
1168
  return
1134
1169
 
1135
1170
  data = _convert(data)
@@ -1145,9 +1180,9 @@ class Object(dict):
1145
1180
  if data.dtype == numpy.float32:
1146
1181
  data = _convert(data, numpy.uint8)
1147
1182
  if data.dtype == numpy.uint32:
1148
- self.parent.app.textureUInt(self.ref, data.ravel(), width, height, channels, flip, filter, bgr)
1183
+ self.parent.app.textureUInt(self.ref, data.ravel(), width, height, channels, flip, filter, bgr, label)
1149
1184
  elif data.dtype == numpy.uint8:
1150
- self.parent.app.textureUChar(self.ref, data.ravel(), width, height, channels, flip, filter, bgr)
1185
+ self.parent.app.textureUChar(self.ref, data.ravel(), width, height, channels, flip, filter, bgr, label)
1151
1186
 
1152
1187
  def labels(self, data):
1153
1188
  """
@@ -1593,6 +1628,10 @@ class Object(dict):
1593
1628
  """
1594
1629
  self.parent.export_mesh(filepath, [self], rgba)
1595
1630
 
1631
+ @is_documented_by(_brightness_contrast_saturation)
1632
+ def brightness_contrast_saturation(self, brightness=0, contrast=0, saturation=0):
1633
+ return _brightness_contrast_saturation(self)
1634
+
1596
1635
  #Wrapper dict+list of objects
1597
1636
  class _Objects(dict):
1598
1637
  """
@@ -1901,7 +1940,7 @@ class ColourMap(dict):
1901
1940
  Convert to greyscale
1902
1941
  """
1903
1942
  if data is not None:
1904
- if isinstance(data, str) and re.match('^[\w_]+$', data) is not None:
1943
+ if isinstance(data, str) and re.match(r'^[\w_]+$', data) is not None:
1905
1944
  #Single word of alphanumeric characters, if not a built-in map, try matplotlib
1906
1945
  if data not in self.parent.defaultcolourmaps():
1907
1946
  newdata = matplotlib_colourmap(data)
@@ -4652,6 +4691,59 @@ class Viewer(dict):
4652
4691
  self.render()
4653
4692
  convert.export_any(filepath, objects)
4654
4693
 
4694
+ @is_documented_by(_brightness_contrast_saturation)
4695
+ def brightness_contrast_saturation(self, brightness=0, contrast=0, saturation=0):
4696
+ return _brightness_contrast_saturation(self, brightness, contrast, saturation)
4697
+
4698
+ def set_properties(self, objects=None, **kwargs):
4699
+ """
4700
+ Set properties on viewer or on a set of objects by name
4701
+
4702
+ Parameters
4703
+ ----------
4704
+ objects : list
4705
+ List of objects or object names, if not provided the properties will be applied globally to the Viewer itself
4706
+ **kwargs :
4707
+ key=value property names and values to set
4708
+ """
4709
+ if objects is None:
4710
+ for key in kwargs:
4711
+ self[key] = kwargs[key]
4712
+ else:
4713
+ for o in objects:
4714
+ if isinstance(o, str):
4715
+ obj = self.objects[o]
4716
+ else:
4717
+ obj = o
4718
+ for key in kwargs:
4719
+ obj[key] = kwargs[key]
4720
+
4721
+ def set_uniforms(self, objects=None, **kwargs):
4722
+ """
4723
+ Set uniform variables on a set of objects by name or all objects
4724
+ Uniforms are parameters sent directly to the shader program and can have any
4725
+ valid GLSL variable name, it just needs to match the declaration in the shader
4726
+
4727
+ Parameters
4728
+ ----------
4729
+ objects : list
4730
+ List of objects or object names, if not provided the full object list will be iterated
4731
+ **kwargs :
4732
+ key=value uniform names and values to set
4733
+ """
4734
+ if objects == None: objects = self.objects.list
4735
+ if not isinstance(objects, list):
4736
+ objects = [objects]
4737
+ for o in objects:
4738
+ if isinstance(o, str):
4739
+ obj = self.objects[o]
4740
+ else:
4741
+ obj = o
4742
+ uniforms = obj['uniforms']
4743
+ for key in kwargs:
4744
+ uniforms[key] = kwargs[key]
4745
+ obj['uniforms'] = uniforms
4746
+
4655
4747
  #Wrapper for list of geomdata objects
4656
4748
  class Geometry(list):
4657
4749
  """
@@ -5278,7 +5370,7 @@ class Video(object):
5278
5370
  def __exit__(self, exc_type, exc_value, exc_traceback):
5279
5371
  self.stop()
5280
5372
  if exc_value == None:
5281
- print('Recording complete, filename: ', self.filename)
5373
+ #print('Recording complete, filename: ', self.filename)
5282
5374
  self.play()
5283
5375
  else:
5284
5376
  print('Recording failed: ', exc_value)
lavavu/vutils.py CHANGED
@@ -81,15 +81,10 @@ def download(url, filename=None, overwrite=False, quiet=False):
81
81
  filename : str
82
82
  Actual filename written to local filesystem
83
83
  """
84
- #Python 3 moved modules
85
- try:
86
- from urllib.request import urlopen, URLError, HTTPError, Request
87
- from urllib.parse import urlparse
88
- from urllib.parse import quote
89
- except ImportError:
90
- from urllib2 import urlopen, URLError, HTTPError, Request
91
- from urllib import quote
92
- from urlparse import urlparse
84
+ from urllib.request import urlopen, URLError, HTTPError, Request
85
+ from urllib.parse import urlparse
86
+ from urllib.parse import quote
87
+ import http.client
93
88
 
94
89
  if filename is None:
95
90
  filename = url[url.rfind("/")+1:]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lavavu
3
- Version: 1.8.75
3
+ Version: 1.8.76
4
4
  Summary: Python interface to LavaVu OpenGL 3D scientific visualisation utilities
5
5
  Author-email: Owen Kaluza <owen@kaluza.id.au>
6
6
  License: ### Licensing
@@ -212,7 +212,7 @@ Classifier: Framework :: IPython
212
212
  Requires-Python: >=3.5
213
213
  Description-Content-Type: text/markdown
214
214
  License-File: LICENSE.md
215
- Requires-Dist: numpy >=1.18
215
+ Requires-Dist: numpy>=1.18
216
216
  Requires-Dist: aiohttp
217
217
  Requires-Dist: jupyter-server-proxy
218
218
 
@@ -221,7 +221,7 @@ Requires-Dist: jupyter-server-proxy
221
221
  [![Build Status](https://github.com/lavavu/LavaVu/workflows/Test/badge.svg)](https://github.com/lavavu/LavaVu/actions?query=workflow:Test)
222
222
  [![Deploy Status](https://github.com/lavavu/LavaVu/workflows/Deploy/badge.svg?branch=1.7.3)](https://github.com/lavavu/LavaVu/actions?query=workflow:Deploy)
223
223
  [![DOI](https://zenodo.org/badge/45163055.svg)](https://zenodo.org/badge/latestdoi/45163055)
224
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.75)
224
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.76)
225
225
 
226
226
  A scientific visualisation tool with a python interface for fast and flexible visual analysis.
227
227
 
@@ -1,5 +1,5 @@
1
- lavavu/LavaVuPython.py,sha256=I27VeH0GoGE2uIZ92UgoysGnQe5peBW_e-YEsA4Y1Q0,33691
2
- lavavu/_LavaVuPython.cp311-win_amd64.pyd,sha256=mvgwUGYPcusho8nK24sR8xB8gCa0rAw_TQcncHxcNP8,3100672
1
+ lavavu/LavaVuPython.py,sha256=fM1Xo8N4RGzWPdCkJy3rvjHECge4Vw5h8QZLCU31ep4,33691
2
+ lavavu/_LavaVuPython.cp311-win_amd64.pyd,sha256=VMDgd803xTP5vQoi4tEeeYfDu-2vPQWyGG2gE8tilLo,3111424
3
3
  lavavu/__init__.py,sha256=ZOkoA9N5M5swxkeLDlrc9NGFQ1PggLWW4GheseTtq8I,206
4
4
  lavavu/__main__.py,sha256=9L7Rfhb_U9Oqkop7MVJ4fi9XUnx4t2vpajOMKNNVunc,247
5
5
  lavavu/amalgamate.py,sha256=goS8OLot2q400zRMMRoksYkaNyBgRJlrpU1UxSKwLmA,601
@@ -10,11 +10,11 @@ lavavu/avfilter-7.dll,sha256=cKwN6yDGzmf6XB5HXM1QVV4fc_HfhjAd3dBvV5YVdbk,1095731
10
10
  lavavu/avformat-58.dll,sha256=PB5bD4mq62vBBY8tdagrGaYD2AQjaz3Lgc6wpp0UIr0,11094016
11
11
  lavavu/avutil-56.dll,sha256=VsAhkveudbox9BBMuLEjnJ6yzoyJDoy2SzgPnMgMug0,866304
12
12
  lavavu/control.py,sha256=QyNNJCeM6MeQhy4lhhb3JGnIUctCKo9JshleVTRUsTI,67547
13
- lavavu/convert.py,sha256=LBMvZrxJDhJYPbeTJEs7PpBs3zXkeIPtbzHs-Wxr8FI,36402
13
+ lavavu/convert.py,sha256=3F79LHdsi74pvewvDuvnlYR_Zsh5mCc1QI7XZnQSMN8,36404
14
14
  lavavu/dict.json,sha256=6WjVWKKKfF5ieZK2AfWldrl4c7BCo8tEgigJR5CpCqQ,55239
15
15
  lavavu/font.bin,sha256=fvi5zkvmq6gh9v3jXedBVuxNJWKmHtbjECzv6eT9wb4,225360
16
16
  lavavu/glfw3.dll,sha256=zI-Qy4RDHQo4mYYgW4QLREz-WZ5l5HCXJzyksyTy0bY,83456
17
- lavavu/lavavu.py,sha256=K6ia3i9_YXrPpzioya8bIjNeKUwBgeIeiisKJwZoN1k,207659
17
+ lavavu/lavavu.py,sha256=U-cz-UJxMYHJA7-xkJwNIQz5iroRe6I4dqA-OeQcK7g,211403
18
18
  lavavu/liblzma.dll,sha256=_n95XbzYpeaXq6wB884fmpf8nqs2Ot9gyxUL_CS2TCI,154624
19
19
  lavavu/points.py,sha256=bp5XFMUHShjeRW7XUNgq8uxj3wjk4EE-qnWEJjAn-uM,6062
20
20
  lavavu/postproc-55.dll,sha256=DwfCHwxbuZiEzRcfbh5aa-5Ax3xIsWkxEN0achBvJPU,133120
@@ -24,7 +24,7 @@ lavavu/swresample-3.dll,sha256=hlz9EYJ8_DjhqGYcevhIDwM_9qSuZFAxK4MgeAetqE4,43366
24
24
  lavavu/swscale-5.dll,sha256=s1IjI1-IaDVYiY3P9TouwS0OQRCG620yF-kLkKMiz70,552960
25
25
  lavavu/tiff.dll,sha256=fz7vpqGN9PbzO-zgiDnOlSicYj8eJBf3lhp-sY_j6uk,646656
26
26
  lavavu/tracers.py,sha256=hE9vgbMjZEXhnL_Z5ihlD8BEVTWU7jMnkrmfDwJLGdM,4381
27
- lavavu/vutils.py,sha256=TUk-sF7A7L5h9MTBshtz6Bq7i4xA-LV6cHPpvL6Xu94,5840
27
+ lavavu/vutils.py,sha256=69Aygnjdz7l8-6PVYHKtOmSNFz9bGSKCv79ZI3MHY6M,5648
28
28
  lavavu/zlib.dll,sha256=4tlDhqlDl2vb-ztXfk8WIhbyfNrMRvtmygwk4s9fRQM,84992
29
29
  lavavu/zstd.dll,sha256=NJIIlGtaKrXDSlaIzizhDVEMxjuccfkSqhgy-DSUN80,491008
30
30
  lavavu/html/LavaVu-amalgamated.css,sha256=oHR0Xcn58ve_InCszKUR_Lw4RTK7DbGk_2FjP2x-UsE,8922
@@ -46,7 +46,7 @@ lavavu/html/server.js,sha256=WXuAnY6aE4h8vYs4U2sl4Xq5RjrkuDi-mIgM-x3Nkj0,7325
46
46
  lavavu/html/stats.min.js,sha256=q9kZjkwmWu8F8HV-4m2EfZRJXQBzyibceJoz-tDgB94,1970
47
47
  lavavu/html/styles.css,sha256=8JE8l7zcc0PV8CfOQpfDyhM226-Sq9eDLXvTCe-wSgw,3041
48
48
  lavavu/html/webview-template.html,sha256=E5w7pd91z0WL3244PQxDKMNZorWzoRT5G7wuBHXJc6Y,1573
49
- lavavu/html/webview.html,sha256=-HGHJ2DY_4xghYa1_eoqthieO67z5dWRW_qohqZGcdY,1565
49
+ lavavu/html/webview.html,sha256=4mKjKToZMhjneCJyVJ57ViSayk_pglb85smcZMp2oLE,1565
50
50
  lavavu/shaders/default.frag,sha256=AlGMo01JdaOsXx6Gq7s1WADi2b-vyX9XMSB91AcJvuA,278
51
51
  lavavu/shaders/default.vert,sha256=SKC2BkE2axNjJL2j5QYjU2bj6mMXs8Wq02XgMTiOeFo,334
52
52
  lavavu/shaders/fontShader.frag,sha256=0GGFFg6S4v0p_1gDTIATDmc19jrCl7xIgH9PpxcXEcE,469
@@ -59,9 +59,9 @@ lavavu/shaders/triShader.frag,sha256=eVGp_ttGMVgKnDYRwByvx_PN80EYiSz61jeuAD8JJvw
59
59
  lavavu/shaders/triShader.vert,sha256=tzgJjqbhKDgVngUJvMVL1ehYvwxAMFLQ-WtKEYU3in0,1175
60
60
  lavavu/shaders/volumeShader.frag,sha256=PLTei6fN_uLxPD35LHbBQVe_S7TanxdBqcW5khslQMI,16583
61
61
  lavavu/shaders/volumeShader.vert,sha256=CroiEfEIe7pP66w14KwmKxfbTuKN6EuXYbZJvt_bfHk,83
62
- lavavu-1.8.75.dist-info/LICENSE.md,sha256=zHOh_qOPkfR76vdrTRP7J-BqPieAIWVDTl2ZP0SN6lQ,8782
63
- lavavu-1.8.75.dist-info/METADATA,sha256=wdxlXttAawb3Kg49-zbIeB6KRjm5sO2pOorCIvE5Ww4,18556
64
- lavavu-1.8.75.dist-info/WHEEL,sha256=WYSXpZsvXNiAggUvUzBeRCxUY27Bzz6nBjGWxD02TN4,101
65
- lavavu-1.8.75.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
66
- lavavu-1.8.75.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
67
- lavavu-1.8.75.dist-info/RECORD,,
62
+ lavavu-1.8.76.dist-info/LICENSE.md,sha256=zHOh_qOPkfR76vdrTRP7J-BqPieAIWVDTl2ZP0SN6lQ,8782
63
+ lavavu-1.8.76.dist-info/METADATA,sha256=auIzfJ0-5C-LJYC06IywxU70e61vm4NOZYRjrne29Fw,18555
64
+ lavavu-1.8.76.dist-info/WHEEL,sha256=yNCBXpt7EYM4XWkQWwdIjv6aROYfg72vYtkZaa0M7Y4,101
65
+ lavavu-1.8.76.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
66
+ lavavu-1.8.76.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
67
+ lavavu-1.8.76.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.3.0)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
5
5