Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prasad #12

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ae53e08
with database fxn
Jan 31, 2021
ed2fd11
added overall processing script and new final DATABASE script
Feb 1, 2021
6e492b2
updated makeDataBaseRCSdata.m to work fully
Feb 1, 2021
1dcbc82
moved to code/
Feb 1, 2021
fe0e8d5
feb4 , more CL analysis
Feb 4, 2021
06c8bf5
Merge branch 'master' into prasad
Feb 5, 2021
79813f3
updated for CL analysis
Feb 18, 2021
17368b2
updated database to sort by session name
Feb 18, 2021
9f8ccf8
updated database and added ssh toolbox
Feb 18, 2021
5086b6c
again
Feb 18, 2021
ec90381
Update RCS_CL_2021.m
Feb 18, 2021
20946ed
moved CL and updated make Datbase
Feb 21, 2021
d7f0a6f
Merge branch 'master' into prasad
Feb 26, 2021
d335541
personal LDA and plotter updated
Apr 8, 2021
295cd3d
Merge branch 'master' into prasad
Apr 8, 2021
65414fd
Merge branch 'master' into prasad
Jul 13, 2021
1c172f7
Update RCS CL 2021
Jul 13, 2021
c4e00fc
pia direct DL files added
pshirvalkar Jul 27, 2021
4c9ac47
Merge branch 'master' into prasad
pshirvalkar Jul 27, 2021
d9e0eb6
i cloud files removed
pshirvalkar Jul 28, 2021
47531c9
icloud files removed
pshirvalkar Jul 28, 2021
66ad29e
updated folder struct
pshirvalkar Jul 28, 2021
17ec04b
updated database to work blazing fast
pshirvalkar Aug 4, 2021
9a7e5df
updated textlog processing and plotting
pshirvalkar Sep 17, 2021
eec2765
updated 9/28
pshirvalkar Sep 28, 2021
89468dd
9/30 updates
pshirvalkar Oct 1, 2021
7be17e9
general update on.RCS databasing ---
pshirvalkar Dec 21, 2021
d504e2b
working makedatabaseRCSdata !
pshirvalkar Dec 21, 2021
2e658b0
updated makeDatabaseRCSdata.m to work properly with 'ignoreold'
pshirvalkar Mar 29, 2022
f6b412d
changed. file folder makedatabase
pshirvalkar Jun 10, 2022
d3f0c9a
edits to make database etc.
pshirvalkar Jun 16, 2022
290d4e6
added new cycling on/off and fftchan and cleaned up vars in makedatab…
pshirvalkar Jul 26, 2022
1971cf5
Merge branch 'master' into prasad
pshirvalkar Oct 19, 2022
dcb4341
updated RCS plotter and subfunctions of makeDatabaseRCS
pshirvalkar Oct 22, 2022
d2a72e3
edited text log compilling
pshirvalkar Dec 20, 2022
ff7879a
updated adaptive text log changes. and database compilation
pshirvalkar Jan 5, 2023
c5e2751
Updated to collect the CL sessions, so they can be indiividually plotted
pshirvalkar Jan 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion code/addNewEntry_FFTSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
% FFT_SettingsTable; ensures that all table fields are filled for each
% entry (otherwise warning will print)
%

%%
HostUnixTime = currentSettings.RecordInfo.HostUnixTime;

Expand All @@ -14,7 +15,8 @@
% Get fftConfig info if updated
if isfield(currentSettings,'SensingConfig') && isfield(currentSettings.SensingConfig,'fftConfig')
fftConfig = convertFFTCodes(currentSettings.SensingConfig.fftConfig);
end
end

newEntry.fftConfig = fftConfig;

% Get sample rate for each TD channel; all TD channels have
Expand Down
9 changes: 9 additions & 0 deletions code/createDeviceSettingsTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
% Output: TD_SettingsOut, Power_SettingsOut, FFT_SettingsOut, metaData
%
% Requires convertTDcodes.m
%
%
% Updated 7/24/22 by Prasad, to add fftStreamChannel to metaData
%%
% Load in DeviceSettings.json file
DeviceSettings = deserializeJSON([folderPath filesep 'DeviceSettings.json']);
Expand All @@ -22,8 +25,11 @@
DeviceSettings = {DeviceSettings};
end
%%

% Convert metaData variables into human readable
if isfield(DeviceSettings{1},'SubjectInfo') %add by Prasad Oct 8 2021 due to some file errors
metaData = convertMetadataCodes(DeviceSettings{1}.SubjectInfo);
end

