neuralib.io.dataset

neuralib.io.dataset.google_drive_file(file_id, *, quiet=True, output_dir=None, rename_file=None, cached=False, invalid_cache=False)[source]

Download file from Google Drive. If not cached, then delete afterward.

Parameters:
  • file_id (str) – Google Drive file ID used to identify the file to be downloaded.

  • quiet (bool) – Boolean flag to suppress output from the download process.

  • output_dir (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None) – Directory path where the downloaded file will be saved.

  • rename_file (str | None) – Optional string to rename the downloaded file.

  • cached (bool) – Boolean flag to retain the downloaded file after usage.

  • invalid_cache (bool) – Boolean flag to force re-download even if the file exists in the cache.

Returns:

A context manager yielding the path to the downloaded file.

Return type:

ContextManager[Path]

neuralib.io.dataset.google_drive_folder(folder_id, *, quiet=True, output_dir=None, rename_folder=None, cached=False, invalid_cache=False)[source]

Download a entire folder from Google Drive. If not cached, then delete afterward.

Parameters:
  • folder_id (str) – Google Drive folder ID to download.

  • quiet (bool) – If True, suppress the gdown output.

  • output_dir (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader | None) – Directory where the folder should be downloaded. If None, a temporary directory is used.

  • rename_folder (str | None) – Optional new name for the downloaded folder.

  • cached (bool) – If True, keep the downloaded folder for future use.

  • invalid_cache (bool) – If True, force re-download even if cached data exists.

Returns:

A context manager yielding the path to the downloaded folder.

Return type:

ContextManager[Path]

neuralib.io.dataset.load_example_rois(**kwargs)[source]
Parameters:

kwargs – Additional keyword arguments pass to google_drive_file to customize the loading behavior.

Returns:

A Polars DataFrame containing the example ROIs data

Return type:

DataFrame

neuralib.io.dataset.load_example_rois_image(**kwargs)[source]
Parameters:

kwargs – Additional arguments to be passed to the google_drive_file context manager.

Returns:

An example imaging array with labeled ROIs

Return type:

ndarray

neuralib.io.dataset.load_example_dorsal_cortex(color=False, **kwargs)[source]

png file from the source svg

See also

get_dorsal_cortex()

Parameters:

color (bool)

Return type:

ndarray

neuralib.io.dataset.load_ephys_meta(**kwargs)[source]
neuralib.io.dataset.load_ephys_data(**kwargs)[source]
neuralib.io.dataset.load_npx2_reconstruction(**kwargs)[source]

Example of NeuroPixel2 reconstruction data

Parameters:

kwargs – Additional keyword arguments pass to google_drive_file to customize the loading behavior.

Returns:

A Polars DataFrame containing the example DiI labelled traces ROIs

Return type:

DataFrame

neuralib.io.dataset.load_example_scanbox(**kwargs)[source]
Parameters:

kwargs – Additional keyword arguments pass to google_drive_file to customize the loading behavior.

Returns:

An instance of SBXInfo loaded from the specified Google Drive file.

Return type:

SBXInfo

neuralib.io.dataset.load_example_suite2p(**kwargs)[source]
Parameters:

kwargs – Additional keyword arguments pass to google_drive_folder to customize the loading behavior.

Returns:

An instance of Suite2PResult loaded with data from the specified Google Drive folder.

Return type:

Suite2PResult

neuralib.io.dataset.load_example_rastermap_2p(**kwargs)[source]
Parameters:

kwargs – Additional arguments to be passed to the google_drive_file context manager.

Returns:

A dictionary containing the 2-photon rastermap data cache

Return type:

dict[str, Any]

neuralib.io.dataset.load_example_rastermap_wfield(**kwargs)[source]
Parameters:

kwargs – Additional arguments to be passed to the google_drive_file context manager.

Returns:

A dictionary containing the wide-field rastermap data cache

Return type:

dict[str, Any]

neuralib.io.dataset.load_example_dlc_h5(**kwargs)[source]
Return type:

DeepLabCutResult

neuralib.io.dataset.load_example_dlc_csv(**kwargs)[source]
Return type:

DeepLabCutResult