""" Filename: shareddata.py Description: Shared constants and methods for FLARES Author: Tyler de Zeeuw License: GPL-3.0 """ import sys import os import platform CURRENT_VERSION = "1.5.0" APP_NAME = "flares" API_URL = f"https://git.research.dezeeuw.ca/api/v1/repos/tyler/{APP_NAME}/releases" API_URL_SECONDARY = f"https://git.research2.dezeeuw.ca/api/v1/repos/tyler/{APP_NAME}/releases" PLATFORM_NAME = platform.system().lower() CHANGELOG_URL = "https://git.research.dezeeuw.ca/tyler/flares/raw/branch/main/changelog_major.md" WIKI_URL = "https://git.research.dezeeuw.ca/tyler/flares/wiki" PIPELINE_STAGES = [ "Preprocessing", "Trimming", "Verify Optode Placement", "Short/Long Channels", "Heart Rate", "Scalp Coupling Index", "Signal to Noise Ratio", "Peak Spectral Power", "Cross Validation", "Median Absolute Deviation", "Power Spectral Density Noise", "Channel Variance", "Bad Channels Handling", "Optical Density", "Temporal Derivative Distribution Repair Filtering", "Wavelet Filtering", "Haemoglobin Concentration", "Enhance Negative Correlation", "Filter", "Extracting Events", "Epoch Calculations", "Design Matrix", "General Linear Model", "Generate GLM Results", "Generate Channel Significance", "Generate Channel, Region of Interest, and Contrast Results", "Compute Contrast Results", "Finishing Up" ] def resource_path(relative_path): """ Get absolute path to resource regardless of running directly or packaged using PyInstaller """ if hasattr(sys, '_MEIPASS'): # PyInstaller bundle path base_path = sys._MEIPASS else: base_path = os.path.dirname(os.path.abspath(__file__)) return os.path.join(base_path, relative_path)