Giter Site home page Giter Site logo

daisukemiyamoto / swc2vtk Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 4.0 19.68 MB

swc to vtk converter for visualization of neuron and neural circuit simulation in ParaView

License: Apache License 2.0

Python 75.38% Makefile 12.60% Batchfile 12.03%
swc vtk neurons paraview simulated-data

swc2vtk's Introduction

swc2vtk

travisci Coverage Status python-2.7,3.3,3.4-blue license paraview NEURON

SWC to VTK converter for visualizing neurons and neural circuit simulations in ParaView. This software helps making beautiful visualization of large scale multi-compartmental neuron simulations with a parallelized environment. If you need any further information, please check http://daisukemiyamoto.github.io/swc2vtk/ .

Dependency

  • tqdm
  • numpy
  • PyVTK

Install

  • $ pip install swc2vtk

Usage

Basic way to generate VTK file from one SWC file

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple.swc')
vtkgen.write_vtk('simple.vtk')

generate a VTK file from multiple SWC files

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple.swc')
vtkgen.add_swc('simple1.swc')
vtkgen.add_swc('simple2.swc')
vtkgen.write_vtk('combined.vtk')

set fixed value for coloring VTK file

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple1.swc')
vtkgen.write_vtk('simple1.vtk', fixedval=0.5)

vtkgen2 = swc2vtk.VtkGenerator()
vtkgen2.add_swc('simple2.swc')
vtkgen2.write_vtk('simple2.vtk', fixedval=1.0)

set fixed value for coloring neuron in a VTK file

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple.swc')
vtkgen.add_swc('simple1.swc')
vtkgen.add_swc('simple2.swc')
vtkgen.write_vtk('combined.vtk', coloring=True)

generate a VTK file from SWC file with simulation data

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple.swc')
vtkgen.add_datafile('result.dat')
vtkgen.write_vtk('simple.vtk')
  • data example
    each rows correspondence to SWC compartments
-65.0
-65.0
-65.0
-65.0
  • data output example for NEURON
proc saveData() { local i localobj outfile strdef filename
    filename = $s1
    
    printf("filename: %s\n", filename)
    outfile = new File()
    outfile.wopen(filename)
    for(i=0; i<SectionNum; i=i+1){
    	  access Dend[i]
        outfile.printf("%f\n", v)
    }
    outfile.printf("\n")
    outfile.close()
}

generate VTK files from SWC file with sequential simulation data

import swc2vtk
vtkgen = swc2vtk.VtkGenerator()
vtkgen.add_swc('simple.swc')

vtkgen.add_datafile('result1.dat')
vtkgen.write_vtk('simple1.vtk')

vtkgen.clear_datafile()
vtkgen.add_datafile('result2.dat')
vtkgen.write_vtk('simple2.vtk')

vtkgen.clear_datafile()
vtkgen.add_datafile('result3.dat')
vtkgen.write_vtk('simple3.vtk')

Output Examples

Single Neuron Morphology

single

Coloring Multiple SWC Files

simulation

Single Neuron Simulation

Neural Circuit Simulation

Volume Rendering

References

swc2vtk's People

Contributors

daisukemiyamoto avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

swc2vtk's Issues

Volume Rendering

  • check volume rendering mode
  • implement summation method for multi neuron simulation
  • (consider point spread functions)

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.