Skip to content

v1.4.0 - Major bug fixes, HEMG double-tail support, and code refactoring

Choose a tag to compare

@ratchanonth60 ratchanonth60 released this 09 Feb 06:45
· 45 commits to main since this release

πŸ› Bug Fixes (10 items)

  • Fix LoadMeanFromFile using wrong path β†’ now uses GetDailyOutputDirectory()
  • Fix ApplyThresholding using RMS instead of mean-centered std dev
  • Fix ProcessData not checking SelectedMode for file-based mean loading
  • Fix histogram range hardcoded to 0-16383 even after baseline subtraction
  • Fix nullable warnings (CS8618/CS8622) on RequestPlotUpdate and _cts
  • Fix HEMG erfc formula errors in both left and right tails β†’ (Οƒ/Ο„ βˆ’ Ξ”x/Οƒ) / √2
  • Fix HEMG tau parameters not scaled to sigma units (caused exp overflow)
  • Fix HEMG fitCurve length mismatch with caller's binCenters
  • Fix ChannelViewModel stats annotation using wrong coordinate system
  • Fix FitCurve/BinCenters length guard missing

✨ New Features

  • Hyper-EMG double tail β€” added as 3rd fit method option (Gaussian / Single / Double)
  • Adaptive gradient descent β€” new optimizer with line search + central difference
  • Fit window Β±5Οƒ β€” fit only bins near peak for better speed & stability

♻️ Refactoring

  • Extract 5 shared helpers: GetLayerSelector, ExtractChannelData, ApplyBaselineSubtraction, BuildHistogram, CalculateMean
  • Remove duplicated code: layerSelector (4β†’1), baseline (2β†’1), histogram (2β†’1)
  • Remove unused AccordFittingService.cs + Accord.Math/Accord.Statistics NuGet packages
  • Remove dead code: InterpolateFitCurve, PerformFit, createMarkerShape
  • Remove empty folders: Infrastructure/, Presentation/
  • RefreshChannelPlots() reduced from ~70 β†’ ~25 lines
  • ProcessData Parallel.For body reduced from ~70 β†’ ~25 lines
  • Net -38 lines (324 added, 362 removed)

πŸ“Š Build

βœ… 0 errors, 0 warnings