samuroi.util package

class samuroi.util.branch.Branch(data=None, x=None, y=None, z=None, r=None)[source]

Bases: object

Represent a dendrite branch, or part of a dendrite branch. Provide functionality for splitting, joining and iterating over segments.

append(other, gap=False)[source]
corners

Nx2x2 array, where N is the number of corners. The second dimension is for left and right corner. The last dimension holds x,y values.

length
nquadrilaterals

The number of segments of this branch

outline

Return the corners of the branch in such order that they encode a polygon.

quadrilaterals

Generator over quadrilateral segments of that branch.

radius

The radius around the anchor points along the branch. (1D array)

split(nsegments=2, length=None, k=1, s=0)[source]

Split the branch into segments

x

The x coordinates of the center points along the branch. (1D array)

y

The y coordinates of the center points along the branch. (1D array)

samuroi.util.branch.normalize(v)[source]
samuroi.util.branch.perpedndicular1(v)[source]

calculate the perpendicular unit vector

class samuroi.util.branchmaskcreator.BranchMaskCreator(axes, canvas, update, notify, enabled=False)[source]

Bases: samuroi.util.maskcreator.MaskCreator

default_radius = 5.0
enabled
onclick(event)[source]
onkey(event)[source]
class samuroi.util.event.Event[source]

Bases: list

class samuroi.util.maskcreator.MaskCreator(axes, canvas, update, notify, enabled=False)[source]

Bases: object

Manages the interactive creation of masks. I.e. event handling, connecting and disconnecting slots.

enabled
onclick(event)[source]

The slot that will get called when clicked into the axes.

onkey(event)[source]

The slot that will get called when a key is pressed.

class samuroi.util.pixelmaskcreator.PixelMaskCreator(axes, canvas, update, notify, enabled=False)[source]

Bases: samuroi.util.maskcreator.MaskCreator

class Status(x, y, scatter)

Bases: tuple

scatter

Alias for field number 2

x

Alias for field number 0

y

Alias for field number 1

PixelMaskCreator.enabled
PixelMaskCreator.onclick(event)[source]
PixelMaskCreator.onkey(event)[source]
class samuroi.util.polymaskcreator.PolyMaskCreator(axes, canvas, update, notify, enabled=False)[source]

Bases: samuroi.util.maskcreator.MaskCreator

Manages the interactive creation of polygon masks.

class Status(x, y, line)

Bases: tuple

line

Alias for field number 2

x

Alias for field number 0

y

Alias for field number 1

PolyMaskCreator.enabled
PolyMaskCreator.onclick(event)[source]
PolyMaskCreator.onkey(event)[source]
class samuroi.util.postprocessors.DetrendPostProcessor[source]

Bases: object

Simple linear detrend based on scipy.signal.detrend.

class samuroi.util.postprocessors.MovingAveragePostProcessor(N)[source]

Bases: object

class samuroi.util.postprocessors.PostProcessorPipe(iterable=[])[source]

Bases: object

Allow to concatenate multiple postprocessors.

append(pp)[source]

Append a processor to the end of the pipe.