meganorm.layouts package
Submodules
meganorm.layouts.layouts module
- meganorm.layouts.layouts.add_specific_layout(output_format, layout, layout_data)[source]
Function to add a specific sensor layout to a JSON file
- Parameters:
output_format (str) – Extension of the ‘s output (used as filename)
layout (str) – Name of the layout to add or update.
layout_data (dict) – Dictionary containing the layout configuration
- Returns:
Prints the path to the updated JSON file.
- Return type:
str
- meganorm.layouts.layouts.create_layouts(modality, output_format)[source]
Function that creates predefined sensor layouts for a given modality and output format. This includes both whole-brain sensor configurations and for some formats also region-specific layouts (e.g., frontal, temporal, parietal, occipital).
- Parameters:
modality (str) – Type of recording modality (e.g., “MEG”, “EEG”).
output_format (str) – Specific devic’s output type or file format (e.g., “FIF”, “DS”, “SET”, “VHDR”).
- Returns:
Path to the saved layout file if created, otherwise None.
- Return type:
str or None
- meganorm.layouts.layouts.get_relative_path(filename)[source]
Function to get the path relative to the .py file
- Parameters:
filename (str) – Name of the file
- Returns:
Full path to the JSON file
- Return type:
str
- meganorm.layouts.layouts.load_specific_layout(output_format, layout)[source]
Function to load a specific sensor layout from a JSON file
- Parameters:
output_format (str) – Extension of the device’s output (used as filename)
layout (str) – Name of the layout to retrieve.
- Returns:
The layout data if found, otherwise None.
- Return type:
dict or None
- meganorm.layouts.layouts.save_sensor_layouts(layout, filename)[source]
Function to save the sensor layouts to a JSON file
- Parameters:
layout (dict) – Dictionary containing the sensor layout information
filename (str) –
Name of the JSON file
Returns
-------
str – Prints the path to the saved JSON file.