neurocarto.util.edit.moving

neurocarto.util.edit.moving.move(self, a, *, tx=0, ty=0, mask=None, axis=0, init=0)

Move blueprint zone.

Parameters:
  • a (ndarray[tuple[int, ...], dtype[_ScalarType_co]]) – Array[V, …, N, …], where N means all electrodes

  • tx (int) – x movement in um.

  • ty (int) – y movement in um.

  • mask (ndarray[tuple[int, ...], dtype[bool]] | None) – move electrode only in mask

  • axis (int) – index of N

  • init (float) – initial value V for a.

  • self (BlueprintFunctions)

Returns:

moved a (copied)

See:

BlueprintFunctions. move()

Return type:

ndarray[tuple[int, …], dtype[_ScalarType_co]]

neurocarto.util.edit.moving.move_i(self, a, *, tx=0, ty=0, mask=None, axis=0, init=0)

Move blueprint zone by steps of electrode interval space.

Parameters:
  • a (ndarray[tuple[int, ...], dtype[_ScalarType_co]]) – Array[V, …, N, …], where N means electrodes

  • tx (int) – number of dx

  • ty (int) – number of dy

  • mask (ndarray[tuple[int, ...], dtype[bool]] | None) – move electrode only in mask

  • axis (int) – index of N

  • init (float) – initial value V for a.

  • self (BlueprintFunctions)

Returns:

moved a (copied)

See:

BlueprintFunctions. move_i()

Return type:

ndarray[tuple[int, …], dtype[_ScalarType_co]]

neurocarto.util.edit.moving.fill(self, blueprint, categories=None, *, threshold=None, gap=1, unset=False)

fill each category zone as a rectangle zone.

It is a blueprint_function() function.

Parameters:
  • blueprint (ndarray[tuple[int, ...], dtype[int64]]) – Array[category, N]

  • categories (int | list[int] | None) – only consider given categories.

  • threshold (int | None) – only consider area which size larger than threshold.

  • gap (int | None) – fill the gap below (abs(y) <= gap). Use None, fill an zone as a prefect rectangle.

  • unset (bool) – unset small zone (depends on threshold)

  • self (BlueprintFunctions)

Returns:

blueprint Array[category, N]

See:

BlueprintFunctions. fill()

Return type:

ndarray[tuple[int, …], dtype[int64]]

neurocarto.util.edit.moving.extend(self, blueprint, category, step, value=None, *, threshold=None, bi=True, overwrite=False)

extend the zone of each category’s zone.

It is a blueprint_function() function.

Parameters:
  • blueprint (ndarray[tuple[int, ...], dtype[int64]]) – Array[category, N]

  • category (int) – on which category zone.

  • step (int | tuple[int, int]) – expend step on y or (x, y)

  • value (int | None) – a category value used in the extending.

  • threshold (int | tuple[int, int] | None) – Positive value: extend the zone which size larger than threshold. Negative value: extend the zone which size smaller than threshold. A tuple: extend the zone which size in a range.

  • bi (bool) – both position and negative steps direction

  • overwrite (bool) – overwrite category value. By default, only change the unset electrode.

  • self (BlueprintFunctions)

Returns:

a modified blueprint copy.

See:

BlueprintFunctions. extend()

Return type:

ndarray[tuple[int, …], dtype[int64]]

neurocarto.util.edit.moving.reduce(self, blueprint, category, step, *, threshold=None, bi=True)

reduce the size of each category’s zone.

It is a blueprint_function() function.

Parameters:
  • blueprint (ndarray[tuple[int, ...], dtype[int64]]) – Array[category, N]

  • category (int) – on which category zone.

  • step (int | tuple[int, int]) – reduce step on y or (x, y)

  • threshold (int | tuple[int, int] | None) – Positive value: extend the zone which size larger than threshold. Negative value: extend the zone which size smaller than threshold. A tuple: extend the zone which size in a range.

  • bi (bool) – both position and negative steps direction

  • self (BlueprintFunctions)

Returns:

a modified blueprint copy.

See:

BlueprintFunctions. reduce()

Return type:

ndarray[tuple[int, …], dtype[int64]]