data_io

Contents

listdir [#15]

Check the source code online

def listdir(fld):

  docstring:

List the files into a folder with the coplete file path instead of the
relative file path like os.listdir.
:param fld: string, folder path

get_subdirs [#28]

Check the source code online

def get_subdirs(folderpath):

  docstring:

Returns the subfolders in a given folder

check_file_exists [#35]

Check the source code online

def check_file_exists(filepath, raise_error=False):

  docstring:

no docstring

get_file_name [#45]

Check the source code online

def get_file_name(filepath):

  docstring:

no docstring

load_npy_from_gz [#51]

Check the source code online

def load_npy_from_gz(filepath):

  docstring:

no docstring

save_npy_to_gz [#56]

Check the source code online

def save_npy_to_gz(filepath, data):

  docstring:

no docstring

save_json [#62]

Check the source code online

def save_json(filepath, content, append=False):

  docstring:

Saves content to a JSON file
:param filepath: path to a file (must include .json)
:param content: dictionary of stuff to save

save_yaml [#81]

Check the source code online

def save_yaml(filepath, content, append=False, topcomment=None):

  docstring:

Saves content to a yaml file
:param filepath: path to a file (must include .yaml)
:param content: dictionary of stuff to save

load_json [#103]

Check the source code online

def load_json(filepath):

  docstring:

Load a JSON file
:param filepath: path to a file

load_yaml [#117]

Check the source code online

def load_yaml(filepath):

  docstring:

Load a YAML file
:param filepath: path to yaml file

load_volume_file [#131]

Check the source code online

def load_volume_file(filepath):

  docstring:

Load a volume file (e.g., .nii) and returns the data
:param filepath: path to file
:param **kwargs:

load_mesh_from_file [#149]

Check the source code online

def load_mesh_from_file(filepath, *args, **kwargs):

  docstring:

Load a a mesh or volume from files like .obj, .stl, ...
:param filepath: path to file
:param **kwargs:

connected_to_internet [#180]

Check the source code online

def connected_to_internet(url='http://www.google.com/', timeout=5):

  docstring:

Check that there is an internet connection
:param url: url to use for testing (Default value =
'http://www.google.com/')
:param timeout: timeout to wait for [in seconds] (Default value = 5)

send_query [#196]

Check the source code online

def send_query(query_string, clean=False):

  docstring:

Send a query/request to a website
:param query_string: string with query content
:param clean: (Default value = False)

get_probe_points_from_sharptrack [#215]

Check the source code online

def get_probe_points_from_sharptrack(points_filepath,
scale_factor=10):

  docstring:

Loads the location of the of probe points as extracted by SharpTrack
[https://github.com/cortex-lab/allenCCF].
:param points_filepath: str, path to a .mat file with probe points
:param scale_factor: 10, sharptrack uses a 10um reference atlas so the
coordinates need to be scaled to match brainrender's