neurocarto.probe_npx.io

neurocarto.probe_npx.io.parse_imro(source)

Parse imro table.

Parameters:

source (str) – an imro table.

Returns:

See:

ChannelMap. parse()

Return type:

ChannelMap

neurocarto.probe_npx.io.string_imro(chmap)

format as imro table :see: ChannelMap. to_imro()

Parameters:

chmap (ChannelMap)

Return type:

str

neurocarto.probe_npx.io.load_meta(path)

Read imro table from SpikeGLX meta file.

Parameters:

path (str | Path) – file path

Returns:

See:

ChannelMap. from_meta()

Return type:

ChannelMap

neurocarto.probe_npx.io.load_imro(path)

Read imro file.

Parameters:

path (str | Path) – file path

Returns:

See:

ChannelMap. from_imro()

Return type:

ChannelMap

neurocarto.probe_npx.io.save_imro(chmap, path)

save into imro file :see: ChannelMap. save_imro()

Parameters:
neurocarto.probe_npx.io.from_probe(probe)

From probeinterface.Probe

Note

The package probeinterface is optional dependency.

Parameters:

probe (Probe)

Returns:

See:

ChannelMap. from_probe()

Return type:

ChannelMap

neurocarto.probe_npx.io.to_numpy(chmap, unit='cr')

To a numpy array. Empty channels are skipped.

The layout of returned array is depending on the unit

  • cr: column and row, return Array[int, N, (S, C, R)]

  • xy: x and y position, return Array[um:int, N, (X, Y)]

  • sxy: x and y position with shank, return Array[int, N, (S, X, Y)]

Parameters:
  • unit (Literal['cr', 'xy', 'sxy']) – electrode ordering kind

  • chmap (ChannelMap)

Returns:

See:

ChannelMap. to_numpy()

Return type:

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

neurocarto.probe_npx.io.to_probe(chmap)

to probeinterface.Probe

Note

The package probeinterface is optional dependency.

Returns:

See:

ChannelMap. to_probe()

Parameters:

chmap (ChannelMap)

Return type:

Probe

neurocarto.probe_npx.io.to_pandas(chmap)

To a pandas dataframe.

Use -1 to fill empty channels.

         shank  column  row  in_used    x     y
channel
0           -1      -1   -1    False   -1    -1
1            1       1  144     True  282  2160
...        ...     ...  ...      ...  ...   ...

Note

The package pandas is optional dependency.

Returns:

a pandas dataframe

See:

ChannelMap. to_pandas()

Parameters:

chmap (ChannelMap)

Return type:

pd.DataFrame

neurocarto.probe_npx.io.to_polars(chmap)

To a polars dataframe.

Use null to fill empty channels.

┌─────────┬───────┬────────┬──────┬─────────┬──────┬──────┐
│ channel ┆ shank ┆ column ┆ row  ┆ in_used ┆ x    ┆ y    │
│ i64     ┆ i64?  ┆ i64?   ┆ i64? ┆ bool    ┆ i64? ┆ i64? │
╞═════════╪═══════╪════════╪══════╪═════════╪══════╪══════╡
│ 0       ┆ null  ┆ null   ┆ null ┆ false   ┆ null ┆ null │
│ 1       ┆ 1     ┆ 1      ┆ 144  ┆ true    ┆ 282  ┆ 2160 │
└─────────┴───────┴────────┴──────┴─────────┴──────┴──────┘

Note

The package polars is optional dependency.

Returns:

a polars dataframe

See:

ChannelMap. to_polars()

Parameters:

chmap (ChannelMap)

Return type:

pl.DataFrame