From 9d4cb7ce984535fca4555792a2e5f84f2b6736c9 Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Sat, 29 Jul 2023 06:57:48 +0100 Subject: [PATCH] add JRCFIB2022Mraw template --- flybrains/data/template_meta.json | 31 ++++++++++++++++++++++++++++++- flybrains/templates.py | 20 ++++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/flybrains/data/template_meta.json b/flybrains/data/template_meta.json index 827aa2e..9cf7a5f 100644 --- a/flybrains/data/template_meta.json +++ b/flybrains/data/template_meta.json @@ -651,10 +651,39 @@ 484680 ], "units": "nanometers", - "_navis_units": "8 nanometers", + "_navis_units": "nanometers", "description": "Full male CNS EM volume currenty being generated by FlyEM at HHMI Janelia Research Campus", "doi": "unpublished" }, + { + "name": "JRCFIB2022Mraw", + "label": "JRCFIB2022Mraw", + "type": null, + "sex": "M", + "dims": [ + 94088, + 71047, + 60858 + ], + "voxdims": [ + 8, + 8, + 8 + ], + "origin": null, + "boundingbox": [ + 0, + 752704, + 0, + 568376, + 0, + 484680 + ], + "units": "nanometers", + "_navis_units": "8 nanometers", + "description": "Uncalibrated version of the full male CNS EM volume currenty being generated by FlyEM at HHMI Janelia Research Campus", + "doi": "unpublished" + }, { "name": "JRCVNC2018F", "label": "JRCVNC2018F", diff --git a/flybrains/templates.py b/flybrains/templates.py index d3185c4..5bb7ff1 100644 --- a/flybrains/templates.py +++ b/flybrains/templates.py @@ -30,7 +30,7 @@ 'JFRC2013', 'JFRC2013DS', 'JRC2018F', 'JRC2018U', 'JRC2018M', 'JRCFIB2018F', 'JRCFIB2018Fraw', 'JRCFIB2018Fum', - 'JRCFIB2022M', + 'JRCFIB2022M', 'JRCFIB2022Mraw', 'JRCVNC2018F', 'JRCVNC2018M', 'JRCVNC2018U', @@ -725,6 +725,21 @@ class _JRCFIB2022M(FlyTemplateBrain): JRCFIB2022M = _JRCFIB2022M(**template_meta['JRCFIB2022M']) +class _JRCFIB2022Mraw(_JRCFIB2022M): + @property + def mesh(self): + """On-demand loading of surface mesh.""" + if not hasattr(self, '_mesh'): + # Load the raw mesh (voxels) + fp = os.path.join(mesh_filepath, f'JRCFIB2022M.ply') + self._mesh = tm.load_mesh(fp) + # Convert nanometers to voxels + self._mesh.vertices /= 8 + return self._mesh + +JRCFIB2022Mraw = _JRCFIB2022Mraw(**template_meta['JRCFIB2022Mraw']) + + class _JRCVNC2018F(FlyTemplateBrain): """JRC2018 reference ventral nerve chords. @@ -1029,7 +1044,8 @@ def register_templates(): JRC2018F, JRC2018U, JRC2018M, JRCVNC2018F, JRCVNC2018U, JRCVNC2018M, VNCIS1, FAFB14, FAFB, FLYWIRE, - JRCFIB2022M, JRCFIB2018F, JRCFIB2018Fraw, + JRCFIB2022M,JRCFIB2022Mraw, + JRCFIB2018F, JRCFIB2018Fraw, FANC, DmelL1CNS_Seymour, COURT2017VNS, COURT2018VNS] for tmp in templates: