Comments (5)
I now know that it seems to be possible to get the corresponding skeleton and convert it to swc by cloudvolume, but I seem to have some bugs
vol = cloudvolume.CloudVolume(
'precomputed:xxxx/seg', # neuroglancer layer
use_https=True, #
mip=2
)
segment_id = 45
skel = vol.skeleton.get(45)
skel.viewer()
with open('segment_45.swc', 'w') as f:
f.write(skel.to_swc())
then there is bug
Traceback (most recent call last):
File "C:\Users\Administrator\miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3398, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-125-874f70be3ddb>", line 1, in <cell line: 1>
skel0.to_swc()
File "C:\Users\Administrator\miniconda3\lib\site-packages\cloudvolume\skeleton.py", line 1049, in to_swc
swc += generate_swc(skel, offset) + "\n"
File "C:\Users\Administrator\miniconda3\lib\site-packages\cloudvolume\skeleton.py", line 1028, in generate_swc
T=skel.vertex_types[node],
IndexError: index 0 is out of bounds for axis 0 with size 0
but the skeleton is not empty
Skeleton(segid=45, vertices=(shape=226, float32), edges=(shape=225, uint32), radius=(226, float32), vertex_types=(0, uint8), space='physical' transform=[[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0]])
Ok, when I wrote this issue I seem to have solved the bug, I need to manually set the type of these nodes
segment_id = 45
skel = vol.skeleton.get(45)
skel.vertex_types = np.zeros(shape=skel.vertices.shape[0], dtype=np.uint8) # manually setting
skel.viewer()
with open('segment_45.swc', 'w') as f:
f.write(skel.to_swc())
By the way, can't Igneous discern the node type of the skeleton using kimimaro's skeletonization method? For example, endpoint, soma, etc.? If I want to determine that a node is an endpoint, do you have a better suggestion?
from igneous.
Hi liuyx599,
Thank you for persisting and figuring out the issue! You make a good point, it should be possible to annotate at least some of the points using radius and structural information. This is something we could add. Endpoints in particular are very easy.
However, one reason we strip the vertex_types when making neuroglancer compatible skeletons is (afaik) neuroglancer doesn't support integer vertex attributes. Once that is fixed, we can stop stripping them.
from igneous.
Thanks for your reply! So kimimaro, like teaser, does not generate node type information during the skeletonization process? I now have a simple idea to speak about nodes of degree 1 (leaf nodes) and root nodes as endpoints of the skeleton, which can be achieved with the help of navis as follows:
skel = navis.read_swc(".\segment_45.swc")
skel.leafs
Out[8]:
node_id label x y z radius parent_id type
99 104 0 2328.0 2088.0 2970.0 107.331261 103 end
221 226 0 5256.0 3192.0 2970.0 24.000000 225 end
225 79 0 1824.0 1968.0 2970.0 53.665630 78 end
If kimimaro can't automatically determine the type of these nodes, I can't think of a better way to determine the endpoints
from igneous.
Hi! Navis is definitely more sophisticated, but the Skeleton class used in Igneous, CloudVolume, and Kimimaro does have the capability to compute terminal and branch nodes. We could augment the SWC generator with this information.
https://github.com/seung-lab/cloud-volume/blob/master/cloudvolume/skeleton.py#L308-L322
skel.terminals()
skel.branches()
from igneous.
This is very cool, and it seems to be consistent with navis' results, where cloud-volume's terminals are equivalent to navis' leafs plus root
from igneous.
Related Issues (20)
- CLAHE Contrast Adjustment
- Missing parameter for MultiResShardedFromUnshardedMeshMergeTask HOT 3
- TIFF Stack Upload
- Variable name bug HOT 1
- Skeletonizing Merge Task produces error HOT 15
- cloudfiles.exceptions.DecompressionError: File contains zero bytes: N/A HOT 4
- Examples of using mulitres mesh? HOT 6
- Mesh info file caching causing errors in MultiResShardedMeshMergeTask? HOT 2
- Rearrange Slices Operator
- feat: rotate queues
- uncompressed sharded format HOT 3
- Last voxel column gets shifted to the front HOT 6
- Some volumes are not Downsampled HOT 2
- Does igneous currently support generating graphene format data HOT 1
- Why is the browser stuck when visualizing the generated surface mesh? HOT 7
- `num_mips` needs a type annotation HOT 3
- Check datasets are identical.
- Do I need to manually clear the folder where QUEUE is stored? HOT 2
- How to avoid the cloudvolume.exceptions.EmptyVolumeException HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from igneous.