data_io

Contents

listdir [#15]

Check the source code online
1
def listdir(fld):
Copied!
  docstring:
1
List the files into a folder with the coplete file path instead of the
2
relative file path like os.listdir.
3
4
:param fld: string, folder path
Copied!

get_subdirs [#28]

Check the source code online
1
def get_subdirs(folderpath):
Copied!
  docstring:
1
Returns the subfolders in a given folder
Copied!

check_file_exists [#35]

Check the source code online
1
def check_file_exists(filepath, raise_error=False):
Copied!
  docstring:
no docstring

get_file_name [#45]

Check the source code online
1
def get_file_name(filepath):
Copied!
  docstring:
no docstring

load_npy_from_gz [#51]

Check the source code online
1
def load_npy_from_gz(filepath):
Copied!
  docstring:
no docstring

save_npy_to_gz [#56]

Check the source code online
1
def save_npy_to_gz(filepath, data):
Copied!
  docstring:
no docstring

save_json [#62]

Check the source code online
1
def save_json(filepath, content, append=False):
Copied!
  docstring:
1
Saves content to a JSON file
2
3
:param filepath: path to a file (must include .json)
4
5
:param content: dictionary of stuff to save
Copied!

save_yaml [#81]

Check the source code online
1
def save_yaml(filepath, content, append=False, topcomment=None):
Copied!
  docstring:
1
Saves content to a yaml file
2
3
:param filepath: path to a file (must include .yaml)
4
5
:param content: dictionary of stuff to save
Copied!

load_json [#103]

Check the source code online
1
def load_json(filepath):
Copied!
  docstring:
1
Load a JSON file
2
3
:param filepath: path to a file
Copied!

load_yaml [#117]

Check the source code online
1
def load_yaml(filepath):
Copied!
  docstring:
1
Load a YAML file
2
3
:param filepath: path to yaml file
Copied!

load_volume_file [#131]

Check the source code online
1
def load_volume_file(filepath):
Copied!
  docstring:
1
Load a volume file (e.g., .nii) and returns the data
2
3
:param filepath: path to file
4
5
:param **kwargs:
Copied!

load_mesh_from_file [#149]

Check the source code online
1
def load_mesh_from_file(filepath, *args, **kwargs):
Copied!
  docstring:
1
Load a a mesh or volume from files like .obj, .stl, ...
2
3
:param filepath: path to file
4
5
:param **kwargs:
Copied!

connected_to_internet [#180]

Check the source code online
1
def connected_to_internet(url='http://www.google.com/', timeout=5):
Copied!
  docstring:
1
Check that there is an internet connection
2
3
:param url: url to use for testing (Default value =
4
'http://www.google.com/')
5
6
:param timeout: timeout to wait for [in seconds] (Default value = 5)
Copied!

send_query [#196]

Check the source code online
1
def send_query(query_string, clean=False):
Copied!
  docstring:
1
Send a query/request to a website
2
3
:param query_string: string with query content
4
5
:param clean: (Default value = False)
Copied!

get_probe_points_from_sharptrack [#215]

Check the source code online
1
def get_probe_points_from_sharptrack(points_filepath,
2
scale_factor=10):
Copied!
  docstring:
1
Loads the location of the of probe points as extracted by SharpTrack
2
3
[https://github.com/cortex-lab/allenCCF].
4
5
:param points_filepath: str, path to a .mat file with probe points
6
7
:param scale_factor: 10, sharptrack uses a 10um reference atlas so the
8
9
coordinates need to be scaled to match brainrender's
Copied!
Last modified 1yr ago