-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from janelia-cosem/groundtruth_conversion
Groundtruth conversion
- Loading branch information
Showing
33 changed files
with
1,095 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.cli.tiff2zarr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.cli.zarr2json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.cli.zarr_scan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.dask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.dat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.h5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.mrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.multiscale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.neuroglancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.tif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.util |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.xr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.io.zarr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.metadata.groundtruth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.metadata.neuroglancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
::: fibsem_tools.metadata.transform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# FIB-SEM tools | ||
|
||
This is a python library used by the [cellmap](https://www.janelia.org/project-team/cellmap) project team to store and manipulate large FIB-SEM images. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
site_name: "fibsem-tools" | ||
site_url: https://janelia-cellmap.github.io/fibsem-tools/ | ||
site_author: Davis Bennett | ||
site_description: >- | ||
Documentation for fibsem-tools | ||
# Repository | ||
repo_name: janelia-cellmap/pydantic-zarr | ||
repo_url: https://github.com/janelia-cellmap/pydantic-zarr | ||
|
||
# Copyright | ||
copyright: Copyright © 2016 - 2023 HHMI / Janelia | ||
|
||
theme: | ||
name: material | ||
palette: | ||
# Palette toggle for light mode | ||
- scheme: default | ||
toggle: | ||
icon: material/brightness-7 | ||
name: Switch to dark mode | ||
|
||
# Palette toggle for dark mode | ||
- scheme: slate | ||
toggle: | ||
icon: material/brightness-4 | ||
name: Switch to light mode | ||
|
||
nav: | ||
- About: index.md | ||
- Usage: usage.md | ||
- API: | ||
- io: | ||
- core: api/io/core.md | ||
- dask: api/io/dask.md | ||
- dat: api/io/dat.md | ||
- hdf5: api/io/h5.md | ||
- mrc: api/io/mrc.md | ||
- multiscale: api/io/multiscale.md | ||
- neuroglancer: api/io/neuroglancer.md | ||
- tif: api/io/tif.md | ||
- util: api/io/util.md | ||
- xarray: api/io/xr.md | ||
- zarr: api/io/zarr.md | ||
- metadata: | ||
- groundtruth: api/metadata/groundtruth.md | ||
- transform: api/metadata/transform.md | ||
- neuroglancer: api/metadata/neuroglancer.md | ||
- cli: | ||
- tiff2zarr: api/cli/tiff2zarr.md | ||
- zarr_scan: api/cli/zarr_scan.md | ||
- zarr2json: api/cli/zarr2json.md | ||
|
||
plugins: | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
options: | ||
docstring_style: numpy | ||
members_order: source | ||
separate_signature: true | ||
filters: ["!^_"] | ||
docstring_options: | ||
ignore_init_summary: true | ||
merge_init_into_class: true | ||
|
||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences | ||
- toc: | ||
baselevel: 2 | ||
toc_depth: 4 | ||
permalink: "#" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from typing import Union | ||
import click | ||
from pydantic_zarr import GroupSpec, ArraySpec | ||
import zarr | ||
from fibsem_tools import read | ||
from fibsem_tools.io.util import split_by_suffix | ||
from rich import print | ||
import os | ||
|
||
|
||
def parse_zarr_path(path: str) -> Union[ArraySpec, GroupSpec]: | ||
""" | ||
Resolve a path to a zarr group or zarr array, and parse that array or group to an | ||
instance of ArraySpec or GroupSpec, respectively. | ||
""" | ||
pre, post, suffix = split_by_suffix(path, (".n5", ".zarr")) | ||
obj = read(os.path.join(pre, post, suffix)) | ||
if isinstance(obj, zarr.Array): | ||
result = ArraySpec.from_zarr(obj) | ||
elif isinstance(obj, zarr.Group): | ||
result = GroupSpec.from_zarr(obj) | ||
else: | ||
raise ValueError(f"Got an unparseable object: {type(obj)}") | ||
return result | ||
|
||
|
||
@click.command() | ||
@click.argument("path", type=click.STRING) | ||
def cli(path: str): | ||
""" | ||
Generate a JSON representation of the structure of a zarr array or group. | ||
""" | ||
result = parse_zarr_path(path) | ||
print(result.json(indent=2)) | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.