Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed network and from-scatch morgphology network vis #193

Merged
merged 2 commits into from
Dec 11, 2023
Merged

Conversation

michaeldeistler
Copy link
Contributor

This allows networks which consist of mixed SWC and from-scratch morphologies:

import matplotlib.pyplot as plt

import jaxley as jx
from jaxley.synapses import GlutamateSynapse


cell1 = jx.read_swc("jaxley_experiments/nex/ca1net/morphologies/n120/n120.CNG.swc", nseg=4)
cell2 = jx.read_swc("jaxley_experiments/nex/ca1net/morphologies/n121/n121.CNG.swc", nseg=4)

comp = jx.Compartment()
branch = jx.Branch(comp, 4)
cell3 = jx.Cell(branch, parents=[-1, 0, 0, 1, 1])
cell4 = jx.Cell(branch, parents=[-1, 0, 0, 1, 1])

conns = [
        jx.Connectivity(
            GlutamateSynapse(),
            [jx.Connection(0, 0, 0.0, 1, 0, 0.0), jx.Connection(0, 0, 0.0, 2, 0, 0.0)],
        )
    ]

net = jx.Network([cell1, cell2, cell3, cell4], conns)

net.compute_xyz()

net.cell(1).move(0, 800)
net.cell(2).move(0, -800)
net.cell(3).move(0, -1200)

fig, ax = plt.subplots(1, 1, figsize=(4, 4))
ax = net.vis(detail="full", ax=ax)

@michaeldeistler michaeldeistler merged commit d2145d6 into main Dec 11, 2023
1 check passed
@michaeldeistler michaeldeistler deleted the vis3 branch December 11, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant