neuroml Package¶
neuroml
Package¶
loaders
Module¶
-
class
neuroml.loaders.
ArrayMorphLoader
¶ Bases:
object
-
classmethod
load
(filepath)¶ Right now this load method isn’t done in a very nice way. TODO: Complete refactoring.
-
classmethod
-
class
neuroml.loaders.
JSONLoader
¶ Bases:
object
-
classmethod
load
(file)¶
-
classmethod
load_from_mongodb
(db, id, host=None, port=None)¶
-
classmethod
-
class
neuroml.loaders.
SWCLoader
¶ Bases:
object
WARNING: Class defunct
-
classmethod
load_swc_single
(src, name=None)¶
-
classmethod
-
neuroml.loaders.
print_
(text, verbose=True)¶
-
neuroml.loaders.
read_neuroml2_file
(nml2_file_name, include_includes=False, verbose=False, already_included=[], print_method=<function print_>, optimized=False)¶
-
neuroml.loaders.
read_neuroml2_string
(nml2_string, include_includes=False, verbose=False, already_included=[], print_method=<function print_>, optimized=False, base_path=None)¶
writers
Module¶
-
class
neuroml.writers.
ArrayMorphWriter
¶ Bases:
object
For now just testing a simple method which can write a morphology, not a NeuroMLDocument.
-
classmethod
write
(data, filepath)¶
-
classmethod
-
class
neuroml.writers.
JSONWriter
¶ Bases:
object
Write a NeuroMLDocument to JSON, particularly useful when dealing with lots of ArrayMorphs.
-
classmethod
write
(neuroml_document, file)¶
-
classmethod
write_to_mongodb
(neuroml_document, db, host=None, port=None, id=None)¶
-
classmethod
utils
Module¶
Utilities for checking generated code
-
neuroml.utils.
add_all_to_document
(nml_doc_src, nml_doc_tgt, verbose=False)¶
-
neuroml.utils.
append_to_element
(parent, child)¶
-
neuroml.utils.
get_summary
(nml_file_name)¶
-
neuroml.utils.
has_segment_fraction_info
(connections)¶
-
neuroml.utils.
is_valid_neuroml2
(file_name)¶
-
neuroml.utils.
main
()¶
-
neuroml.utils.
print_summary
(nml_file_name)¶
-
neuroml.utils.
validate_neuroml2
(file_name)¶
arraymorph
Module¶
Prototype for object model backend for the libNeuroML project
-
class
neuroml.arraymorph.
ArrayMorphology
(vertices=[], connectivity=[], id=None, node_types=None, name=None, physical_mask=None, fractions_along=None)¶ Bases:
neuroml.nml.nml.Morphology
Core of the array-based object model backend.
Provides the core arrays - vertices,connectivity etc. node_types.
The connectivity array is a list of indices pointing to which other element an element is attached. So for instance, connectivity[3] is an integer with the index of the section it refers to in the Backend
EXAMPLE:
Vertices[3] and connectivity[3] refer to the vertex and connectivity of the same node.
Note
The root section by convention has connectivity == -1.
-
children
(index)¶ Returns an array with indexes of children
-
num_vertices
¶
-
parent_id
(index)¶ Return the parent index for the given index
-
physical_indices
¶ returns indices of vertices which are physical
-
pop
(index)¶ TODO:This is failing tests (understandably) - need to fix! Deletes a node from the morphology, its children become children of the deleted node’s parent.
-
root_index
¶
-
root_vertex
¶
-
segment_from_vertex_index
(index)¶
-
to_neuroml_morphology
(id='')¶
-
to_root
(index)¶ Changes the connectivity matrix so that the node at index becomes the root
-
valid_ids
¶
-
valid_morphology
¶
-
vertex
(index)¶ Return vertex corresponding to index in morphology
-
class
neuroml.arraymorph.
SegmentList
(arraymorph)¶ Bases:
object
This class is a proxy, it returns a segment either from the arraymorph or if it has already been instantiated it returns the relevant segment.
-
append
(segment)¶ Adds a new segment
TODO: Correct connectivity is currently being ignored - The new segment is always connected to the root node.
-