datastructure_tools.utils.CreateDataStructureNew(path2proj, pipeline, Project, Experiment, sessionName, debug=True, overrule=False)
debug - only print structure dont create pipeline has to contain a dict with keys like 0_raw with a list of folders to create
class datastructure_tools.utils.ElectrodePositionCalculator(atlas_path, target_point=None, insertion_point=None)
Class to calculate the position of the electrode in the brain To get the coronal slice of the brain use get_coronal_slice To claculate points along electrode, target_point and insertion_point are needed
this function return the coronal slice of the point in mm
class abstracting all infos about the session can be reused in functions
Required inputs: DB - handle to DataBaseAccess animal_id -> str animal id in DB, will be checked session_datetime session_note -> str can be not provided project -> str project in DB, will be checked user -> str user in DB, will be checked expName -> str experiment name folder experiment_template -> str experiment_type name will be checked
probably new way to use it:
old way to use it how to use:
#pathcreationSuccess = session.createSession_path() # create Paths on server
#PushSuccess = session.checkInputs() # checks inputs and pushes to DB
#session.weight = float(self.AnimalWeightEdit.text()) #session.weight_note = self.WeightNoteEdit.text() #session.pushWeights()
puts the session to DB with weights, Adds to Animalsheet entry and eLabFTW(both session entry and Animalsheet) use instead of checkInputs adn pushWeights all AnimalSheets fields to be entered should be pass as kwargs to the function eg.g pushSession2DB(housing=”Gruppe”,weiterleben=True .. etc.)
datastructure_tools.utils.add_row_to_animalsheet_df(current_animal_sheet, data_to_add, abbruchgewicht=None)
takes a dataframe of an animal sheet and adds a row to that if abbruchgewicht is none: abbruchgewicht will be 0.8*weight
function for renaming a Session if the animal id was wrongly entered, copies and renames the files as well :param DB: DataBaseAccess instance :param session_id: (str) session_id to be changed :param new_animal: (str) correct animal id
Returns:
datastructure_tools.utils.convert_date_from_animalsheet_back_to_pydate(animal_sheet_date, date_format='%d/%m/%Y')
usage: pydate_obj = convert_date_back_to_pydate(animal_sheet.iloc[0][‘Datum und Wochentag’])
datastructure_tools.utils.create_probe_from_probeinterfacefile(path2file: str) -> (<class 'list'>, <class 'probeinterface.probe.Probe'>)
This creates and add the corresponding probe from a probeinterface_file :param path2file: path 2 json file to be read in spike interface
- Returns: list of dictionaries with electrode properties Probe file for plotting
Given a dictionary key, returns a hash string as UUID :param key: Any python dictionary :type key: dict
Given a dictionary key, returns a hash string as UUID this is better as it sorts nested dict
- Parameters: key (dict) – Any python dictionary
Given multiple potential server directories, return correct root. Search and return one directory that is the parent of the given path. :param root_directories: potential root directories :type root_directories: list
- Returns: root_directory (pathlib.Path object)
- Raises: FileNotFoundError – No valid root directory
given animal_id and a datetime returns abbruchgewicht for this AnimalSheetEntry :param DB: DataBaseAccess instance :param animal_id: str :param weight_date: datetime of the entry in AnimalSheetEntry
- Returns: Abbruchgewicht in g
- Return type: float
given animal_id return a list of abbruchgewichte for each AnimalSheetEntry :param DB: DataBaseAccess instance :param animal_id: str
- Returns: list
JSON serializer for objects not serializable by default json code
datastructure_tools.utils.make_animalsheet_byanimal_id(DB, animal_id: str, savepath: [<class 'str'>, <class 'pathlib.Path'>] = None) → [<class 'pathlib.Path'>, None]
wrapper for the make_animalsheet_whole, without user mapping and signatures :param DB: DataBaseAccess instance :param animal_id: str animal_id :param savepath: optional path 2 save
- Returns: path of the created animal_sheet
removes the WD from the procedure field of the animalsheet entry :param DB: DataBaseAccess instance :param animal_id: str of the animal id :return:
I guess there is an easier way to do this but here we are usage: sorted_animal_sheet = sort_animalsheet_by_date(animal_sheet)
classes to work with Surgery data, injections, implantation, etc. Autor: Artur
this is not finished
does Probe specific modifications plots the probeinterface plot
this is not finished
does Lens specific modifications - the thickness of the lens
enum for fields in Animal in ELN
this class enums the names for the different FieldTypes in eLabFTW
enum Class for the Perfusion Template in ELN
enum for fields for virus in ELN
this class enums the names for the different experiment status in eLabFTW
takes a class and returns list of the attributes of this class :param cls: the class to be checked
Returns: list of attributes
this class enums the names for the different itemStatus in eLabFTW