Skip to content

Commit

Permalink
JRCFIB2018F/raw: add mesh for the approximate bounding box
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Feb 24, 2021
1 parent 46c3f85 commit f67f855
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Binary file added flybrains/meshes/JRCFIB2018Fraw_bbox.ply
Binary file not shown.
21 changes: 20 additions & 1 deletion flybrains/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,20 @@ def mesh(self):
fp = os.path.join(mesh_filepath, f'{self.label}raw.ply')
self._mesh = tm.load_mesh(fp)
# Convert voxels to nanometers
self.mesh.vertices *= 8
self._mesh.vertices *= 8
return self._mesh

@property
def bbox(self):
"""On-demand loading of approximate bounding box."""
if not hasattr(self, '_mesh_bbox'):
# Load the raw mesh (voxels)
fp = os.path.join(mesh_filepath, f'{self.label}raw_bbox.ply')
self._mesh_bbox = tm.load_mesh(fp)
# Convert voxels to nanometers
self._mesh_bbox.vertices *= 8
return self._mesh_bbox

JRCFIB2018F = _JRCFIB2018F(**template_meta['JRCFIB2018F'])


Expand Down Expand Up @@ -624,6 +635,14 @@ class _JRCFIB2018Fraw(FlyTemplateBrain):
Jain, Viren; Plaza, Stephen M bioRxiv doi:10.1101/2020.01.21.911859.
"""
@property
def bbox(self):
"""On-demand loading of approximate bounding box."""
if not hasattr(self, '_mesh_bbox'):
# Load the raw mesh (voxels)
fp = os.path.join(mesh_filepath, f'{self.label}_bbox.ply')
self._mesh_bbox = tm.load_mesh(fp)
return self._mesh_bbox

JRCFIB2018Fraw = _JRCFIB2018Fraw(**template_meta['JRCFIB2018Fraw'])

Expand Down

0 comments on commit f67f855

Please sign in to comment.