% UTC offset to determine timezone conversion
metaData.UTCoffset = DeviceSettings{1,1}.UtcOffset;
Expand Down Expand Up @@ -142,6 +148,7 @@
actionType = sprintf('Start Stream FFT %d',streamStartCounter_FFT);
recNum = streamStartCounter_FFT;
[newEntry,fftConfig] = addNewEntry_FFTSettings(actionType,recNum,currentSettings,TDsettings,fftConfig);

FFT_SettingsTable = addRowToTable(newEntry,FFT_SettingsTable);

streamStartCounter_FFT = streamStartCounter_FFT + 1;
Expand Down Expand Up @@ -241,6 +248,8 @@
% documentation enum Medtronic.NeuroStim.Olympus.DataTypes.Sensing.SenseStates : byte
% for more details about binary number coding

metaData.fftstreamChan = currentSettings.SenseState.fftStreamChannel; %added by Prasad

% Same code for all streams to indicate sense off
if str2double(senseState) == 0 % streaming off
% Create new row in deviceSettingsTable and populate with metadata
Expand Down
30 changes: 27 additions & 3 deletions code/createStimSettingsFromDeviceSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
%
% Output: stimSettingsOut table, stimMetaData containing info about
% groups/programs which were active and which contacts were used for stim
%
%
% Updated 7/24/22 - Prasad added cycling on/ off duration outut in stimSettingsOut for Active Group
%%
stimSettingsOut = table();

Expand Down Expand Up @@ -84,8 +85,9 @@
%%
% Set up output table (stimSettingsOut) with initial settings
entryNumber = 1;
activegroupnum = currentSettings.GeneralData.therapyStatusData.activeGroup;

switch currentSettings.GeneralData.therapyStatusData.activeGroup
switch activegroupnum
case 0
activeGroup = 'A';
case 1
Expand All @@ -102,6 +104,14 @@
stimSettingsOut.therapyStatus(entryNumber) = therapyStatus;
stimSettingsOut.therapyStatusDescription{entryNumber} = convertTherapyStatus(therapyStatus);

% Collect the cycling stim info (units 0,1,2 = 0.1s, 1s , 10s, so need to add +1 to index units from 1-3)
cycleunits = [0.1,1,10];
OnUnits = currentSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOnTime.units + 1;
OffUnits = currentSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOffTime.units + 1;
stimSettingsOut.cycleOnSec(entryNumber) = currentSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOnTime.time * cycleunits(OnUnits);
stimSettingsOut.cycleOffSec(entryNumber) = currentSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOffTime.time * cycleunits(OffUnits);

previousSettings = currentSettings;
previousActiveGroup = activeGroup;
previousTherapyStatus = therapyStatus;
%%
Expand All @@ -116,7 +126,9 @@
% Check if activeGroup has changed
if isfield(currentSettings,'GeneralData') && isfield(currentSettings.GeneralData, 'therapyStatusData') &&...
isfield(currentSettings.GeneralData.therapyStatusData, 'activeGroup')
switch currentSettings.GeneralData.therapyStatusData.activeGroup
activegroupnum = currentSettings.GeneralData.therapyStatusData.activeGroup;

switch activegroupnum
case 0
activeGroup = 'A';
case 1
Expand All @@ -129,13 +141,22 @@
if ~isequal(activeGroup,previousActiveGroup)
updateActiveGroup = 1;
end


% Collect the cycling stim info (units 0,1,2 = 0.1s, 1s , 10s, so need to add +1 to index units from 1-3)
OnUnits = previousSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOnTime.units + 1;
OffUnits = previousSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOffTime.units + 1;
cycleOn_new = previousSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOnTime.time * cycleunits(OnUnits);
cycleOff_new = previousSettings.(['TherapyConfigGroup' num2str(activegroupnum)]).cycleOffTime.time * cycleunits(OffUnits);

end

% Check if therapyStatus has changed (turned on/off)
if isfield(currentSettings,'GeneralData') && isfield(currentSettings.GeneralData, 'therapyStatusData') &&...
isfield(currentSettings.GeneralData.therapyStatusData, 'therapyStatus')

therapyStatus = currentSettings.GeneralData.therapyStatusData.therapyStatus;

if ~isequal(therapyStatus,previousTherapyStatus)
updateTherapyStatus = 1;
end
Expand All @@ -149,6 +170,9 @@
toAdd.activeGroup = activeGroup;
toAdd.therapyStatus = therapyStatus;
toAdd.therapyStatusDescription = convertTherapyStatus(therapyStatus);
toAdd.cycleOnSec = cycleOn_new;
toAdd.cycleOffSec = cycleOff_new;

stimSettingsOut = [stimSettingsOut; struct2table(toAdd)];

clear toAdd
Expand Down
Loading