From 3d5533231e97c625d0b26f6c805a64feac370e97 Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Fri, 9 Apr 2021 12:39:44 -0700 Subject: [PATCH 1/7] fixing skeleton coloring --- meshparty/trimesh_vtk.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/meshparty/trimesh_vtk.py b/meshparty/trimesh_vtk.py index 83e5152..b79bc32 100644 --- a/meshparty/trimesh_vtk.py +++ b/meshparty/trimesh_vtk.py @@ -276,22 +276,18 @@ def render_actors(actors, camera=None, do_save=False, filename=None, if VIDEO_WIDTH is not None: logging.warning('VIDEO_WIDTH is deprecated, please use VIDEO_WIDTH') video_width=VIDEO_WIDTH - print('setting up renderer') # create a rendering window and renderer ren, renWin, iren = _setup_renderer( video_width, video_height, back_color, camera=camera) - print('done setting up') for a in actors: # assign actor to the renderer ren.AddActor(a) - print('actors added') # render if camera is None: ren.ResetCamera() else: ren.ResetCameraClippingRange() camera.ViewingRaysModified() - print('camera set') if return_keyframes: key_frame_cameras = [] @@ -304,7 +300,6 @@ def vtkKeyPress(obj, event): return iren.AddObserver("KeyPressEvent", vtkKeyPress) renWin.Render() - print('render done') if do_save is False: trackCamera = vtk.vtkInteractorStyleTrackballCamera() iren.SetInteractorStyle(trackCamera) @@ -324,7 +319,6 @@ def vtkKeyPress(obj, event): writer.SetFileName(filename) writer.SetInputData(w2if.GetOutput()) writer.Write() - print('finalizing..') renWin.Finalize() if return_keyframes: @@ -609,15 +603,17 @@ def skeleton_actor(sk, data = vertex_data if data is not None: - if normalize_property: - data = data / np.nanmax(data) - sk_mesh.GetPointData().SetScalars(numpy_to_vtk(data)) - lut = vtk.vtkLookupTable() - if lut_map is not None: - lut_map(lut) - lut.Build() + colors, map_colors = process_colors(data, sk.vertices) + vtk_colors = numpy_to_vtk(colors) + vtk_colors.SetName('colors') + sk_mesh.GetPointData().SetScalars(vtk_colors) + if map_colors: + lut = vtk.vtkLookupTable() + if lut_map is not None: + lut_map(lut) + lut.Build() + mapper.SetLookupTable(lut) mapper.ScalarVisibilityOn() - mapper.SetLookupTable(lut) actor = vtk.vtkActor() actor.SetMapper(mapper) From 57fb84c5da42c6f7ddbb91c39f7dfa8d26c1649d Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Wed, 14 Jun 2023 07:04:36 -0700 Subject: [PATCH 2/7] do not pass remove duplicate vertices for multilevelprecomputed --- meshparty/trimesh_io.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/meshparty/trimesh_io.py b/meshparty/trimesh_io.py index 58ec9e7..b0a6881 100644 --- a/meshparty/trimesh_io.py +++ b/meshparty/trimesh_io.py @@ -361,13 +361,15 @@ def _download_meshes_thread_precomputed(args): while len(download_segids): download_now = download_segids[:100] - download_segids = download_segids[len(download_now):] - - cv_meshes = cv.mesh.get( - download_now, - remove_duplicate_vertices=remove_duplicate_vertices, - fuse=False - ) + download_segids = download_segids[len(download_now):] + if isinstance(cv.mesh, ShardedMultiLevelPrecomputedMeshSource): + cv_meshes = cv.mesh.get(download_now, fuse=False) + else: + cv_meshes = cv.mesh.get( + download_now, + remove_duplicate_vertices=remove_duplicate_vertices, + fuse=False + ) for segid, cv_mesh in cv_meshes.items(): mesh = Mesh( From d24dc21865af0a80c6b20054b500417c6358b75e Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Wed, 14 Jun 2023 07:04:47 -0700 Subject: [PATCH 3/7] =?UTF-8?q?Bump=20version:=201.16.11=20=E2=86=92=201.1?= =?UTF-8?q?6.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- meshparty/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 632fe1f..035fb4a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.16.11 +current_version = 1.16.12 commit = True tag = True diff --git a/meshparty/__init__.py b/meshparty/__init__.py index ead4da8..0e18a92 100644 --- a/meshparty/__init__.py +++ b/meshparty/__init__.py @@ -1 +1 @@ -__version__ = "1.16.11" \ No newline at end of file +__version__ = "1.16.12" \ No newline at end of file From 7703d7b718a88ff74ee267268cd30ea84a49bb7f Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Wed, 14 Jun 2023 09:50:34 -0700 Subject: [PATCH 4/7] remove fuse from precomputed multi-resolution --- meshparty/trimesh_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshparty/trimesh_io.py b/meshparty/trimesh_io.py index b0a6881..40ba863 100644 --- a/meshparty/trimesh_io.py +++ b/meshparty/trimesh_io.py @@ -363,7 +363,7 @@ def _download_meshes_thread_precomputed(args): download_now = download_segids[:100] download_segids = download_segids[len(download_now):] if isinstance(cv.mesh, ShardedMultiLevelPrecomputedMeshSource): - cv_meshes = cv.mesh.get(download_now, fuse=False) + cv_meshes = cv.mesh.get(download_now) else: cv_meshes = cv.mesh.get( download_now, From 764d53ca905883c76889d367d125135c54b48e80 Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Wed, 14 Jun 2023 09:50:45 -0700 Subject: [PATCH 5/7] =?UTF-8?q?Bump=20version:=201.16.12=20=E2=86=92=201.1?= =?UTF-8?q?6.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- meshparty/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 035fb4a..c3ada35 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.16.12 +current_version = 1.16.13 commit = True tag = True diff --git a/meshparty/__init__.py b/meshparty/__init__.py index 0e18a92..6c26a2f 100644 --- a/meshparty/__init__.py +++ b/meshparty/__init__.py @@ -1 +1 @@ -__version__ = "1.16.12" \ No newline at end of file +__version__ = "1.16.13" \ No newline at end of file From 04fb08c069b0fa4a771035d400ec60e0c6dde02f Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Fri, 23 Jun 2023 06:11:50 -0700 Subject: [PATCH 6/7] fix documentation typo --- docs/guide/skeletons.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/skeletons.rst b/docs/guide/skeletons.rst index 76a6a9d..df94041 100644 --- a/docs/guide/skeletons.rst +++ b/docs/guide/skeletons.rst @@ -15,7 +15,7 @@ Again assuming you have a mesh object loaded, the key function is :func:`meshpar :: - from trimesh_io import skeletonize + from meshparty.trimesh_io import skeletonize # skeletonize the mesh using a 12 um invalidation radius # assuming units of mesh.vertices is in nm From f9e8ef10bab204a716c24138accfcadfbf837789 Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Fri, 23 Jun 2023 08:53:33 -0700 Subject: [PATCH 7/7] fix doc typo again --- docs/guide/skeletons.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/skeletons.rst b/docs/guide/skeletons.rst index df94041..32b5a30 100644 --- a/docs/guide/skeletons.rst +++ b/docs/guide/skeletons.rst @@ -15,7 +15,7 @@ Again assuming you have a mesh object loaded, the key function is :func:`meshpar :: - from meshparty.trimesh_io import skeletonize + from meshparty import skeletonize # skeletonize the mesh using a 12 um invalidation radius # assuming units of mesh.vertices is in nm