You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-8Lines changed: 40 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,19 @@
1
1
# flatone
2
2
3
-
A command-line tool to (1) download one EyeWire II neuron mesh as `.obj`, (2) skeletonize it as `.swc` and (3) flatten it automatically.
3
+
A command-line tool that automatically (1) downloads the mesh of an EyeWire II neuron as `.obj` with [CaveClient/CloudVolume](https://github.com/seung-lab/cloud-volume), (2) skeletonizes it as an `.swc` with [skeliner](https://github.com/berenslab/skeliner) and (3) flattens it with [pywarper](https://github.com/berenslab/pywarper).
4
+
5
+
## Installation
6
+
7
+
__NOTE__: `flatone` relies on SuiteSparse, which does **NOT** run on native Windows. Use it on Unix-like enviroment or Windows Subsystem for Linux (WSL 2) instead.
4
8
5
-
## Installation and Usage
6
9
7
10
```bash
8
11
# prerequisites
9
12
## mac
10
13
brew update
11
14
brew install suite-sparse
12
15
13
-
## debian/ubuntu/WSL
16
+
## debian/ubuntu/WSL
14
17
sudo apt-get update
15
18
sudo apt-get install build-essential # if not already installed
16
19
sudo apt-get install libsuitesparse-dev
@@ -27,23 +30,53 @@ pip install -e .
27
30
28
31
# but it's highly recommended to install it within a venv env
29
32
# here we use uv again but of course you can run python -m venv
30
-
uv venv .venv --python 3.13
33
+
uv venv .venv --python 3.13# any versions>=3.10 should work
31
34
source .venv/bin/activate
32
35
uv pip install -e .
33
36
34
37
# now you can check if it works
35
38
flatone -v
36
39
```
37
40
38
-
Assuming you have a CAVEClient token stored in your environment, you can run the full pipeline in one line:
41
+
## Usage
42
+
43
+
> DISCLAIMER
44
+
>
45
+
> `flatone` is designed for quick, exploratory inspection. Skeletons and warps are generated with the default parameters of `skeliner` and `pywarper`, most of them cannot be tuned directly in `flatone`, so results might not be optimal for some cells. For higher-precision results, run `skeliner` and `pywarper` directly and fine-tune the parameters.
46
+
47
+
All you need to do is provide the segment ID of an EW2 neuron you'd like to preview:
39
48
40
49
```bash
41
50
flatone SEGMENT_ID
42
51
```
43
52
44
-
(If you don't have a CAVEClient token yet, `flatone` will call `CAVEclient().auth.get_new_token()`automatically, which will guide you to a website to get a new token (you don't need to follow all the steps from the CAVEClient, you only need to go to the link, and get the token). After that, you can run `flatone add-token YOUR-NEW-TOKEN` to save it to the environment and then run `flatone SEGMENT_ID` again.)
53
+
If you don't have a CAVEClient token stored in the system yet, `flatone` will call `CAVEclient().auth.get_new_token()`internally, and prints something like:
45
54
46
-
This creates an `output` directory in the working directory:
55
+
```
56
+
No CAVEclient token found.
57
+
58
+
New Tokens need to be acquired by hand. Please follow the following steps:
59
+
1) Go to: https://<URL>
60
+
2) Log in with your Google account and copy the token shown.
61
+
3) Add it to Flatone with:
62
+
flatone add-token <TOKEN>
63
+
Note: ...
64
+
Warning! ...
65
+
```
66
+
67
+
Just follow the link, copy the token, and register it with:
68
+
69
+
```bash
70
+
flatone add-token <TOKEN>
71
+
```
72
+
73
+
The token is stored in `~/.cloudvolume/secrets`. Now you can rerun the command:
74
+
75
+
```bash
76
+
flatone SEGMENT_ID
77
+
```
78
+
79
+
This will create an `output` directory in the same directory:
47
80
48
81
```bash
49
82
output
@@ -70,4 +103,3 @@ You can also warp the mesh, but it's not in the default as it's a much slower pr
70
103
`flatone` also has a (limited) interactive 3d viewer, which you can activate via `flatone view3d`. You can append a SEGMENT_ID after it to just view this cell, or without it, to view all cells within the `output/` folder. By default, it will view the unwarped meshes and skeletons together, if you warped the mesh already, you can also view the warped meshes and skeletons with `flatone view3d --warped`. You can also curate a different set of cells in another folder, then view them with `flatone view3d --warped --output-dir="path/to/another/folder".
0 commit comments