Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 38 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
# axonal_connectomics
Repository for tools developed for axonal connectomics

# Stitching modules
## Deskew and zarr conversion
acpreprocessing.stitching_modules.convert_to_n5.tiff_to_ngff
- Sequentially reads image arrays from a tiff stack series for pixel-wise deskew (optional), for computing a downsampling pyramid to a user-defined depth, and for writing out the data volume into a next-generation file format (zarr v3).
### Level of Support
We are planning on occasional updating this tool with no fixed schedule. Community involvement is encouraged through both issues and pull requests. Please make pull requests against the develop branch, as we will test changes there before merging into main.

## Tile stitching
acpreprocessing.stitching_modules.acstitch.stitch
- Generate point correspondences between tiles from template matching or SIFT features at user-defined resolution level (mip).
### Methods

## Stitching requirements:
Set these env variables:
```
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export SPARK_LOCAL_IP=127.0.1.1
**Deskew and zarr conversion**
`acpreprocessing.stitching_modules.convert_to_n5.tiff_to_ngff`
- Sequentially reads image arrays from a tiff stack series for pixel-wise deskew (optional), for computing a downsampling pyramid to a user-defined depth, and for writing out the data volume into a next-generation file format (zarr v3).
```
- To run:
python zarrv3_to_zarr.py \
--input_file PATH_TO_INPUT_ZARR_FILE \
--output_file PATH_TO_OUTPUT_ZARR_FILE \
--group_names LIST_OF_GROUP_NAMES \
--group_attributes LIST_OF_GROUP_ATTRIBUTE_DICTS \
--block_concurrency SLICE_LEVEL_CONCURRENCY_DEFAULT_1 \
--deskew_options DICT_OF_DESKEW_OPTIONS
```
docker build -t ac-stitch .

docker run \
-v /ACdata:/ACdata \
-v /ispim2_data:/ispim2_data \
-dit ac-stitch
**Point extraction**
`acpreprocessing.stitching_modules.acstitch.extract_points`
- Detects blob features within user-defined ROIs of a source tile and generates initial point correspondences with a target tile using the estimated tile offset.
```
python extract_points.py \
--p_tile PATH_TO_SOURCE_TILE \
--q_tile PATH_TO_TARGET_TILE \
--output_file PATH_TO_OUTPUT_POINTMATCH_FILE \
--mip_lvl MIP_LEVEL_DEFAULT_0 \
--roi_file PATH_TO_ROI_JSON_FILE \
--method BLOB_DETECTION_METHOD_log_dog_OR_doh \
--blob_kwargs DICT_OF_BLOB_DETECTION_KWARGS \
--n_points NUMBER_OF_POINTS_PER_ROI_DEFAULT_1
```

docker exec <container_id> python examples/runmodules.py
**Tile stitching**
`acpreprocessing.stitching_modules.acstitch.stitch`
- Generate point correspondences between tiles from template matching or SIFT features at user-defined resolution level (mip).
```
python stitch_tiles.py \
--input_file PATH_TO_INPUT_POINTMATCH_FILE \
--output_file PATH_TO_OUTPUT_POINTMATCH_FILE \
--stitch_method STITCH_METHOD_ccorr_OR_sift \
--miplvl MIP_LEVEL_DEFAULT_0 \
--sift_kwargs DICT_OF_SIFT_KWARGS \
--stitch_kwargs DICT_OF_STITCH_KWARGS
```
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
name = "acpreprocessing"
description = "Axonal connectomics processing"
requires-python = ">3.8,<3.12"
version = "0.0.1"
dynamic = ["dependencies"]
dynamic = ["dependencies", "version"]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
Expand Down Expand Up @@ -41,7 +40,7 @@ acpreprocessing = { path = ".", editable = true }

# conda-enabled features
[tool.pixi.feature.pixi-base.dependencies]
numpy = "1.26.0"
numpy = "*"
imageio = "*"
matplotlib = "*"

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pillow
tifffile==2020.7.4
tifffile>=2020.7.4
scikit-image
numpy==1.26.0
numpy
imageio
# "imageio<2.21",
matplotlib
Expand All @@ -10,4 +10,4 @@ natsort
requests
cloud-volume>=8.5.5
zarr
h5py
h5py
Loading