navis-org / pymaid Goto Github PK
View Code? Open in Web Editor NEWPython library to interface with CATMAID servers. Fully interoperable with navis.
Home Page: https://pymaid.readthedocs.io/en/latest/
License: GNU General Public License v3.0
Python library to interface with CATMAID servers. Fully interoperable with navis.
Home Page: https://pymaid.readthedocs.io/en/latest/
License: GNU General Public License v3.0
Also: test the tests (it's been a while)
Make get_partners
and adjacency_matrix
use actual connectors of (e.g. pruned or split) neurons passed as sources/targets.
Could simply implement a low level function that extracts adjacency matrix from get_connector_details
.
See here for an example.
Should work like a charm for parts of the neuron that have high density of connectors (see e.g. GF1 DB GMC SM #4947529
).
Would have implement a volume plot mode.
Should be ~10x speed up
Examples:
CatmaidNeuron.reload()
also uses cached data. Is this working as intended?Possible solutions:
@no_cache
decorator..reload
) to overwrite caching=True
decoratorclear_cached_response()
analogous to get_cached_response()
pymaid.clear_cache()
function and refer to it in Cached data used
message.Also: rotate object by default
Confidence:
Confidence along the arbor: go from root to all leafs, multiply low confidences on along the way. Make this part of .plot2d
and .plot3d
.
Edge risk:
In CATMAID this is calculated by (a) taking the lowest common ancestor for all synapses making up a connection and then (b) checking the fraction of total the synapses that would be "lost" if that branch was pruned off -> if all relevant synapses are clustered close together at a distal branch, cutting them off has little impact on the total number of synapses -> high risk.
risk = 1 - lost_inputs / total_inputs
Could somehow combine this with confidence.
A minimal example:
nl = pymaid.get_neuron('annotation:glomerulus DA1')
nl.resample(1000, inplace=True)
res = rmaid.nblast_allbyall( nl )
Additionally, my understanding is, since the nblast algorithm looks for cloud vectors in partner neurons, resample is alway preferred for nblasting since otherwise nodes with uneven intervals could mess up interpretation of distance between pairs.
Installation of rpy2 fails if R ist not already installed
It appears as if the n not in exc_sel
query in selection = [n for n in inc_sel if n not in exc_sel]
is now taking forever.
One problem appears to be that __eq__
asks for soma and root which will trigger fetching skeleton data if not available. But even with loaded data, it takes forever.
.simple
attribute to CatmaidNeuron/List that generates & stores a simplified version of the neuron(s)Add new function prune_by_strahler()
to pymaid.morpho
and link to core.CatmaidNeuron
Also thinking about: prune_distal_to()
and prune_proximal_to()
for neuron objects. Would just be a thin wrapper for morpho.cut_neuron()
On-demand attributes
E.g. to quickly resize a volume to be a bit more generous.
Add plot3d
function to cluster.clust_results
class. Could take k_clusters
or threshold
parameter and colour neurons accordingly.
Currently, neurons are processed sequentially. Querying intersection for all points at once might could potentially speed up the whole process.
Just copy paste code from get_urls_threaded
This would cut decoding time e.g. for an average neuron from 22ms to 8ms.
ujson
library seems to compile just fine on OSX.
Need some testing but TriMesh is pure Python (unlike PyOctree which causes problems when compiling on some systems).
TriMesh.contains()
to check if points are contained in volume.
TriMesh.volume
to return volume
Calculate overlap based on cable within X um distance for sets of neurons.
Thanks for this great library for interfacing with CATMAID.
It would be great if I could include a single module (e.g. pymaid.fetch) without the other modules. This is currently not possible due to pymaid/__init__.py automatically importing all of the submodules.
The full set of modules can take a while to load on my machine, and the initialization of VisPy leads to the spawning of a GUI application even if no visualization routine is called.
This requires not only a thin wrapper for morpho.in_volume
but also removal of connectors and more importantly closing of branches that don't have a parent anymore. There may be quite a few functions that act up when there is more than one root node.
Would show annotations used by given user(s) sorted by number of neurons annotated. Also integrate this with catbot (https://github.com/flyconnectome/catbot)
find_skid
is essentially a visualisation of a neuron's history based on logs. Could add this functionality as part of pymaid.user_stats module?
Not just CatmaidNeuron/Lists
Uses scipy to test if points are within a given CATMAID volume. The idea is to test if adding the point to the cloud would change the convex hull.
Doesn't this implicitly assume that the volume is a convey hull? Think about the convex hull of the mushroom body which looks a bit like a pyramid. It seems to me that a point could be inside the pyramid but far outside the alpha shape defining the mushroom body and still pass this test.
Use app.use(app='PyQt5')
to set default - otherwise will throw warning that other backends have not been detected
Kaleido is an algorithm to optimise assignment of random colours using the neurons' average distance to each other. See "Kaleido: Visualizing Big Brain Data with Automatic Color Assignment for Single-Neuron Images" by Ting-Yuan Wang et al. (https://link.springer.com/article/10.1007%2Fs12021-018-9363-3).
E.g. flow centrality, axon-dendrite split, etc.
Should in these cases simply assign the successor branch's strahler order to the "not a branch" branch.
Currently all user-assigned properties are purged when using .copy
on CatmaidNeurons/Lists. Could easily fix this by copying the whole __dict__
instead of only selected attributes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.