Tags: NeilwBailey/RELAX
Tags
Added minor functionality and fixed 2 minor errors Updated the Wrappers to ensure PREP folders are found (even if the latest version of EEGLAB is used, which seems to cause an issue). Fixed a dimension selection issue when determining if PREP rejected too many electrodes in the metrics section of the Wrappers (thank you to Tyson Perez for noting this). Added an option in RELAX_beta to downsample the data prior to cleaning (but after low pass filtering). Fixed an issue with blink amplitude ratio metric, where it was being calculated as if the sampling rate was always 1000Hz. Now BAR is calculated based on the file specific sample rate.
A few minor fixes and options added to increase compatibility with a … …wider range of data RELAX_blinks_IQR_method - v1.1.3 update, removed an erroneous "- 1" after size(BlinkRunIndex,2), thankyou Mana Biabani for the update - continuousEEG.RELAX.IQRmethodDetectedBlinks=0; % v1.1.3 update, so later functions do not search for blinks that aren't marked, if the blink was only present right on the edge of the file. Thankyou Mana Biabani for the update - NWB adjusted NonBlinkChannelList variable coding to allow flexibility in the case of strings referring to electrode names - added an "if ~isempty(ix_blinkstart" statement to allow the script to continue even if no blinks are detected - added option to low pass filter at 6Hz before attempting to detect blinks (this helps in a small minority of cases where very large alpha oscillations are present) RELAX_excluding_channels_and_epoching - epochedEEG.RELAXProcessing.Details.NumberOfMuscleContaminatedChannelsRecomendedToDelete=0; % v1.1.3 update, so later lines can still use this variable even if the following loop isn't engaged. Thankyou Mana Biabani for the update - epochedEEG.RELAXProcessing.Details.CumulativeMethodsRejectChannels(AmplitudeShiftWithinEachEpoch(:,:,epoch)<ShiftLowerBound(:,1),epoch)=1; % v1.1.3 update - flatline epochs weren't being added to the cumulative bad epoch/electrode detections. They are now added. RELAX_wICA_on_ICLabel_artifacts and RELAX_ICA_subtract - NWB added to allow PICARD-O to be run using default settings RELAX_Wrapper and RELAX_Wrapper_beta - added warning about high sampling rates, with suggestion that data could be downsampled prior to RELAX - added line to detect single file implementation and cut filename accordingly to stop RELAX crashing when trying to save due to whole folder being included twice in save file - added line when adding blink MWF template to MWF cleaning 3 to make sure function doesn't bug when trying to check the blink template variable if it doesn't exist - add in section to ensure SER and ARR are computed even if MWF cleaning isn't performed - moved the savepoint for RELAX_cfg to the start of the script to help with trouble shooting where necessary - added an option to interpolate electrodes back into the data after the data is cleaned RELAX_RegressionBL_Correction - adjusted baseline period selection to select datapoints even if the sampling rate is such that the time in seconds doesn't match exact samples (and warn the user if the datapoint is more than 5ms away from intended). Thanks to Kate Godfrey for the code to fix this issue. RELAX_SET_PARAMETERS_AND_RUN, pop_RELAX, pop_RELAX_beta and RELAX_SET_PARAMETERS_AND_RUN_beta - added check to see if wavelet toolbox and statistics and machine learning toolboxes are installed, and to notify user if they are not
Providing improvements as beta options, fixing minor bug in epoching … …script for muscle rejection limits and RELAX_wrapper that occurs when no blinks are present Added RELAX_SET_PARAMETERS_AND_RUN_beta.m and RELAX_Wrapper_beta.m: - Ability to use zapline plus instead of just a butterworth notch filter - add ability to exclude low pass filter from before MWF cleaning and apply it just before wICA cleaning (this addresses the rank deficiency issue when using MWF cleaning, allowing delay periods of up to ~30 to be used for MWF cleaning, depending on processing power). - added the potential to use butterworth or EEGLAB filter (EEGLAB filter doesn't create rank deficiency issues when low pass filtering isn't applied before MWF cleaning). Minor fix of the following in RELAX_Rejecting_muscle_epochs script: Changed MaxProportionOfDataCanBeMarkedAsMuscle to MaxProportionOfMuscleEpochsToClean which ensures the user to modulate the proportion of epochs marked as muscle to delete [previously this didn't work as there was a mismatch between the variable used in the wrapper scripts and the RELAX_Rejecting_muscle_epochs scripts]. Minor fix of the following in RELAX_Wrapper.m: Line 399: EEG.RELAX=rmfield(EEG.RELAX,'eyeblinkmask'); Add isfield check to rmfield only if 'eyeblinkmask' exists: if isfield(EEG.RELAX, 'eyeblinkmask') EEG.RELAX=rmfield(EEG.RELAX,'eyeblinkmask'); end Similarly for line 533: EEG.RELAX_issues_to_check.NoBlinksDetected=(EEG.RELAX.IQRmethodDetectedBlinks==0); Add isfield check to create NoBlinksDetected only if 'IQRmethodDetectedBlinks ‘' exists: if isfield(EEG.RELAX, 'IQRmethodDetectedBlinks') EEG.RELAX_issues_to_check.NoBlinksDetected=(EEG.RELAX.IQRmethodDetectedBlinks==0); end Since neither 'eyeblinkmask' nor 'IQRmethodDetectedBlinks' were being created if ‘RELAX_cfg.ProbabilityDataHasNoBlinks=2;’