Top

ndio.ramon.RAMONSynapse module

from __future__ import absolute_import
from .enums import *
from .errors import *
import numpy

from .RAMONVolume import RAMONVolume


class RAMONSynapse(RAMONVolume):
    """
    RAMONSynapse Object for storing neuroscience data with a voxel volume
    """
    def __init__(self,
                 synapse_type=0,
                 weight=0,
                 segments=None,

                 xyz_offset=(0, 0, 0),
                 resolution=0,
                 cutout=None,
                 voxels=None,

                 id=DEFAULT_ID,
                 confidence=DEFAULT_CONFIDENCE,
                 kvpairs=DEFAULT_DYNAMIC_METADATA,
                 status=DEFAULT_STATUS,
                 author=DEFAULT_AUTHOR):

            self.synapse_type = synapse_type
            self.weight = weight
            self.segments = segments

            RAMONVolume.__init__(self,
                                 xyz_offset=xyz_offset,
                                 resolution=resolution,
                                 cutout=cutout,
                                 voxels=voxels,
                                 id=id,
                                 confidence=confidence,
                                 kvpairs=kvpairs,
                                 status=status,
                                 author=author)

Module variables

var DEFAULT_AUTHOR

var DEFAULT_CONFIDENCE

var DEFAULT_DYNAMIC_METADATA

var DEFAULT_ID

var DEFAULT_STATUS

Classes

class RAMONSynapse

RAMONSynapse Object for storing neuroscience data with a voxel volume

class RAMONSynapse(RAMONVolume):
    """
    RAMONSynapse Object for storing neuroscience data with a voxel volume
    """
    def __init__(self,
                 synapse_type=0,
                 weight=0,
                 segments=None,

                 xyz_offset=(0, 0, 0),
                 resolution=0,
                 cutout=None,
                 voxels=None,

                 id=DEFAULT_ID,
                 confidence=DEFAULT_CONFIDENCE,
                 kvpairs=DEFAULT_DYNAMIC_METADATA,
                 status=DEFAULT_STATUS,
                 author=DEFAULT_AUTHOR):

            self.synapse_type = synapse_type
            self.weight = weight
            self.segments = segments

            RAMONVolume.__init__(self,
                                 xyz_offset=xyz_offset,
                                 resolution=resolution,
                                 cutout=cutout,
                                 voxels=voxels,
                                 id=id,
                                 confidence=confidence,
                                 kvpairs=kvpairs,
                                 status=status,
                                 author=author)

Ancestors (in MRO)

  • RAMONSynapse
  • ndio.ramon.RAMONVolume.RAMONVolume
  • ndio.ramon.RAMONBase.RAMONBase
  • builtins.object

Static methods

def __init__(

self, synapse_type=0, weight=0, segments=None, xyz_offset=(0, 0, 0), resolution=0, cutout=None, voxels=None, id=0, confidence=0, kvpairs={}, status=0, author='')

Initialize a new RAMONVolume object. Inherits attributes from RAMONBase as well as:

Arguments: xyz_offset (int[3] : (0, 0, 0)): x,y,z coordinates of the minimum corner of the cube (if data is a cutout), otherwise empty resolution (int : 0): level in the database resolution hierarchy cutout (numpy.ndarray): dense matrix of data voxels: Unused for now

def __init__(self,
             synapse_type=0,
             weight=0,
             segments=None,
             xyz_offset=(0, 0, 0),
             resolution=0,
             cutout=None,
             voxels=None,
             id=DEFAULT_ID,
             confidence=DEFAULT_CONFIDENCE,
             kvpairs=DEFAULT_DYNAMIC_METADATA,
             status=DEFAULT_STATUS,
             author=DEFAULT_AUTHOR):
        self.synapse_type = synapse_type
        self.weight = weight
        self.segments = segments
        RAMONVolume.__init__(self,
                             xyz_offset=xyz_offset,
                             resolution=resolution,
                             cutout=cutout,
                             voxels=voxels,
                             id=id,
                             confidence=confidence,
                             kvpairs=kvpairs,
                             status=status,
                             author=author)

def data(

self)

Gets the data from the volume and pumps it into a numpy.ndarray format, regardless of whether it's stored in cutout or voxels. Returns it as though it were stored in cutout.

This is useful for cases where you need to operate on a 3D matrix.

Arguments: None

Returns: numpy.ndarray

def data(self):
    """
    Gets the data from the volume and pumps it into a numpy.ndarray format,
    regardless of whether it's stored in `cutout` or `voxels`. Returns it
    as though it were stored in `cutout`.
    This is useful for cases where you need to operate on a 3D matrix.
    Arguments:
        None
    Returns:
        numpy.ndarray
    """
    if self.cutout:
        return self.cutout
    else:
        raise NotImplementedError("Cannot convert from voxel list yet.")

Instance variables

var segments

var synapse_type

var weight