Skip to content

Commit 18b7f46

Browse files
committed
janelia: accept FemaleVNCSymmetric2017_20x VNC stacks (Court2018 -> JRCVNC2018U via VFB's CMTK warp, 0.4612588/0.7 um voxels)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P9Bfk6vb4qtaVZwyDzzL22
1 parent 8fad8e0 commit 18b7f46

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎janelia/load.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,19 @@
3636
('vnc', 'unisex'): 'JRCVNC2018U', ('vnc', 'female'): 'JRCVNC2018F', ('vnc', 'male'): 'JRCVNC2018M'}
3737

3838

39-
# Older Janelia 'primary' alignment: JFRC2010 brain (1024x512x218). The stack is on the JFRC2 pixel grid, whose
39+
# Older Janelia 'primary' alignments: FemaleVNCSymmetric2017 = Court2018 VNS (512x1024x220, 0.4612588 x 0.4612588 x 0.7 um; JACS says 0.52/0.52/1.0, which is wrong for the registration), bridged to JRCVNC2018U by VFB's
40+
# DrosAdultVNSdomains CMTK warp. JFRC2010 brain (1024x512x218). The stack is on the JFRC2 pixel grid, whose
4041
# calibration is 0.622088 um isotropic (flybrains' JFRC2); the H5J's own voxel_size says a rounded 0.62.
4142
OLD_BRAIN_SPACE = re.compile(r'^JFRC2010_20x$')
42-
SOURCE_VOXEL = {'JFRC2': [0.622088, 0.622088, 0.622088]}
43+
OLD_VNC_SPACE = re.compile(r'^FemaleVNCSymmetric2017_20x$') # Court2018 / 20x_flyVNCtemplate_Female_symmetric
44+
SOURCE_VOXEL = {'JFRC2': [0.622088, 0.622088, 0.622088], 'COURT2018': [0.4612588, 0.4612588, 0.7]}
4345

4446

4547
def templates_for(space):
4648
if OLD_BRAIN_SPACE.match(space or ''):
4749
return 'JFRC2', 'JRC2018U'
50+
if OLD_VNC_SPACE.match(space or ''):
51+
return 'COURT2018', 'JRCVNC2018U'
4852
m = SPACE_RE.match(space or '')
4953
if not m:
5054
return None

‎tests/test_janelia_load.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ def test_spaces():
66
assert templates_for('JRC2018_VNC_MALE_40x_DS') == ('JRCVNC2018M', 'JRCVNC2018U')
77
assert templates_for('JRC2018_Unisex_20x_HR') == ('JRC2018U', 'JRC2018U')
88
assert templates_for('JFRC2010_20x') == ('JFRC2', 'JRC2018U')
9-
for bad in ('JFRC2010_63x', 'JFRC2010', 'FemaleVNCSymmetric2017_20x', 'primary', '', None):
9+
assert templates_for('FemaleVNCSymmetric2017_20x') == ('COURT2018', 'JRCVNC2018U')
10+
for bad in ('JFRC2010_63x', 'JFRC2010', 'FemaleVNCSymmetric2017_63x', 'primary', '', None):
1011
assert templates_for(bad) is None
1112

1213

@@ -24,7 +25,7 @@ def test_patched_info_uses_plan_templates():
2425
import types
2526
import numpy as np
2627
from janelia.load import patch_h5j_info
27-
infos = {'a': 'JFRC2010_20x', 'b': 'JRC2018_FEMALE_20x_HR', 'c': 'FemaleVNCSymmetric2017_20x'}
28+
infos = {'a': 'JFRC2010_20x', 'b': 'JRC2018_FEMALE_20x_HR', 'c': 'primary', 'd': 'FemaleVNCSymmetric2017_20x'}
2829
fake = types.SimpleNamespace(read_h5j_info=lambda path: {
2930
'alignment_space': infos[path], 'voxel_size': np.array([0.62, 0.62, 0.62]),
3031
'source_template': 'JRC2018U', 'target_template': 'JRC2018U'})
@@ -39,3 +40,6 @@ def test_patched_info_uses_plan_templates():
3940
assert False
4041
except ValueError:
4142
pass
43+
d = fake.read_h5j_info('d')
44+
assert (d['source_template'], d['target_template']) == ('COURT2018', 'JRCVNC2018U')
45+
assert list(d['voxel_size']) == [0.4612588, 0.4612588, 0.7]

0 commit comments

Comments
 (0)