The GUI module provides the graphical user interface components for BciPy, enabling users to interact with the BCI system through a user-friendly interface. This module is essential for running experiments, managing parameters, and controlling the BCI workflow.
The GUI module consists of several key components:
-
Main Interface (
BCInterface.py)- Primary interface for running BCI experiments
- User management and experiment selection
- Parameter configuration and task execution
- Offline analysis capabilities
-
Base UI Components (
bciui.py)- Core UI building blocks and utilities
- Common functionality for all BciPy interfaces
- Layout management and styling
- Dynamic list and item management
-
Experiment Management
ExperimentRegistry.py: Interface for registering and managing experimentsExperimentField.py: Form for collecting experiment-specific data- Field management and validation
-
Alert System (
alert.py)- User notifications and confirmations
- Error handling and system messages
-
Task Transitions (
intertask_gui.py)- Progress tracking between tasks
- Experiment flow control
- User feedback during transitions
To start the BciPy GUI:
python bcipy/gui/BCInterface.pyOr using Make (if installed):
make bci-gui-
User Management
- Enter or select a user ID
- User IDs must be alphanumeric and meet length requirements
-
Experiment Selection
- Choose between running a specific task or a complete experiment
- Tasks are individual BCI operations (e.g., calibration)
- Experiments are predefined sequences of tasks
-
Parameter Configuration
- Load existing parameter files
- Edit parameters through the parameter editor
- Save custom configurations
-
Task Execution
- Start sessions with selected configurations
- Monitor progress through the intertask interface
- View results and system feedback
-
Signal Viewer
- Monitor real-time EEG signals during experiments
- View and analyze recorded data from previous sessions
- Toggle channel visibility and apply montages
- Control display duration and filtering options
- Pause/resume signal visualization
- Support for multiple monitor configurations
- See Signal Viewer Documentation for more details
- Create and manage experiment protocols
- Define task sequences and parameters
- Configure experiment-specific fields
- Save and load experiment configurations
- Load default or custom parameter files
- Edit parameters through a user-friendly interface
- Save parameter configurations
- Validate parameter settings
- Start and stop BCI tasks
- Monitor task progress
- Handle transitions between tasks
- Manage experiment flow
- Clean, intuitive design
- Consistent styling across components
- Responsive feedback
- Error handling and notifications
When extending the GUI:
- Inherit from
BCIUIfor new interfaces - Use the provided UI utilities and components
- Follow the established styling guidelines
- Implement proper error handling
- Add appropriate documentation
The GUI uses a consistent styling system:
- CSS-based styling through
bcipy_stylesheet.css - Common UI elements and layouts
- Responsive design principles
- Accessibility considerations
-
Error Handling
- Use the alert system for user notifications
- Validate inputs before processing
- Provide clear error messages
- Handle edge cases gracefully
-
User Experience
- Maintain consistent interface behavior
- Provide clear feedback for actions
- Use appropriate timeouts and delays
- Implement proper state management
-
Performance
- Minimize UI blocking operations
- Use appropriate threading for long operations
- Optimize resource usage
- Handle cleanup properly
Common issues and solutions:
-
GUI Not Starting
- Check Python and dependency versions
- Verify file permissions
- Check for conflicting processes
-
Parameter Issues
- Validate parameter file format
- Check file paths and permissions
- Verify parameter values
-
Task Execution Problems
- Check system requirements
- Verify device connections
- Review error logs