annotation package

Submodules

annotation.class_symptome module

This module defines a Symptome class used for instantiating symptom objects.

class annotation.class_symptome.Symptome(ID=None, Name=None, Lateralization=None, Topography=None, Orientation=None, AttributSuppl=None, Tdeb=None, Tfin=None, Comment=None)

Bases: object

A class used to instantiate a Symptome object with all its attributes.

ID

The ID of the symptom.

Type:

str

Name

The name of the symptom.

Type:

str

Lateralization

The lateralization of the symptom.

Type:

str

Topography

The topography of the symptom.

Type:

str

Orientation

The orientation of the symptom.

Type:

str

AttributSuppl

Additional attributes of the symptom.

Type:

str

Tdeb

The start time of the symptom.

Type:

str

Tfin

The end time of the symptom.

Type:

str

Comment

Any additional comments related to the symptom.

Type:

str

get_AttributSuppl()

Returns the additional attributes of the symptom.

get_Comment()
get_ID()

Returns the ID of the symptom.

get_Lateralization()

Returns the lateralization of the symptom.

get_Name()

Returns the name of the symptom.

get_Orientation()

Returns the orientation of the symptom.

get_Tdeb()

Returns the start time of the symptom.

get_Tfin()

Returns the end time of the symptom.

get_Topography()

Returns the topography of the symptom.

get_attributs()

Returns a list containing the values of the object’s attributes.

Returns:

A list containing the values of all attributes.

[ ID, Name, Lateralization, Topography, Orientation, AttributSuppl, Tdeb, Tfin, Comment ]

Return type:

list of str

set_AttributSuppl(new_AttributSuppl)

Sets the additional attributes of the symptom.

set_Comment(new_Comment)

Sets any additional comments related to the symptom.

set_ID(new_ID)

Sets the ID of the symptom.

set_Lateralization(new_Lateralization)

Sets the lateralization of the symptom.

set_Name(new_Name)

Sets the name of the symptom.

set_Orientation(new_Orientation)

Sets the orientation of the symptom.

set_Tdeb(new_Tdeb)

Sets the start time of the symptom.

set_Tfin(new_Tfin)

Sets the end time of the symptom.

set_Topography(new_Topography)

Sets the topography of the symptom.

annotation.pop_up module

This module defines a SymptomeEditor class for editing symptom attributes via a graphical user interface.

class annotation.pop_up.SymptomeEditor(Symp)

Bases: CTkToplevel

SymptomeEditor class for editing symptom attributes via a graphical user interface. Allows editing of symptoms through a window.

Symp

An instance of the Symptome class representing the symptom to be edited.

Type:

Symptome

apply_changes(Symp)

Retrieves the entered values and updates the attributes of the Symp class.

Parameters:

Symp (Symptome) – The Symptome object to be updated.

create_entry(label_text, initial_value, i)

Creates and places text entry fields (entries) on the window.

Parameters:
  • label_text (str) – The label for the entry.

  • initial_value (str) – The current value of the entry.

  • i (int) – The index of the entry row.

annotation.load_symptomes module

Functions for loading symptoms from text files

annotation.load_symptomes.read_symptoms(filename)

Reads a text file containing symptoms and returns a list of Symptome objects.

Parameters:

filename (str) – The path to the text file containing symptoms.

Returns:

A list of Symptome objects.

Return type:

list

annotation.exel_menus module

menus and submenus based on exel file

annotation.exel_menus.Read_excel(file_path)

Reads an Excel file and organizes the data into a hierarchical structure for a graphical interface.

Parameters:

file_path (str) – Path to the Excel file containing the data.

Returns:

A hierarchical dictionary containing organized symptom data.

Return type:

dict

The function reads an Excel file specified by ‘file_path’, processes the data, and organizes it into a hierarchical structure. This structure is designed to facilitate the creation of a graphical interface for displaying and interacting with the symptom data.

The Excel file is expected to have columns named ‘Typologie’, ‘Designation’, ‘Description’, ‘Sub_description’,’Topography’, and ‘Lateralized’.

The data is organized based on the following criteria:
  • There can not be sub sescription without description.

  • If there is no description, no sub_description no topography, but there are lateralizations, they are stored under an empty string.

  • If there is no additional information, a ‘None’ flag is stored.

  • If there is topography and lateralizations but no description, the data is stored based on topography.

  • Otherwise, the detailed information is stored including description, topography, and lateralizations.

Example

>>> Read_excel('ictal_symptoms.xlsx')

Note

The function uses Pandas to read the Excel file and defaultdict to create the hierarchical structure.

annotation.exel_menus.add_submenus(menu, data, full_path, on_select)

Add submenus to the main menu based on the provided data.

This function iterates through the data dictionary to add submenus and menu items to the provided Tkinter menu. It checks for different scenarios in the data structure to determine the appropriate way to add submenus and menu items.

Parameters:
  • menu (tk.Menu) – The menu to which the submenus will be added.

  • data (dict) – The hierarchical data containing submenu information.

  • full_path (str) – The full path to the current menu item.

  • on_select (function) – The function to select the symptom

annotation.exel_menus.build_menu(structure, main_menu, on_select)

Build a cascading menu based on the provided structure.

This function builds a cascading menu using Tkinter based on the hierarchical structure provided. It iterates through the structure to add main menu items, submenus, and menu items. Depending on the data in the structure, it calls the add_submenus function to add appropriate submenus and menu items to the main menu.

Parameters:
  • structure (dict) – The hierarchical structure of the menu.

  • main_menu (tk.Menu) – The main menu to which the cascading menu will be added.

  • on_select (function) – The function to select the symptom

annotation.search_bar

class annotation.search_bar.search_symptomes(root, symptoms_struct, myfunc, width)

Bases: object

A class to create a symptom search bar in the EpiScope GUI.

This class provides a search bar to look for symptoms in a hierarchical dictionary structure and display the matching results in a listbox. It also allows selecting an item from the listbox by clicking on it, triggering a specified function with the selected item as an argument.

symptoms_structure

Hierarchical dictionary containing organized symptom data.

Type:

dict

search_entry

Entry widget for user input.

Type:

CTkEntry

symptom_listbox

Listbox widget to display search results.

Type:

Listbox

search_element(search_term)

Searches for matching elements based on the search term.

get_selected(event, func)

Retrieves the selected item from the listbox.

Updates the listbox based on the search input.

get_selected(event, func)

Retrieves the selected item from the listbox and calls the specified function.

Parameters:
  • event – The event object (not used directly, but required by Tkinter).

  • func (function) – Function to be called with the selected item as an argument.

search_element(search_term)

Searches for elements matching the search term in the ‘Designation’ and ‘Description’ columns.

Parameters:
  • symptoms_structure (dict) – Hierarchical dictionary containing organized symptom data.

  • search_term (str) – Term to search for in ‘Designation’ and ‘Description’ columns.

Returns:

List of matching elements found for the search term.

Return type:

list

This function searches for the specified term in the ‘Designation’ and ‘Description’ columns of the hierarchical structure and returns a list of matching elements.

update_search(event)

Update the displayed symptoms based on the user input in the search bar.

This function filters the symptoms based on the user input in the search bar and updates the listbox to show only the matching symptoms.

Parameters:

event – The event object (not used in this function, but required by Tkinter)