Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
307 commits
Select commit Hold shift + click to select a range
e47512f
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Nov 15, 2024
d5808b8
Merge remote-tracking branch 'refs/remotes/origin/multisem'
templiert Nov 15, 2024
98694ae
fix(msem_to_render): missing underscore in tile id; user only provide…
templiert Nov 15, 2024
2d607be
fix(ingestion,assembly): encapsulate tkagg for headless upstream appl…
templiert Nov 15, 2024
7aec72f
format(ingestion): ruff (restricted to code from templiert)
templiert Nov 15, 2024
e5592f3
feat(msem_to_render,assembly): convenience get effective scans; strea…
templiert Nov 15, 2024
845f12c
feat(msem_to_render,assembly): use ingestion helper instead of assumi…
templiert Nov 15, 2024
f3f851e
refactor(msem_to_render): remove unused imports
templiert Nov 15, 2024
4a40766
docs(assembly): mixup
templiert Nov 15, 2024
03e0f34
improve log file names
trautmane Nov 15, 2024
5e41905
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Nov 15, 2024
49a636b
refactor(msem_to_render): use convenience slab_info.mfovs
templiert Nov 15, 2024
d8cf982
refactor(msem_to_render): streamline tilespecs creation in a single l…
templiert Nov 15, 2024
5ebd7ea
fix(msem_to_render): sfov_index_name is 0-padded string (bug introduc…
templiert Nov 15, 2024
1b86e27
fix(msem_to_render): missing comma
templiert Nov 15, 2024
1ee0a94
add shading run script
trautmane Nov 16, 2024
735d6cc
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Nov 16, 2024
6de19ce
add render export script for wafers 60/61
trautmane Nov 16, 2024
668ecb6
add 2d intensity correction pipeline parameters for wafers 60/61
trautmane Nov 17, 2024
a1556ae
add check for slabs without any regions
trautmane Nov 18, 2024
f10187f
print empty regions and regional slab stats (remove logging)
trautmane Nov 18, 2024
700fe65
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Nov 18, 2024
06aa363
refactor(slab_info): use SlabInfo.mfovs convenience
templiert Nov 18, 2024
7003326
refactor(slab_info): shorter lines; region-void slabs also at the end
templiert Nov 18, 2024
3abe498
refactor(roi,ingestion): rename get_slabs->get_effective_slabs
templiert Nov 18, 2024
5379922
docs(roi): docstring effective slab
templiert Nov 18, 2024
cff6304
add 13_spark_normalize_layer_intensity.sh
trautmane Nov 20, 2024
4c4fe87
add script to generate clahe export with hack fixed maxHeight of 51, …
trautmane Nov 20, 2024
6444bf9
rename montageBorderRun as montageMfovRun, use new excludeSameMfovNei…
trautmane Dec 6, 2024
cecd121
fix typo
trautmane Dec 6, 2024
a9021e8
make excludePairsInMatchCollection value consistent for all runs
trautmane Dec 6, 2024
89fb684
improve match derivation parameters for wafer 60
trautmane Dec 11, 2024
24f12b1
fix SOURCE_PATH
trautmane Dec 13, 2024
7e638ae
Added poetry dependencies for @minnerbe 's new multi-SEM intensity co…
trautmane Feb 6, 2025
ae94f12
Add pre-existing scripts
minnerbe Feb 12, 2025
c2b646f
Fix import paths
minnerbe Feb 12, 2025
f93678f
Use existing logging
minnerbe Feb 12, 2025
bd50755
Add cmd line arguments
minnerbe Feb 12, 2025
83331e6
Pipe through command line args
minnerbe Feb 12, 2025
cb63943
Move all gc upload-related scripts to own subfolder
minnerbe Feb 12, 2025
ddc77f1
Slightly improve memory management
minnerbe Feb 12, 2025
4aa9025
Add num-threads argument
minnerbe Feb 12, 2025
6ab567e
add fibsem and reiser labs to z_corr link script
trautmane Feb 12, 2025
91ee612
Arrange computation by slab
minnerbe Feb 12, 2025
5d8087d
Remove garbage collection as it doesn't seem necessary
minnerbe Feb 12, 2025
37e9d6e
Cache gc writer
minnerbe Feb 12, 2025
7df68ca
sync link_z_corr.sh with main branch
trautmane Feb 12, 2025
f4c9240
Add cli arguments for gc location
minnerbe Feb 13, 2025
1a89cb6
Merge pull request #19 from templiert/multisem
trautmane Feb 18, 2025
e9fff59
restore use of 1-based SFOV id component in tile ids
trautmane Feb 18, 2025
0cb250b
restore use of 1-based SFOV id component in tile ids
trautmane Feb 18, 2025
22cb217
add top-to-bottom, left-to-right ordering to SFOV tile ids
trautmane Feb 19, 2025
15f8e1e
change wafer_short_prefix parameter to wafer_number
trautmane Feb 19, 2025
60752cb
add comments with SFOV numbers
trautmane Feb 19, 2025
0194767
add wafer 60 google cluster0 pipeline json
trautmane Feb 19, 2025
41e505a
add first batch of google cloud scripts
trautmane Feb 19, 2025
c69aac1
add first batch of google cloud scripts
trautmane Feb 19, 2025
ff92c99
Merge pull request #35 from JaneliaSciComp/feature/multisem-upload
trautmane Feb 19, 2025
72f1903
change wafer_short_prefix parameter to wafer_number
trautmane Feb 19, 2025
35b54d3
change nearline-msem.int.janelia.org to just nearline (instead of nrs…
trautmane Feb 19, 2025
0ad5669
for wafers 60 and 61, we decided to hardcode the scan fit parameters …
trautmane Feb 19, 2025
796781b
make wafer_number a required parameter for all volumes
trautmane Feb 19, 2025
8a680b2
fix tile trimmer roi names to match new tile id pattern
trautmane Feb 19, 2025
9da9538
Put all library files into a separate folder
minnerbe Feb 19, 2025
21b2f86
Rename client.py -> render_client.py
minnerbe Feb 19, 2025
abceb1a
Reorganize code to separate library function from caller
minnerbe Feb 19, 2025
26e73e6
Add host and owner arguments to cli parameters
minnerbe Feb 19, 2025
911db69
Make parameter handling more homogeneous and transparent
minnerbe Feb 19, 2025
c342239
Add first attempt at pulling out details of the render db layout
minnerbe Feb 19, 2025
190ce24
Pull more costumizations into RenderDetails
minnerbe Feb 19, 2025
de72a45
Rename wafer_60_gc_upload
minnerbe Feb 19, 2025
7d129cd
Fix wrong union type annotations
minnerbe Feb 19, 2025
898a9b9
Use existing render client for requests
minnerbe Feb 19, 2025
4c0aef2
fix(msem_to_render): wafer_number is a str; rename to wafer_id
templiert Feb 19, 2025
03377e3
fix(msem_to_render): no more negative value check for str wafer_id
templiert Feb 19, 2025
72d705b
Add upload to render database
minnerbe Feb 19, 2025
cc1f402
Fix problems with Google Cloud Storage path
minnerbe Feb 19, 2025
9faed21
refactor(msem): convenience class TileID to cleanly document indexing…
templiert Feb 20, 2025
96d6706
feat(msem): len(slab_info) = number of MFOVs
templiert Feb 20, 2025
3c1e90a
refactor(msem): use convenience slab_info.mfovs
templiert Feb 20, 2025
2ae006e
refactor(msem): minor (no else after raise/continue)
templiert Feb 20, 2025
e23c0c7
Merge pull request #37 from templiert/multisem
trautmane Feb 20, 2025
295307f
change wafer_number to wafer_id in job scripts
trautmane Feb 20, 2025
93ac27b
update RENDER_OWNER for wafer 60/61 scripts
trautmane Feb 20, 2025
af9635d
update pipeline json files for w60_serial_360_to_369 data stored in G…
trautmane Feb 20, 2025
64497b3
On 2/20/2025 in slack, Thomas said that the wafer 60 excluded scans s…
trautmane Feb 20, 2025
fa66a63
add create_compute_instance_vm script for Google Cloud
trautmane Feb 20, 2025
d660eb7
Check bounds and invert images if desired
minnerbe Feb 20, 2025
098736d
fix comment
trautmane Feb 20, 2025
b368945
Complete stacks before finishing upload
minnerbe Feb 20, 2025
d22f395
Fix broadcast problem in bounds check
minnerbe Feb 20, 2025
1e7382a
move Janelia mongodb dump script from render repo to here
trautmane Feb 20, 2025
61955eb
update examples
trautmane Feb 20, 2025
792998e
add 06_copy_janelia_db_dump_to_google script
trautmane Feb 20, 2025
b194980
place mongodb dumps in google or janelia parent directory
trautmane Feb 20, 2025
e5a318a
place mongodb dumps in google or janelia parent directory
trautmane Feb 20, 2025
b076fb5
fix bug in ordering of tile_id constructor parameters and add test to…
trautmane Feb 21, 2025
509dc70
reduce maxPairsPerStackBatch for the wafer 60 match pipeline
trautmane Feb 21, 2025
517a025
fix multiProject stackPattern - need to see if it needs to be include…
trautmane Feb 22, 2025
897cdf2
add pipe.01.360.patch.json
trautmane Feb 23, 2025
4949229
Restart workers after one stack
minnerbe Feb 24, 2025
8bfe6cc
update commented out delete_match_pairs parameters with w60_s360_r00_…
trautmane Feb 24, 2025
5258144
consistently set numberOfMFOVsPerBatch to 10 for all msem_60_61 match…
trautmane Feb 24, 2025
2b58edc
add trimMfovsWithNoConnectedTiles parameter to pipe.01.360.patch.json
trautmane Feb 27, 2025
ad709d1
add layerShiftList to tilePairDerivationParameters for w60_s360_r00_d…
trautmane Mar 4, 2025
86ab5cf
update 12_spark_render_to_n5.sh to support big and small block sizes
trautmane Mar 12, 2025
4c35ae1
Make client ignore other slabs in render project (and log it)
minnerbe Mar 12, 2025
78126ae
Improve logging more
minnerbe Mar 12, 2025
e6e481a
update 13_spark_normalize_layer_intensity.sh to flip n5 version from …
trautmane Mar 12, 2025
da3037b
Add generous retry policy to GC upload
minnerbe Mar 13, 2025
cbdad6b
Actually use the retry policy
minnerbe Mar 13, 2025
767321d
improve multi-SEM solve parameters per @StephanPreibisch 's slack req…
trautmane Mar 13, 2025
f2e1055
rename restore dump script
trautmane Mar 14, 2025
c4e1b07
add onlyPatchCompletelyUnconnectedTiles option to pipe.01.360.patch.json
trautmane Mar 14, 2025
f154f73
feat(ingestion_ibeammsem): first pass resin mask
templiert Mar 15, 2025
7c24773
Merge pull request #53 from templiert/multisem
trautmane Mar 16, 2025
f29e4d0
feat(msem_tile_trimmer): exclude resin when building filtered_map
templiert Mar 16, 2025
8d900e9
Merge pull request #56 from templiert/multisem
trautmane Mar 16, 2025
339625a
split resin tile removal into separate process so that the counts and…
trautmane Mar 16, 2025
6e0e9f5
fix(msem_tile_trimmer): type hint
templiert Mar 16, 2025
923ff74
feat(msem_tile_trimmer): group tile_ids by MFOV
templiert Mar 16, 2025
03ab7e7
fix(tile_id): order=True enables sorting
templiert Mar 16, 2025
311d09b
Merge pull request #57 from templiert/multisem
trautmane Mar 16, 2025
5bd35f2
log beginning of resin check for each mfov to improve understanding o…
trautmane Mar 16, 2025
2a55d14
only log beginning of resin check process for each scan
trautmane Mar 16, 2025
a4001e5
add --exclude_resin parameter and append xr suffix to trimmed stack n…
trautmane Mar 17, 2025
c920b91
add --exclude_resin parameter to 02_trim_msem_tiles.sh
trautmane Mar 17, 2025
7aac2c4
fix(msem_tile_trimmer): magc instead of serial id
templiert Mar 17, 2025
922e990
Merge pull request #58 from templiert/multisem
trautmane Mar 17, 2025
6a968d0
refactor(msem_tile_trimmer): use itertools.batched
templiert Mar 17, 2025
f3b30e8
feat(metrics): load resin mask for ranges of SCAN/MFOV
templiert Mar 17, 2025
765c47e
perf(msem_tile_trimmer): load resin_mask for all MFOVs in batches of …
templiert Mar 17, 2025
444b21e
fix(msem_tile_trimmer): remove scan duplicates
templiert Mar 17, 2025
bd56658
add trim_b_align_a and trim_b_align_b pipeline json files for multi-S…
trautmane Mar 17, 2025
fb44d66
add trim_b_align_a and trim_b_align_b pipeline json files for multi-S…
trautmane Mar 17, 2025
4706937
add trim_b_align_a and trim_b_align_b pipeline json files for multi-S…
trautmane Mar 17, 2025
6574db9
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Mar 17, 2025
676a5c9
add trim_b_align_a and trim_b_align_b pipeline json files for multi-S…
trautmane Mar 17, 2025
b057fc8
add align_a and align_b pipeline json files for multi-SEM solve tests
trautmane Mar 17, 2025
994eee6
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Mar 17, 2025
ddec594
add pipe.03.360.ic_a.json
trautmane Mar 17, 2025
fb72e32
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Mar 18, 2025
2d4c0e2
add pipe.03.360.ic_b.json
trautmane Mar 18, 2025
5b0640e
set 12_spark_render_to_n5.sh to use 40 nodes
trautmane Mar 18, 2025
f2e212b
change pipe.01.360.patch.json to only use new patchAllUnconnectedPair…
trautmane Mar 18, 2025
6a43dda
add pipe.03.360.ic.json
trautmane Mar 19, 2025
7267563
revert pipe.02.360.align.json to reflect block optimizer parameters u…
trautmane Mar 19, 2025
46995e3
add align_trim_try3 pipeline json file
trautmane Mar 19, 2025
26ce031
add montagePass3 with startPositionMatchWeight 0.000001 to pipe.01.36…
trautmane Mar 20, 2025
7290554
bump render-ws-with-mongodb CONTAINER_IMAGE_VERSION from 0.0.5 to 0.0.6
trautmane Mar 21, 2025
772362a
add number of worker nodes as a parameter to 12_spark_render_to_n5.sh
trautmane Mar 21, 2025
4ba32db
add comment with 20-node run time for n5 export
trautmane Mar 22, 2025
94149b3
Add IMAGEJ_DEFAULT_W_TIMEOUT to google cloud tile specs
minnerbe Mar 25, 2025
7817aad
add google cloud script 11_run_n5_export.sh
trautmane Mar 26, 2025
6d84d6a
first draft of multi-SEM preview run script
trautmane Mar 26, 2025
bf60045
Merge branch 'JaneliaSciComp:multisem' into multisem
templiert Mar 27, 2025
9eebfef
feat(ingestion_ibeammsem): read scan to scan translation
templiert Mar 27, 2025
f68015b
feat(ingestion_ibeammsem): read scan to scan XY scaling factors
templiert Mar 27, 2025
f31992c
feat(ingestion_ibeammsem): histogram of number of MFOVs per slab
templiert Mar 27, 2025
a566f3b
refactor(ingestion_ibeammsem): use XDim
templiert Mar 27, 2025
c5eb846
Merge pull request #59 from templiert/multisem
trautmane Mar 27, 2025
f9cd538
add get_match_pair
trautmane Apr 8, 2025
2854b69
increase startPositionMatchWeight to 0.001
trautmane Apr 11, 2025
413ced7
add pipe.01.360.match-label-patch.json
trautmane Apr 11, 2025
86d0fe7
add LABEL_UNCONNECTED_MONTAGE_MFOV_EDGES step to pipe.01.360.patch.json
trautmane Apr 18, 2025
5ab5e13
update montage mfov patch step names in pipe.01.360.patch.json
trautmane Apr 21, 2025
c8eb7af
update montage mfov patch step stuff in pipe.01.360.patch.json (again)
trautmane Apr 22, 2025
db4cd17
update montage mfov patch step stuff in pipe.01.360.patch.json (again)
trautmane Apr 22, 2025
69728c8
add tilePairDerivationParameters to pipe.01.360.patch.json
trautmane Apr 22, 2025
83fa6ed
add tileCluster to pipe.01.360.patch.json
trautmane Apr 22, 2025
c401335
fix tileCluster in pipe.01.360.patch.json
trautmane Apr 22, 2025
1c211a8
fix tileCluster in pipe.01.360.patch.json
trautmane Apr 22, 2025
2710a27
first draft of pipe.02.360.align_rxy.json
trautmane Apr 24, 2025
dd22a8d
change pipe.02.360.align_rxy.json to ensure that only a translation …
trautmane Apr 28, 2025
bd6bbf4
add setup scripts for wafer 53 center volume
trautmane Apr 28, 2025
d6b52bb
add pipe.02.360.align_translation.json
trautmane Apr 28, 2025
2cf6ba4
Add option to upload non-trimmed stack
minnerbe Apr 30, 2025
f3bab2a
Merge pull request #36 from JaneliaSciComp/refactor/multisem-upload
minnerbe May 1, 2025
5a0ae82
first draft of pipe.02.360.export_rxy.json
trautmane May 1, 2025
7256f28
Merge remote-tracking branch 'origin/multisem' into multisem
trautmane May 1, 2025
f9aa233
remove unused and mis-specified stackPatterns from 02_align parameters
trautmane May 6, 2025
eef2a4a
bump render-ws-with-mongodb container version to 0.0.7
trautmane Jul 12, 2025
2b00f70
add pipe.00.360.mfov.json
trautmane Jul 13, 2025
d7dd47c
fix google storage URL
trautmane Jul 13, 2025
114e4e2
add support for restoring hacked admin__stack_meta_data
trautmane Aug 8, 2025
a4c035a
improve comment
trautmane Aug 8, 2025
d0e3a8e
fix missing DB parameter in restore script
trautmane Aug 15, 2025
4ce381e
add 07_rename_google_dump_collections.sh
trautmane Aug 15, 2025
b4c4bbe
add prealignedSfovStackSuffix and crossMatchIdList parameters to pipe…
trautmane Aug 29, 2025
a397682
add minCrossMatchPixelDistance parameter to pipe.00.360.mfov.json
trautmane Sep 2, 2025
0909f89
change crossMatchIdList to "F" just to simplify naming of stacks from…
trautmane Sep 2, 2025
74d5493
change crossMatchIdList to "H" just to simplify naming of stacks from…
trautmane Sep 2, 2025
2668454
restore minCrossMatchPixelDistance and set to 2.5
trautmane Sep 5, 2025
5aae7f3
remove crossMatchIdList parameter from MFOV-as-tile pipeline
trautmane Sep 5, 2025
fde7bf7
reduce minCrossMatchPixelDistance to 1.0
trautmane Sep 5, 2025
66fc719
rename wafer_60_gc_test.py to gc_upload.py and add 21_gc_upload.sh la…
trautmane Sep 6, 2025
1d3aeee
change magc slab to serial slab
trautmane Sep 6, 2025
46330c4
make ABSOLUTE_SCRIPT use symlink instead of real path
trautmane Sep 6, 2025
0c51855
expose NUM_THREADS as a script parameter
trautmane Sep 6, 2025
04d2dcb
set MFOV-as-tile stack pattern to include serial slabs 360 and 361
trautmane Sep 6, 2025
019b508
set MFOV-as-tile stack pattern to include serial slabs 360 to 369
trautmane Sep 11, 2025
a07b8b8
update render-ws-with-mongodb container image version to 0.0.8
trautmane Sep 12, 2025
7193c10
add pipe.02.36n.align.json with weightModificationDeciles 50x500
trautmane Sep 12, 2025
2f63f6a
update load tip
trautmane Sep 12, 2025
7355365
improve usage info
trautmane Sep 12, 2025
1aeb071
update align pipelineStackGroups for par (pre-align-rough)
trautmane Sep 12, 2025
490beb1
add pipe.01.36n.match-patch-check.json
trautmane Sep 12, 2025
46a4597
remove no longer supported pipeline step
trautmane Sep 12, 2025
0522493
remove obsolete msem_60_61/pipeline_json/01_match files
trautmane Sep 12, 2025
da0ae42
rename pipe.00.360.mfov.json as pipe.00.36n.mfov.json and remove unus…
trautmane Sep 12, 2025
5b49da0
rename pipe.01.36n.match-patch-check.json as pipe.01.36n.match-patch.…
trautmane Sep 12, 2025
cfa8865
rename pipe.01.36n.match-patch-check.json as pipe.01.36n.match-patch.…
trautmane Sep 16, 2025
36eb22e
more align pipeline changes
trautmane Sep 16, 2025
fbda738
add premium tier option for Google Dataproc jobs
trautmane Sep 16, 2025
ad98618
add pipe.03.36n.ic.json and remove old pipe.02 align files
trautmane Sep 17, 2025
28cca41
add excluded scans for wafer 61
trautmane Sep 17, 2025
46fd3b8
set gc_upload base path based upon wafer number
trautmane Sep 18, 2025
2c66edd
need to zero pad serial ids in project name
trautmane Sep 18, 2025
a7569e5
bump render-ws-with-mongodb container image version to 0.0.9
trautmane Sep 19, 2025
66d30f6
bump render-ws-with-mongodb container image version to 0.0.10
trautmane Sep 22, 2025
918ad81
add renderedMfovRunTimestamp to 00_rough_align pipeline files
trautmane Sep 22, 2025
d99dcdc
rename pipe.00.36n.mfov.json as pipe.00.w60.36n.mfov.json
trautmane Sep 22, 2025
4b08fc6
add private-network-ip option to create_compute_instance_vm.sh
trautmane Sep 23, 2025
f24ef7a
add pipe.00.w61....mfov.json files for slabs 090 through 159
trautmane Sep 23, 2025
6a17885
reduce dataproc:persistent-disk-size from default of 100GB to 50GB
trautmane Sep 25, 2025
534072d
change dataproc:persistent-disk-size to spark.dataproc.executor.disk.…
trautmane Sep 25, 2025
63ccf89
add pipe.00.w61.12n-and-13n.mfov.json
trautmane Sep 25, 2025
ce65c7f
remove spark.dataproc.executor.disk.size property since it must be >=…
trautmane Sep 25, 2025
732436e
add max-executors parameter to 02_run_pipeline.sh
trautmane Sep 25, 2025
6ae63f1
add max-executors parameter to 02_run_pipeline.sh
trautmane Sep 25, 2025
3f64e09
add max-executors parameter to 02_run_pipeline.sh
trautmane Sep 25, 2025
0bd11d7
change roughSfovStackSuffix from _pa_rough to _par
trautmane Sep 27, 2025
ab2b091
simplify 00_rough_align and 01_match pipeline json files by replacing…
trautmane Sep 27, 2025
f1ecc4a
upgrade to n2-standard-16 VMs and CONTAINER_IMAGE_VERSION 0.0.11
trautmane Sep 27, 2025
3aefbe7
upgrade to CONTAINER_IMAGE_VERSION 0.0.12
trautmane Sep 28, 2025
bfe28f4
upgrade to CONTAINER_IMAGE_VERSION 0.0.13
trautmane Sep 28, 2025
4211e84
try to reduce google log data by setting spark.log.level.org.janelia.…
trautmane Sep 29, 2025
a3f82e9
comment out spark.log.level.org.janelia.alignment.match=WARN setting …
trautmane Sep 30, 2025
4803162
remove early w60 36n align pipeline files
trautmane Sep 30, 2025
a75fe43
add w60 and w61 'any' align pipeline files
trautmane Sep 30, 2025
1afaa50
remove early w60 36n correct intensity pipeline files
trautmane Sep 30, 2025
4a70402
add w60 and w61 'any' correct intensity pipeline files
trautmane Sep 30, 2025
892b18b
add batch-id-suffix parameter to 02_run_pipeline.sh
trautmane Sep 30, 2025
60aac27
fix pipeline json names in examples
trautmane Sep 30, 2025
c3f625a
add pipe.01.w61.any.r00.filter.json
trautmane Oct 3, 2025
b286db7
fix ic2d parameters for initial wafer 61 runs
trautmane Oct 6, 2025
4fb7b7d
add hack_admin_stack_metadata.sh to simplify process when we need to …
trautmane Oct 6, 2025
5d345cb
add new intensityAdjust parameters for multi-SEM IC2D pipelines
trautmane Oct 6, 2025
8f8f2ec
minor dataproc script improvements
trautmane Oct 8, 2025
b2b752f
minor dataproc script improvements
trautmane Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Pipeline scripts and tools for reconstructing Electron Microscopy volumes.

### Setup
1. If necessary, [install miniconda](https://docs.conda.io/en/latest/miniconda.html).
1. If necessary, [install miniforge](https://github.com/conda-forge/miniforge?tab=readme-ov-file#install).

### Create Environment and Install
```bash
git clone https://github.com/JaneliaSciComp/EM_recon_pipeline.git

cd EM_recon_pipeline

conda env create -f janelia_emrp.environment.yml
conda activate janelia_emrp
conda env create -f janelia_emrp_3_12.environment.yml
conda activate janelia_emrp_3_12

poetry install
```
Expand Down
10 changes: 10 additions & 0 deletions janelia_emrp_3_12.environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: janelia_emrp_3_12

channels:
- default
- conda-forge

dependencies:
- python=3.12
- urllib3=1.26
- poetry
3,136 changes: 1,839 additions & 1,297 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
[tool.poetry]
name = "janelia-emrp"
version = "0.1.0"
version = "0.2.0"
description = "Pipeline scripts and tools for reconstructing Electron Microscopy volumes."
authors = ["Eric Trautman <[email protected]>"]
license = 'BSD-3-Clause'
package-mode = false

[tool.poetry.dependencies]
python = "^3.9"
fibsem-tools = "0.3.1"
python = "^3.12"
render-python = {git = "https://github.com/AllenInstitute/render-python.git"}
dask-janelia = "^0.1.4"
bokeh = "^2.3.3"
h5py = "^3.6.0"
pytest = "^7.1.1"
xarray-multiscale = "0.3.1"
pydantic = "^1.9.0"
numpy = "1.21.0"
scikit-image = "0.19.3"
xarray-multiscale = "0.3.3"
pydantic = "^2.7.0"
numpy = "1.26.4"
scikit-image = "0.22.0"
matplotlib = "*"
google-cloud-storage = "2.19.0"
opencv-python = "4.10.0.84"
basicpy = "1.2.0"

[tool.poetry.dev-dependencies]

Expand Down
7 changes: 3 additions & 4 deletions src/python/janelia_emrp/match/delete_match_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ def main(arg_list: List[str]):
try:
main(sys.argv[1:])
# main(["--render_host", "em-services-1.int.janelia.org:8080",
# "--match_owner", "hess_wafer_53c",
# "--match_collections", "s002_m395_match",
# "--match_owner", "hess_wafers_60_61",
# "--match_collections", "w60_s360_r00_d20_gc_match",
# "--pair_type", "within",
# "--min_keep_weight", "0.20",
# "--explain"])
# "--min_keep_weight", "0.20"])
except Exception as e:
# ensure exit code is a non-zero value when Exception occurs
traceback.print_exc()
Expand Down
256 changes: 207 additions & 49 deletions src/python/janelia_emrp/msem/field_of_view_layout.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
from dataclasses import dataclass
from typing import List, Dict, Tuple

# Column group ordering for standard 7 mFOV layout:
# 03
# 01 06
# 04
# 02 07
# 05
SEVEN_MFOV_COLUMN_GROUPS = [[1, 2], [3, 4, 5], [6, 7]]


# Column group ordering for standard 19 mFOV layout:
# 08
# 04 13
# 01 09 17
# 05 14
# 02 10 18
# 06 15
# 03 11 19
# 07 16
# 12
NINETEEN_MFOV_COLUMN_GROUPS = [[1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11, 12], [13, 14, 15, 16], [17, 18, 19]]


# Mapping for 91 sFOV spiral from center of mFOV pattern that inserts empty/gap columns to improve visualization.
#
# column: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Expand Down Expand Up @@ -58,41 +37,211 @@
"082": (10, 5), "083": (10, 7), "084": (10, 9), "085": (10, 11), "086": (10, 13), "087": (10, 15)
}

# Identifies a "space" mfov in a column that is needed for positioning but is not a real mfov.
SPACE_MFOV_NUMBER = -1

# For a layout with MFOVs that each contain 91 SFOVs,
# the rough difference in y between the centers of two adjacent mfovs in the same column.
# Needs to be big enough to allow for the largest difference across all mfovs (but not too big).
NINETY_ONE_SFOV_ADJACENT_MFOV_DELTA_Y = 17000 # 16334 - 16428

@dataclass
class MFovPosition:
mfov_number: int
center_sfov_x: int
center_sfov_y: int

@dataclass
class MfovLayoutColumn:
mfov_positions: List[MFovPosition]

def size(self):
return len(self.mfov_positions)

def to_mfov_number_list(self) -> List[int]:
return [mfov_position.mfov_number for mfov_position in self.mfov_positions]

def to_y_list(self) -> List[int]:
return [mfov_position.center_sfov_y for mfov_position in self.mfov_positions]

@dataclass
class MfovColumnGroup:
layout_columns: List[MfovLayoutColumn]

def max_number_of_mfovs_in_column(self):
return max([column.size() for column in self.layout_columns])

def to_list_of_mfov_number_lists(self) -> List[List[int]]:
return [column.to_mfov_number_list() for column in self.layout_columns]

def to_list_of_y(self) -> List[List[int]]:
return [column.to_y_list() for column in self.layout_columns]

def print_mfov_info(self):
list_of_mfov_number_lists = self.to_list_of_mfov_number_lists()
max_mfovs = self.max_number_of_mfovs_in_column()
print("\nmfov columns:")
for i in range(len(list_of_mfov_number_lists)):
n_list = list_of_mfov_number_lists[i]
offset = " " * int((max_mfovs - len(n_list)) * 6 / 2)
print(f" column {i:2d} ({len(n_list):2d} mfovs): {offset} {[str(n).zfill(2) for n in n_list]}")

def print_mfov_y_values(self):
print("\nmfov y values:")
for c_list in self.to_list_of_y():
print(f" {c_list}")

def build_mfov_column_group(mfov_position_list: List[MFovPosition],
delta_y_for_one_row: int) -> MfovColumnGroup:

if len(mfov_position_list) == 0:
raise RuntimeError("mfov_position_list must not be empty")
elif delta_y_for_one_row < 1:
raise RuntimeError("delta_y_for_one_row must be positive")

sorted_by_mfov_number = sorted(mfov_position_list, key=lambda mp: mp.mfov_number)
previous_mfov = sorted_by_mfov_number[0]
layout_column = MfovLayoutColumn(mfov_positions=[previous_mfov])
column_group = MfovColumnGroup(layout_columns=[layout_column])
min_y = previous_mfov.center_sfov_y
max_y = previous_mfov.center_sfov_y

for current_mfov in sorted_by_mfov_number[1:]:

delta_x = current_mfov.center_sfov_x - previous_mfov.center_sfov_x
delta_y = current_mfov.center_sfov_y - previous_mfov.center_sfov_y

if delta_x < 0 and delta_y < 0:
raise RuntimeError(f"mfov positions must be sorted top-to-bottom, left-to-right: "
f"mfov {current_mfov} to {previous_mfov} has delta_x {delta_x} and delta_y {delta_y}")

elif delta_x < delta_y: # same column

# add "space" mfovs as needed to column
y = previous_mfov.center_sfov_y
while delta_y > delta_y_for_one_row:
y = y + delta_y_for_one_row
layout_column.mfov_positions.append(MFovPosition(SPACE_MFOV_NUMBER, current_mfov.center_sfov_x, y))
delta_y = delta_y - delta_y_for_one_row

# add current mfov to column
layout_column.mfov_positions.append(current_mfov)

else: # new column
layout_column = MfovLayoutColumn(mfov_positions=[current_mfov])
column_group.layout_columns.append(layout_column)

min_y = min(min_y, current_mfov.center_sfov_y)
max_y = max(max_y, current_mfov.center_sfov_y)

previous_mfov = current_mfov

# ensure we have an odd number of columns
column_count = len(column_group.layout_columns)
added_empty_column = False
if column_count % 2 == 0:
delta_x = column_group.layout_columns[0].mfov_positions[0].center_sfov_x - column_group.layout_columns[1].mfov_positions[0].center_sfov_x
last_mfov = column_group.layout_columns[-1].mfov_positions[-1]
space_x = last_mfov.center_sfov_x + delta_x
space_y = last_mfov.center_sfov_y
column_group.layout_columns.append(MfovLayoutColumn(mfov_positions=[MFovPosition(SPACE_MFOV_NUMBER, space_x, space_y)]))
added_empty_column = True

middle_column_index = int(column_count / 2)
previous_column = None

# add empty mfovs to columns so that all columns have similar number of mfovs (within 1)
for column_index in range(len(column_group.layout_columns)):
column = column_group.layout_columns[column_index]
filled_mfov_positions = []

top_mfov_position = column.mfov_positions[0]
x = top_mfov_position.center_sfov_x
delta_y = top_mfov_position.center_sfov_y - min_y
number_of_top_spaces = int(delta_y / delta_y_for_one_row)

for j in range(number_of_top_spaces):
y = top_mfov_position.center_sfov_y - ((number_of_top_spaces - j) * delta_y_for_one_row)
filled_mfov_positions.append(MFovPosition(SPACE_MFOV_NUMBER, x, y))

filled_mfov_positions.extend(column.mfov_positions)

bottom_mfov_position = column.mfov_positions[-1]
x = bottom_mfov_position.center_sfov_x
delta_y = max_y - bottom_mfov_position.center_sfov_y
number_of_bottom_spaces = int(delta_y / delta_y_for_one_row)
for j in range(number_of_bottom_spaces):
y = bottom_mfov_position.center_sfov_y + ((j+1) * delta_y_for_one_row)
filled_mfov_positions.append(MFovPosition(SPACE_MFOV_NUMBER, x, y))

if previous_column is not None:
x = filled_mfov_positions[0].center_sfov_x
top_y = filled_mfov_positions[0].center_sfov_y
bottom_y = filled_mfov_positions[-1].center_sfov_y
if column_index <= middle_column_index:
while top_y > previous_column.mfov_positions[0].center_sfov_y:
top_y = top_y - delta_y_for_one_row
filled_mfov_positions.insert(0, MFovPosition(SPACE_MFOV_NUMBER, x, top_y))
while bottom_y < previous_column.mfov_positions[-1].center_sfov_y:
bottom_y = bottom_y + delta_y_for_one_row
filled_mfov_positions.append(MFovPosition(SPACE_MFOV_NUMBER, x, bottom_y))
elif len(previous_column.mfov_positions) > 1:
while top_y > previous_column.mfov_positions[1].center_sfov_y:
top_y = top_y - delta_y_for_one_row
filled_mfov_positions.insert(0, MFovPosition(SPACE_MFOV_NUMBER, x, top_y))
while bottom_y < previous_column.mfov_positions[-2].center_sfov_y:
bottom_y = bottom_y + delta_y_for_one_row
filled_mfov_positions.append(MFovPosition(SPACE_MFOV_NUMBER, x, bottom_y))

column.mfov_positions = filled_mfov_positions
previous_column = column

if added_empty_column:
column_group.layout_columns.pop()

return column_group

class FieldOfViewLayout:
def __init__(self,
mfov_column_groups: List[List[int]],
mfov_column_group: MfovColumnGroup,
sfov_index_name_to_row_col: Dict[str, Tuple[int, int]]):

self.mfov_column_groups = mfov_column_groups
self.mfov_column_group = mfov_column_group
self.sfov_index_name_to_row_col = sfov_index_name_to_row_col
self.mfov_name_to_offsets = {}

max_number_of_mfovs_in_column = 0
for column_group in mfov_column_groups:
max_number_of_mfovs_in_column = max(max_number_of_mfovs_in_column, len(column_group))
self.mfov_number_to_offsets = {}

max_number_of_mfovs_in_column = mfov_column_group.max_number_of_mfovs_in_column()
column_group_index = 0
for column_group in mfov_column_groups:
for layout_column in mfov_column_group.layout_columns:
# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# -:-- -:-- -:-- -:-- 0:72 -:-- 0:71 -:-- 0:70 -:-- 0:69 -:-- 0:68 -:-- 0:67 7:77
col_offset = column_group_index * 16
row_offset = (max_number_of_mfovs_in_column - len(column_group)) * 5
for mfov_number in column_group:
mfov_name = f"{mfov_number:06d}"
self.mfov_name_to_offsets[mfov_name] = (row_offset, col_offset)

# 1: 7:72
# 2: 7:73 -:--
# 3: 7:74 -:-- 7:47
# 4: 7:75 -:-- 7:48 -:--
# 5: 7:76 -:-- 7:49 -:-- 7:28
# 6: 0:67 7:77 -:-- 7:50 -:-- 7:29 -:--
row_offset = (max_number_of_mfovs_in_column - layout_column.size()) * 5

for mfov_number in layout_column.to_mfov_number_list():
if mfov_number >= 0:
self.mfov_number_to_offsets[mfov_number] = (row_offset, col_offset)
row_offset = row_offset + 11
column_group_index += 1

def row_and_col(self,
mfov_name: str,
sfov_index_name: str) -> (int, int):
row_offset, col_offset = self.mfov_name_to_offsets[mfov_name]
mfov_number: int,
sfov_index_name: str) -> Tuple[int, int]:
row_offset, col_offset = self.mfov_number_to_offsets[mfov_number]
sfov_row, sfov_col = self.sfov_index_name_to_row_col[sfov_index_name]
return sfov_row + row_offset, sfov_col + col_offset

def build_sfov_index_name_matrix(self) -> List[List[str]]:
max_row_offset = 0
max_col_offset = 0
for key, value in self.mfov_name_to_offsets.items():
for key, value in self.mfov_number_to_offsets.items():
row_offset, col_offset = value
max_row_offset = max(max_row_offset, row_offset)
max_col_offset = max(max_col_offset, col_offset)
Expand All @@ -113,23 +262,32 @@ def build_sfov_index_name_matrix(self) -> List[List[str]]:
names_for_row.append(" ")
sfov_index_name_matrix.append(names_for_row)

for mfov_name in sorted(self.mfov_name_to_offsets.keys()):
for mfov_number in sorted(self.mfov_number_to_offsets.keys()):
for sfov_index_name in sorted(self.sfov_index_name_to_row_col.keys()):
row, col = self.row_and_col(mfov_name, sfov_index_name)
sfov_index_name_matrix[row][col] = f"{mfov_name[-2:]}:{sfov_index_name}"
row, col = self.row_and_col(mfov_number, sfov_index_name)
sfov_index_name_matrix[row][col] = f"{mfov_number:02d}:{sfov_index_name}"

return sfov_index_name_matrix

def print_sfov_index_name_matrix(self):
sfov_index_name_matrix = self.build_sfov_index_name_matrix()
for i in range(0, len(sfov_index_name_matrix)):
names_for_row = sfov_index_name_matrix[i]
for j in range(0, len(names_for_row)):
print(names_for_row[j], end=" ")
print("")

def main():
layout = FieldOfViewLayout(SEVEN_MFOV_COLUMN_GROUPS, NINETY_ONE_SFOV_NAME_TO_ROW_COL)
# layout = FieldOfViewLayout(NINETEEN_MFOV_COLUMN_GROUPS, NINETY_ONE_SFOV_NAME_TO_ROW_COL)
sfov_index_name_matrix = layout.build_sfov_index_name_matrix()
for i in range(0, len(sfov_index_name_matrix)):
names_for_row = sfov_index_name_matrix[i]
for j in range(0, len(names_for_row)):
print(names_for_row[j], end=" ")
print("")
column_group = build_mfov_column_group(
[
MFovPosition( 0, 10, 100), MFovPosition( 1, 10, 110),
MFovPosition( 2, 20, 45), MFovPosition( 3, 20, 55), MFovPosition( 4, 20, 65), MFovPosition(5, 20, 75), MFovPosition(6, 20, 85), MFovPosition(7, 20, 95), MFovPosition(8, 20, 105), MFovPosition(9, 20, 115),
MFovPosition(10, 30, 50), MFovPosition(11, 30, 60), MFovPosition(12, 30, 70)
],
10)

layout = FieldOfViewLayout(column_group, NINETY_ONE_SFOV_NAME_TO_ROW_COL)
layout.print_sfov_index_name_matrix()


if __name__ == '__main__':
Expand Down
Loading