diff --git a/flybrains/core.py b/flybrains/core.py index 385fc97..e2712a4 100644 --- a/flybrains/core.py +++ b/flybrains/core.py @@ -392,6 +392,28 @@ def register_transforms(): target='FANCnm', transform_type='bridging') + # Add a male CNS <-> FAFB transform + fp = os.path.join(data_filepath, 'maleCNS_brain_FAFB_landmarks_nm.csv') + lm = pd.read_csv(fp) + tr = transforms.TPStransform(lm[['fafb_x', 'fafb_y', 'fafb_z']].values, + lm[['cns_x', 'cns_y', 'cns_z']].values) + transforms.registry.register_transform(transform=tr, + source='FAFB14', + target='JRCFIB2022M', + transform_type='bridging') + tr = transforms.AliasTransform() + transforms.registry.register_transform(transform=tr, + source='JRCFIB2022M', + target='JRCFIB2022Mnm', + transform_type='bridging') + + # Add transform between voxel and nm space + tr = transforms.AffineTransform(np.diag([8, 8, 8, 1])) + transforms.registry.register_transform(transform=tr, + source='JRCFIB2022Mraw', + target='JRCFIB2022M', + transform_type='bridging') + # Add FANC mirror transform based on subsampling a FANC -> MANCsym transform fp = os.path.join(data_filepath, 'FANC_mirror_landmarks.csv') lm = pd.read_csv(fp) diff --git a/flybrains/data/README.md b/flybrains/data/README.md index 39e16e2..2568809 100644 --- a/flybrains/data/README.md +++ b/flybrains/data/README.md @@ -58,6 +58,13 @@ male adult nerve cord (MANC) and female adult nerve cord (FANC) VNC data sets. These landmarks were manually placed at cross-identifiable locations in both datasets. +## `maleCNS_brain_FAFB_landmarks_um.csv` +This file contains landmarks to transform between the brain portion of the +Janelia full male CNS and the FAFB datasets. + +These landmarks were manually placed using the Big Warp on the images created +from synapse clouds. + # Transforms ## `TransformParameters.FixedFANC.txt` & TransformParameters.FixedTemplate.txt diff --git a/flybrains/data/maleCNS_brain_FAFB_landmarks_nm.csv b/flybrains/data/maleCNS_brain_FAFB_landmarks_nm.csv new file mode 100644 index 0000000..56a0678 --- /dev/null +++ b/flybrains/data/maleCNS_brain_FAFB_landmarks_nm.csv @@ -0,0 +1,70 @@ +,fafb_x,fafb_y,fafb_z,cns_x,cns_y,cns_z +0,522329,183049,95207,388026,161159,167533 +1,454391,88801,95359,316430,61913,170284 +2,597492,98038,83202,448916,60418,171139 +3,520008,210975,125015,386935,193888,208371 +4,414541,169814,155265,274930,152795,222699 +5,645532,176758,134322,501849,141522,219899 +6,524189,343058,129754,390374,358625,202136 +7,527478,343058,164366,391470,346564,250637 +8,433912,304681,164622,300097,308187,240842 +9,622141,309798,150989,482113,296857,235944 +10,580109,264476,150733,435695,246053,240622 +11,471192,256436,153474,345784,253363,241134 +12,402081,199131,89578,264353,182932,151045 +13,641845,213019,59242,515372,176609,140441 +14,587752,290138,62130,454442,261756,139151 +15,460560,279174,76420,330067,276755,143621 +16,510633,223619,82305,370272,205483,151954 +17,548279,230563,68087,411207,200001,151369 +18,742267,193022,218409,613704,156201,309726 +19,317205,191683,251306,170238,167008,319930 +20,370865,321156,190040,238191,335991,270355 +21,686426,350570,176597,540117,336062,288892 +22,493283,217407,29135,351336,200430,107763 +23,467762,236328,26538,335051,226704,100604 +24,562985,183709,93767,424379,159948,169974 +25,484582,178909,102087,350456,161269,170502 +26,659068,252752,139167,517314,233231,231104 +27,391889,245008,157899,257423,232268,230181 +28,392373,158852,104124,245230,144815,158189 +29,661928,173900,68394,535159,136103,157802 +30,682504,237242,91421,551394,202480,180216 +31,362170,227121,125787,227126,211720,187145 +32,276261,150971,214870,145390,118634,266812 +33,770671,161627,170025,630291,107194,266812 +34,732191,346868,206023,581449,350964,303510 +35,845190,277803,209271,723165,260378,294788 +36,266984,308774,262709,120778,336502,334874 +37,699473,150054,159934,549683,107246,243727 +38,677974,149896,82227,535602,100206,171080 +39,637337,155401,45932,508321,126607,131346 +40,662619,251891,44177,532962,207130,136274 +41,383399,232165,77052,251119,219890,140485 +42,419929,92468,163797,279280,51803,235661 +43,726375,183387,194529,585219,141878,283603 +44,298769,162288,224807,157845,138117,286167 +45,299516,372896,212310,168102,411209,293433 +46,433202,221557,40881,289476,211369,114363 +47,516617,231926,52162,370677,210472,129321 +48,444852,195253,44243,306571,178248,117355 +49,474205,337062,71571,352727,339410,143852 +50,564274,344863,56718,421535,338086,157100 +51,522742,354271,125930,392046,362916,199838 +52,555476,285496,79250,417261,265987,156246 +53,622562,265970,52918,488205,228891,131031 +54,668613,289834,79328,535644,261756,166930 +55,596927,324671,76043,464272,310392,167357 +56,350350,244326,149923,212976,232268,222061 +57,343448,338601,227556,205283,361933,312665 +58,504969,144276,161661,362557,126364,236165 +59,559057,149457,156551,410423,122304,237874 +60,531155,171133,164516,387345,146109,251123 +61,544699,129111,63252,405324,103572,133483 +62,500821,126569,66751,365481,105716,127501 +63,618856,228596,23059,474349,190599,99596 +64,561174,272361,22491,424774,237054,102588 +65,545274,234874,37355,417226,203831,123956 +66,608330,211789,30053,463574,168778,106861 +67,617084,220714,71798,487042,174379,142684 +68,607961,176996,51981,470064,151746,124165 diff --git a/flybrains/data/template_meta.json b/flybrains/data/template_meta.json index 944b117..b519eaf 100644 --- a/flybrains/data/template_meta.json +++ b/flybrains/data/template_meta.json @@ -573,6 +573,34 @@ "description": "Uncalibrated version of Janelia FIB hemibrain dataset", "doi": "https://doi.org/10.1101/2020.01.21.911859" }, + { + "name": "JRCFIB2022M", + "label": "JRCFIB2022M", + "type": null, + "sex": "M", + "dims": [ + 94088, + 71047, + 60858 + ], + "voxdims": [ + 8, + 8, + 8 + ], + "origin": null, + "boundingbox": [ + 0, + 752704, + 0, + 568376, + 0, + 484680 + ], + "units": "nanometers", + "description": "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/meshes/JRCFIB2022M.ply b/flybrains/meshes/JRCFIB2022M.ply new file mode 100644 index 0000000..39f52a1 Binary files /dev/null and b/flybrains/meshes/JRCFIB2022M.ply differ diff --git a/flybrains/templates.py b/flybrains/templates.py index f2becc6..b0b0473 100644 --- a/flybrains/templates.py +++ b/flybrains/templates.py @@ -28,6 +28,7 @@ __all__ = ['FCWB', 'IBN', 'IBNWB', 'IS2', 'JFRC2', 'T1', 'Dmel', 'DsecI', 'Dsim', 'Dvir', 'JFRC2013', 'JFRC2013DS', 'JRC2018F', 'JRC2018U', 'JRCFIB2018F', 'JRCFIB2018Fraw', 'JRCFIB2018Fum', 'JRCVNC2018F', + 'JRCFIB2022M', 'JRCVNC2018M', 'JRCVNC2018U', 'VNCIS1', @@ -66,14 +67,19 @@ def __repr__(self): return self.__str__() def __str__(self): + units = getattr(self, 'units', 'units NA') + + if isinstance(units, list): + units = units[0] + if getattr(self, 'boundingbox'): bbox = f"""\ - Bounding box ({self.units[0] if getattr(self, 'units') else 'NA'}): + Bounding box ({units}): x = {self.boundingbox[0]}, y = {self.boundingbox[2]}, z = {self.boundingbox[4]}, x = {self.boundingbox[1]}, y = {self.boundingbox[3]}, z = {self.boundingbox[5]},""" else: bbox = f"""\ - Bounding box ({self.units[0] if getattr(self, 'units') else 'units NA'}): + Bounding box ({units}): NA""" if getattr(self, 'dims'): @@ -546,7 +552,7 @@ class _JRC2018U(FlyTemplateBrain): class _JRCFIB2018F(FlyTemplateBrain): - """JRCFIB2018F aka hemibrain dataset. + """JRCFIB2018F aka "hemibrain" dataset. The JRCFIB2018F reference brain is a stitched FIB SEM volume completed at HHMI Janelia Research Campus in 2018. @@ -658,6 +664,23 @@ def bbox(self): JRCFIB2018Fraw = _JRCFIB2018Fraw(**template_meta['JRCFIB2018Fraw']) +class _JRCFIB2022M(FlyTemplateBrain): + """JRCFIB2022M aka "male CNS" dataset. + + The JRCFIB2022M EM volume is a whole male CNS (brain + VNC) currently being + generated by FlyEM at HHMI Janelia Research Campus. At this point, only the + brain portion of the volume is available. + + The mesh was generated from a point cloud of automaticaly detected synaptic + t-bars. + + The JRCFIB2022Mraw reference brain is uncalibrated (i.e. has units of raw + pixels), whereas JRCFIB2022M and JRCFIB2022Mum have units of nanometers + and microns with 8x8x8nm isotropic voxels, respectively. + + """ + +JRCFIB2022M = _JRCFIB2022M(**template_meta['JRCFIB2022M']) class _JRCVNC2018F(FlyTemplateBrain): """JRC2018 reference ventral nerve chords. @@ -963,6 +986,7 @@ def register_templates(): JRCFIB2018Fraw, JRCVNC2018F, JRCVNC2018U, JRCVNC2018M, VNCIS1, FAFB14, FAFB, FLYWIRE, + JRCFIB2022M, FANC, DmelL1CNS_Seymour, COURT2017VNS, COURT2018VNS] for tmp in templates: