convnwb.objects.electrodes.Electrodes

class convnwb.objects.electrodes.Electrodes(subject=None, fs=None)[source]

Object for collecting / managing electrode information.

Attributes:
subjectstr

Subject label.

fsint

Sampling rate.

bundleslist of Bundle

Names of the bundles.

__init__(subject=None, fs=None)[source]

Initialize Electrodes object.

Methods

__init__([subject, fs])

Initialize Electrodes object.

add_bundle(probe[, hemisphere, lobe, ...])

Add a bundle to the object.

add_bundles(bundles)

Add multiple bundles to the object.

copy()

Return a deepcopy of this object.

get(field)

Get the values for a specified field from across all bundles.

to_csv(file_name[, folder])

Save out the electrode information as a CSV file.

to_dataframe()

Return object data as a dataframe.

to_dict([drop_empty])

Convert object data to a dictionary.

Attributes

bundle_properties

Access bundle property labels.

n_bundles

The number of bundles stored in the object.

n_electrodes_per_bundle

add_bundle(probe, hemisphere=None, lobe=None, region=None, subregion=None, channels=None)[source]

Add a bundle to the object.

Parameters:
probeBundle or str

Name of the bundle, if string, or pre-initialized Bundle object.

hemisphere{‘left’, ‘right’}, optional

The hemisphere the probe is implanted in.

lobe{‘frontal’, ‘parietal’, ‘temporal’, ‘occipital’}, optional

Which lobe the probe is in.

regionstr, optional

Location of the bundle.

subregionstr, optional

The subregion specifier of the probe.

channelslist of int, optional

A set of channel indices for the bundle.

add_bundles(bundles)[source]

Add multiple bundles to the object.

Parameters:
namesBundle or list of dict

Names of the bundles.

property bundle_properties

Access bundle property labels.

copy()[source]

Return a deepcopy of this object.

get(field)[source]

Get the values for a specified field from across all bundles.

Parameters:
field{‘probe’, ‘hemisphere’, ‘lobe’, ‘region’, ‘subregion’, ‘channels’}

Which field to get the values for.

Returns:
list

Values for the specified field from across all defined bundles.

property n_bundles

The number of bundles stored in the object.

to_csv(file_name, folder=None, **kwargs)[source]

Save out the electrode information as a CSV file.

Parameters:
file_namestr

The file name to save.

folderstr

The folder to save the file to.

**kwargs

Additional keyword arguments to pass to pd.DataFrame.to_csv().

to_dataframe()[source]

Return object data as a dataframe.

to_dict(drop_empty=True)[source]

Convert object data to a dictionary.

Parameters:
drop_emptybool, optional, default: True

Whether to drops fields that are all None.