neurocarto.util.edit.category

neurocarto.util.edit.category.category_mask(self, blueprint, categories=None)

Masking electrode belong to the categories.

It is a blueprint_function() function.

Parameters:
  • blueprint (ndarray[tuple[int, ...], dtype[int64]])

  • categories (int | list[int] | None) – If not given, use all categories except CATE_UNSET and CATE_EXCLUDED.

  • self (BlueprintFunctions)

Returns:

a blueprint mask.

See:

BlueprintFunctions. mask()

Return type:

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

neurocarto.util.edit.category.invalid(self, blueprint, electrodes, value=None, *, overwrite=False)

Masking or set value on invalid electrodes for electrode in categories.

It is a blueprint_function() function.

Parameters:
  • blueprint (ndarray[tuple[int, ...], dtype[int64]])

  • electrodes (ndarray[tuple[int, ...], dtype[int64]] | ndarray[tuple[int, ...], dtype[bool]]) – electrode index array, masking, or a channelmap (take selected electrodes).

  • categories – only consider electrode categories in list.

  • value (int | None) – set value on invalid electrodes.

  • overwrite (bool) – Does the electrode in categories are included in the mask.

  • self (BlueprintFunctions)

Returns:

a mask if value is omitted. Otherwise, a new blueprint.

See:

BlueprintFunctions. invalid()

Return type:

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

neurocarto.util.edit.category.merge_blueprint(self, blueprint, other)

Merge two blueprints. The latter blueprint won’t overwrite the former result.

merge(blueprint) works like set_blueprint(ret := merge(blueprint(), blueprint)); ret.

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

  • other (ndarray[tuple[int, ...], dtype[int64]] | BlueprintFunctions) – blueprint Array[category, N]

  • self (BlueprintFunctions)

Returns:

blueprint Array[category, N]

Raises:
  • RuntimeError – when only one argument is given and the probe is missing.

  • ValueError – incorrect length

See:

BlueprintFunctions. merge()

Return type:

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