Giter VIP home page Giter VIP logo

pymaid's People

Contributors

clbarnes avatar jasper-tms avatar jefferis avatar mattliu777 avatar nilsec avatar perlman avatar pyup-bot avatar schlegelp avatar szhorvat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pymaid's Issues

Add interface with Blender

  • would need wrappers to dump neuron morphology, connectors, volumes and dotprops in Blender ( .plot_b3d() ?)
  • could keep objects/collections as classes with wrappers to change basic parameters (color, bevel, size (for connectors), layers, visibility, transparency), select or unselect, and remove objects
  • wrappers for clustering

Make copy preserve __dict__

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.

in_volume treats volumes as convex hulls

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.

Feature idea: extrapolate neurite diameter from connectors

  1. For each connector get the distance to its treenode. Use this as radius.
  2. Interpolate radius for treenodes without connectors.
  3. Maybe incorporate neuron morphology (e.g. radius should not decrease with strahler number).

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.

Add .in_volume() method to neuron classes

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.

deal with erroneous/outdated cached data

Examples:

  1. Pulling neurons with annotation X, then adding that annotation to another neuron (in CATMAID) will not change subsequent queries from pymaid as now outdated cached response is used
    2.CatmaidNeuron.reload() also uses cached data. Is this working as intended?
  2. Querying for non-existent annotations throws an error. Even if that annotation is added, will still fail due to cached response.

Possible solutions:

  • Exclude some urls (annotations, tags, etc.) from caching. Most definitely for everything that writes to the CATMAID database (Thanks for flagging, Greg!). Could use a @no_cache decorator.
  • Check if error is raised before caching server response (e.g. if annotation is not found)
  • Allow relevant functions (e.g. .reload) to overwrite caching=True decorator
  • Allow relevant functions to force cache update
  • Add clear_cached_response() analogous to get_cached_response()
  • Raise Exception/Warning if data might be outdated.
  • Add pymaid.clear_cache() function and refer to it in Cached data used message.

Compartmentalise connectivity

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.

new __eq__ broke has_annotation

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.

add tile module

  • mapping between CATMAID and tile coordinates
  • basic cutting and stitching (PIL?)

Switch to TriMesh

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

add confidence/risk calculations

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.

prune_by_strahler

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()

merge find_skid into pymaid

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?

custom plot3D class

  • make .plot3d return custom class that allows adding/removing of neurons
  • make .plot3d search for existing vispy canvases

Also: rotate object by default

Support using only a subset of modules

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.

improve downsample

  • allow resample to a node every N microns
  • add .simple attribute to CatmaidNeuron/List that generates & stores a simplified version of the neuron(s)

nblast_allbyall reports error if a neuronlist is resampled

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.