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

Uiux #154

Draft
wants to merge 421 commits into
base: dev
Choose a base branch
from
Draft

Uiux #154

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
421 commits
Select commit Hold shift + click to select a range
364633f
Merge branch 'master' of https://github.com/cortex-lab/Rigbox
k1o0 May 16, 2018
841a722
Update to Alyx: doesn't crash is dat.paths doesn't provice the releva…
k1o0 May 17, 2018
5df2217
Update to Alyx: doesn't crasb when dat.paths doesn't provide the rele…
k1o0 May 17, 2018
1f21c81
Contrast values no longer saved in % when exported to ALF
k1o0 May 17, 2018
dbdd7a5
Fixed 80% expected weight values in viewSubjectHistory table
k1o0 May 18, 2018
eabb884
Rig hardware infor now registered to Alyx
k1o0 May 18, 2018
6ebf03f
AlyxPanel weight button can now records current scales reading
k1o0 May 25, 2018
e849fbf
Merge branch 'master' of https://github.com/cortex-lab/Rigbox
k1o0 May 25, 2018
9020166
change by miles?
nsteinme May 27, 2018
8e96027
Merge branch 'master' of https://github.com/cortex-lab/Rigbox
nsteinme May 27, 2018
a8ee0e4
update vis.checkers, exp.inferParameters
nsteinme May 27, 2018
16d6293
Added string compatibility in param editor
k1o0 May 30, 2018
9adfa18
Merge branch 'master' of https://github.com/cortex-lab/Rigbox
k1o0 May 30, 2018
5d926cd
Updated DiscWorld - fix'd error where flips occured when window wasn'…
k1o0 Jun 28, 2018
16298b5
Updated Alyx and removed some unessesary code from AlyxPanel delete m…
k1o0 Jun 28, 2018
3c940b8
Merge branch 'master' of https://github.com/cortex-lab/Rigbox
k1o0 Jun 28, 2018
6a9764d
experiment may now be halted by experiment definition
k1o0 Aug 3, 2018
bc25fa2
Inputs and parameters now included in update list sent to mc
k1o0 Aug 7, 2018
5b8f899
Noise burst samples now replicated across all channels, based on the
Aug 8, 2018
6f9d2c8
Only a single set of parameters are sent to mc per trial, rather than…
k1o0 Aug 9, 2018
36cae70
Added wheelAnalysis submodule and moved behavioural ALF extraction to…
k1o0 Aug 29, 2018
a54b7a2
Bug fix for Alyx Panel logging with multiple instances of mc. Also S…
k1o0 Aug 30, 2018
7c49c03
Updated alyx-matlab: set method for base url
k1o0 Aug 30, 2018
b75322c
Update to block2ALF: fix'd stimOn and feedback times
k1o0 Sep 20, 2018
524a997
Moved Alyx instantiation to constructor to avoid unexpected behaviour
k1o0 Sep 26, 2018
a44ecd9
Added psychofit toolbox to psy package
k1o0 Sep 27, 2018
edc0549
Fix'd typo in readme
k1o0 Oct 2, 2018
4595b5d
Colourmap fix for discrimiation visualization
k1o0 Oct 3, 2018
7b30f3d
Param profiles sorted ignoring case
k1o0 Oct 12, 2018
276cd8e
Signals updates set once every 100ms
k1o0 Oct 12, 2018
ddfedd0
Water remaining rounded up, given rounded down in AlyxPanel
k1o0 Oct 17, 2018
b89c253
Applied rounding everywhere in AlyxPanel
k1o0 Oct 17, 2018
0b6c285
extra commenting
Oct 17, 2018
0323e03
Updated installation instructions + packages information; fixed typos
Oct 18, 2018
00226a7
mc & expServer pull latest code upon starting
k1o0 Oct 18, 2018
ef01a06
Support for new Alyx fields in sessions and water-administrations end…
k1o0 Oct 19, 2018
17db7f1
Auto updating of code when mc and expServer start up; removed addpath…
k1o0 Oct 19, 2018
971c002
Hydrogel bool now false by default
k1o0 Oct 19, 2018
e6f101e
update to Alyx-matlab & branch rename
k1o0 Oct 22, 2018
0a44724
Merge pull request #1 from cortex-lab/master
Oct 23, 2018
a5e90b1
signals dev branch changes into rigbox dev branch
Oct 23, 2018
fcc1580
Merge branch 'master' into dev
Oct 23, 2018
59601d9
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
Oct 23, 2018
83172d3
merged npy-matlab pull request to jaib1 from kwikteam of master branch
Oct 23, 2018
038768e
changed .gitmodules to have submodules point to jaib1 github repos in…
Oct 23, 2018
186c626
Git update cd to orig path on early return
k1o0 Oct 23, 2018
8cc73a5
Echo in code update and fix to warning in ExpPanel
k1o0 Oct 23, 2018
9a1e015
Scheduled updating in +git/update
k1o0 Oct 25, 2018
1cccfc1
Changed .gitmodules to point back to cortex-lab subrepos for pull req…
Oct 25, 2018
39caab5
Merge pull request #69 from jaib1/dev
k1o0 Oct 25, 2018
13c85a8
Reset lick counter NB: May ditch this method in future in favour of f…
k1o0 Oct 25, 2018
ad3b8da
Lick detector zero'd + git.update uses 'where git'
k1o0 Oct 25, 2018
6ceb4e6
Removed premature commit. Wheel now zero'd + where git in update func
k1o0 Oct 25, 2018
cd23b73
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Oct 25, 2018
af0738b
rm unfinished code
k1o0 Oct 25, 2018
9ee295f
added future training flag to AlyxPanel
Oct 26, 2018
150a61c
Updated Output to log when giving water in AlyxPanel
Oct 26, 2018
64677be
Merge pull request #73 from jaib1/dev
k1o0 Oct 26, 2018
53bce3b
Future water bug fix, better error handling is dispWtrReq and consist…
k1o0 Oct 29, 2018
633416a
Merge from dev, auto update of code every monday
k1o0 Oct 29, 2018
f943f48
Returns index of named arg
k1o0 Oct 31, 2018
e4cdf24
Bug fix and SPX222 support
k1o0 Oct 31, 2018
1c05914
Updates to signals & wheelAnalysis modules
k1o0 Oct 31, 2018
7148e9e
commentings on SignalsExp plus last signals subrepo commit
Oct 31, 2018
9bba914
repoint submodules back at Jai's forks
Oct 31, 2018
66f8d8f
last changes made to signals subrepo
Oct 31, 2018
9b27d06
pulling Miles' Rigbox dev commits from past 2 weeks
Oct 31, 2018
00af989
typo fixes for readme
Oct 31, 2018
814cfde
View all subjects window is now a better size
k1o0 Oct 31, 2018
4fd00a4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Oct 31, 2018
4ec10e6
Wheel signal availiable in degrees and mm
k1o0 Nov 15, 2018
3d23d11
Moved useRig to be before expDef run
k1o0 Nov 15, 2018
7d222c1
Skip repeats on wheel trace and zero offset now accessable
k1o0 Nov 15, 2018
385d6ba
Moved wheel out of useRig method: conflict with setting output
k1o0 Nov 16, 2018
81d7e8d
Fix to paths; npy-matlab added properly
k1o0 Nov 16, 2018
8982b19
Update from master
k1o0 Nov 16, 2018
b53653c
Docstring fix
k1o0 Nov 16, 2018
64aa3ca
Fix log for when no future train dates
k1o0 Nov 16, 2018
9b7a815
Alyx changes in subject endpoint
Nov 19, 2018
a8c895c
eui.AlyxPanel: water restriction management endpoint refactoring
Nov 19, 2018
e960a1a
Water type set in hardware
k1o0 Nov 20, 2018
34a4b7a
field name change for trials numbers
k1o0 Nov 20, 2018
86b4ce0
Bug fix for post water
k1o0 Nov 20, 2018
8b45502
Ugly but functional drop-down for water type
k1o0 Nov 20, 2018
3994da9
eui.AlyxPanel: water restriction management endpoint refactoring
Nov 19, 2018
770ef43
Alyx changes in subject endpoint
Nov 19, 2018
3cb5851
Initial DaqController changes for clock output + tidying other files
Nov 26, 2018
a94ab94
working RewardAsClock in DaqController
Nov 27, 2018
b0dd22d
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
Nov 27, 2018
7526eee
manual changes to resolve remote conflicts
Nov 27, 2018
53273c6
Session water posted by rig instead of mc. Allows rig specific water …
k1o0 Nov 27, 2018
f6a1ff5
Simplified ChoiceWorld water post
k1o0 Nov 27, 2018
e63525a
Merge from dev
k1o0 Nov 27, 2018
779a9f8
Scheduled update day set in paths file
k1o0 Nov 27, 2018
318cae0
Launch Webpage for session fix
k1o0 Nov 28, 2018
a60e93a
Small delay for correct behaviour of reward on stim
k1o0 Nov 30, 2018
952ac29
Merge remote-tracking branch 'origin' into wheelDeg
k1o0 Nov 30, 2018
b3a0f2f
Update tp submodules
k1o0 Nov 30, 2018
0908e33
Removed star and end dates in water-restriction GET for view subject …
k1o0 Dec 3, 2018
dcf2bae
Merge pull request #76 from jaib1/dev
Dec 4, 2018
c5cccc1
commit for updated submodules
Dec 4, 2018
6f667d1
Fix'd weight plot; no longer ploting unweighed days
k1o0 Dec 5, 2018
066ec03
Updates to modules and update fun
k1o0 Dec 5, 2018
8397dae
Merge remote branch 'dev' of https://github.com/cortex-lab/Rigbox int…
Dec 6, 2018
ddc5045
stash and pull strategy changes to git.update
Dec 6, 2018
2a3b473
hw-info ext bugfix; new commits to alyx-matlab; added test paths
k1o0 Dec 7, 2018
df3caf4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 7, 2018
3f764de
Removed questioning directory comments
Dec 7, 2018
25b5f2f
Merge pull request #78 from cortex-lab/devGitUpdate
Dec 7, 2018
6e8e9de
Give different water types in the future. Today's recorded weigth no…
k1o0 Dec 7, 2018
1c88311
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 7, 2018
5d31c5a
Update to alyx-matlab submodule
k1o0 Dec 7, 2018
05f723e
Update readme.md
Dec 7, 2018
ad6571b
Update to signals
k1o0 Dec 10, 2018
8978915
Update to signals
k1o0 Dec 10, 2018
89ce3fb
Update git.update
Dec 10, 2018
329bd47
corresponding 'git.update' update to 'mc'
Dec 10, 2018
5facbea
corresponding 'git.update' update to 'srv.expServer'
Dec 10, 2018
71c4ade
Scheduled update day taken from paths file
k1o0 Nov 27, 2018
fc5fc5f
Merge pull request #84 from cortex-lab/gitUpdate
Dec 12, 2018
4409066
Update to submodules
k1o0 Dec 14, 2018
d23f6fb
Fixed bug with hw-info saved as '.jjson' file
k1o0 Dec 14, 2018
c6fceb2
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 14, 2018
8135874
Reverting changes; .mat hw-nfo still used by tlvs. Using strrep to d…
k1o0 Dec 14, 2018
c9d7a00
Wheel assignment back in useRig
k1o0 Dec 17, 2018
388f317
Merge from wheelDeg
k1o0 Dec 17, 2018
77a3c2c
Rolled back DaqController due to issues with DigitalTTL output
k1o0 Dec 18, 2018
0e5e400
Logs no longer subtract reference time: already done by obj.Clock.now…
k1o0 Dec 18, 2018
b55ea8e
Releasing hardware and ports properly after experiment end
k1o0 Dec 18, 2018
e5ed26f
Removed fieldOrDefault; same functionality as getOr
k1o0 Dec 19, 2018
3b6a322
Added ext input to expFilePath
k1o0 Dec 19, 2018
f984ce4
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Dec 19, 2018
3169f66
bug fix: variable required transpose
k1o0 Dec 19, 2018
fcd6dcb
Checks for local folder rather than remote when creating new dir for …
k1o0 Jan 9, 2019
ddd772b
Auto cleanup of WeekendWater profile; changes to comments
k1o0 Jan 10, 2019
24ce0fd
Clearer plots and tables in view subject history
k1o0 Jan 11, 2019
b64f90b
Update to submodule; can't post zero weights
k1o0 Jan 11, 2019
c7e758a
Update to submodules: added params to subsession JSON field
k1o0 Jan 11, 2019
c193c60
updated submodule signals
ArminLak Jan 15, 2019
56dd8b9
Moved Signals vis functions from cortexlab directory
k1o0 Jan 20, 2019
770499b
cellFlat now works with arrays of Signals objects
k1o0 Jan 22, 2019
72acc90
Comments still saved loaclly upon failure to post to Alyx
k1o0 Jan 24, 2019
9ad2c06
Updates to session done with PATCH
k1o0 Jan 24, 2019
d54582b
Added change to patch cached put files to Alyx
k1o0 Jan 24, 2019
7ad3bab
Fix bug for when code never fetched
k1o0 Jan 26, 2019
7ae8813
Bug fix for timeplot
k1o0 Jan 27, 2019
5dcb828
add signals 'tutorials' folder to paths
Jan 28, 2019
fec3ac2
Merge remote branch 'dev' into local
Jan 28, 2019
808d565
Revert "add signals 'tutorials' folder to paths"
Jan 28, 2019
3d90407
Update only occurs once on scheduled day
k1o0 Jan 28, 2019
0ff7427
additional comments for git.update
Jan 28, 2019
c9c27a2
Fix'd incorrect brackets
k1o0 Jan 28, 2019
b36cadb
Attempt to integrate new Parameter Editor into mc
k1o0 Jan 30, 2019
04a8a3d
Updates for GUILT compatibility
k1o0 Feb 5, 2019
e47f462
New infer params
k1o0 Feb 8, 2019
0f4bff2
Check for reserved params
k1o0 Feb 8, 2019
c5a2e98
No more multiple default aud dev names
k1o0 Feb 8, 2019
571ee18
Bug fix for numRepeats when there's signal char param
k1o0 Feb 8, 2019
6e19d61
Subjects list disabled during login
k1o0 Feb 8, 2019
8522c13
Field change to water-requirement endpoint
k1o0 Feb 10, 2019
210c848
Pagination support
k1o0 Feb 10, 2019
6ae6b1e
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into dev
k1o0 Feb 10, 2019
b5ea66e
Modify Alyx login to use newid instead of inputdlg. This makes the 'e…
kevin-j-miller Feb 15, 2019
e9c2f5e
Modify Alyx login to use newid instead of inputdlg. This makes the 'e…
kevin-j-miller Feb 15, 2019
5f2fb58
Expose the AlyxPanel property of the MControl object, so that the log…
kevin-j-miller Feb 15, 2019
9b56e4f
modified alyx-matlab with more convenient textboxes and desktop short…
kevin-j-miller Feb 18, 2019
64416dd
Bug fix for turning empty objects into struct
k1o0 Feb 19, 2019
4fda5c0
Added error msgID and tests
k1o0 Feb 19, 2019
de7c0c2
modify alyx_matlab
kevin-j-miller Feb 20, 2019
fde8177
move alyxpanel property to private setaccess
kevin-j-miller Feb 20, 2019
ce9c36d
Merge pull request #105 from cortex-lab/dev_kevin
Feb 20, 2019
53bbb8c
Merge pull request #106 from cortex-lab/obj2json_fix
Feb 21, 2019
6f07fc8
Bugfix for registering hw info
k1o0 Feb 21, 2019
0e4ed52
Merge branch 'hwInfo_bug' into dev
Feb 21, 2019
7d04c62
Merge pull request #112 from cortex-lab/hwInfo_bug
Feb 21, 2019
c3b0f78
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into local
Feb 22, 2019
9b5cb2a
added test for 'vis.sinusoidLayer' and updated 'alyx' (dev) and 'sign…
Feb 22, 2019
cf9a2c2
Change to validation params
k1o0 Feb 27, 2019
199a894
Merge branch 'inferParams' into dev
ahcf Feb 27, 2019
4f0cf69
Bug fix for differing def fun paths
k1o0 Mar 5, 2019
35a3870
Rebased 'TestPanelClasses' onto 'dev' at diverge point c9c27a2 after …
Feb 15, 2019
86fcbbb
updated signals (dev) submodule
Mar 7, 2019
ccd828c
Merge branch 'inferParams' into dev
Mar 7, 2019
b6b47db
updated signals (TestPanelClasses) submodule
Mar 7, 2019
6238fda
updated signals (dev, merged into from TestPanelClasses) submodule
Mar 7, 2019
d4968cc
Merge branch 'TestPanelClasses' into dev
Mar 7, 2019
deaa055
added name-value args to srv.expServer
Mar 8, 2019
67e3de3
Merge branch 'dev' of https://github.com/cortex-lab/Rigbox into paramUI
k1o0 Mar 11, 2019
f93f73b
Updates to signals
k1o0 Mar 11, 2019
9babd51
Added config file for todo bot
k1o0 Mar 11, 2019
09deaf1
Hack for resize issue and fix for makeConditional()
k1o0 Mar 11, 2019
29266f0
Added some tests and minor modifications
k1o0 Mar 12, 2019
ad16e6f
Complete Parameters test; parameters deals with strings better; added…
k1o0 Mar 12, 2019
57ba45c
Bug fixes for numRepeats behaviour, more tests
k1o0 Mar 13, 2019
335642a
Better coverage of Changed event
k1o0 Mar 13, 2019
d9fc48d
Added full documentation
k1o0 Mar 13, 2019
8272c01
Added performance test and tooltip strings
k1o0 Mar 13, 2019
f89a74b
small changes before testing out on rig
Mar 14, 2019
a396826
updated documentation for expServer
Mar 14, 2019
208b525
bug fix in name-value pair evaluation for expServer
Mar 14, 2019
53e23fe
Removed some comments and command promt output, renamed tests
k1o0 Mar 14, 2019
7162d92
Update readme.md
k1o0 Mar 14, 2019
a2de04b
more doc on srv.expServer
Mar 15, 2019
c8f7eb6
Changed RearrangeableColumns from true to 'on'
k1o0 Mar 15, 2019
d1ded06
reorganized test folder structure, plus added some comments
Mar 15, 2019
4c9b67f
renamed folder 'helpers' to 'fixtures'; added 'SharedTestFixtures' to…
Mar 19, 2019
5d28fb1
HOTFIX: double-check experiment isn't already running before starting…
k1o0 Mar 19, 2019
e0eca9e
HOTFIX: 'ExpRunnning' changed to 'ExpRunning'
Mar 19, 2019
c5ac87a
HOTFIX: updated 'eui.MControl/beginExp' to not run exp on rig already…
Mar 19, 2019
228a016
HOTFIX Update to ALF extraction
k1o0 Mar 20, 2019
b85f8f8
Merge pull request #119 from cortex-lab/paramUI
Mar 20, 2019
8820651
Added config YAML for todo bot
k1o0 Mar 20, 2019
7483cdb
Started documenting expServer and Communicator
k1o0 Mar 21, 2019
a83c437
Added docs folder for package demos
k1o0 Mar 23, 2019
3b81095
Added contributing guidlines
k1o0 Mar 25, 2019
cb6f91e
Moved UML to doc folder
k1o0 Mar 25, 2019
ff248c9
added images branch from signals
k1o0 Mar 27, 2019
f3bdf55
corrected submodule update to only change signals, not alyx-matlab
kevin-j-miller Mar 27, 2019
b7c406b
trying again to get the submodules right
kevin-j-miller Mar 27, 2019
b319789
Hack-fixed a bug that caused string parameters to not be editable
kevin-j-miller Mar 27, 2019
7259eef
updated signals submodule (merged 'images' and 'voidsignal_fix' into …
peterzh Mar 27, 2019
1a48116
merged 'dev' into 'uiux'
Mar 29, 2019
64b81ab
bug fix for uicontextmenu in Condition and Field Panels
Mar 29, 2019
64c719e
merge 'dev' into 'uiux' after uicontrolmenu bug fix in Field and Cond…
Mar 29, 2019
5795d47
updated 'signals' (hotfix updates) and 'alyx-matlab' (merged 'Tests' …
Apr 1, 2019
f3fc112
updated doc on inferParameters
Apr 1, 2019
2f91915
Merge branch 'dev_kevin' into dev
Apr 12, 2019
6ec0de1
Merge pull request #131 from cortex-lab/documentation
Apr 12, 2019
4cf439b
updated signals (merged 'cleanup' into 'dev') submodule
Apr 17, 2019
339cdfc
updated git.update for case where git exe can't be found
Apr 18, 2019
9521b66
updated signals submodule
Apr 24, 2019
816b2ff
Fix for expStop error and bug where event updates twice
k1o0 Apr 29, 2019
90fd732
Removed unused code
k1o0 Apr 29, 2019
f442efa
Storing/referencing figure now more efficient
k1o0 Apr 29, 2019
0206c4d
Added full string support in ParamEditor
k1o0 Apr 29, 2019
8f0a41d
Tidied +exp and moved subtightplot out of burgbox
k1o0 May 1, 2019
2bbd932
Merge pull request #146 from cortex-lab/ParamStrings
May 2, 2019
6c52421
merge 'devUpdateContributing' into 'dev'
May 6, 2019
d8d691e
add 'contributing.md' link and author emails to 'readme'
May 6, 2019
3c48d57
Merge pull request #149 from cortex-lab/expStop
May 7, 2019
89f1854
updated submodule signals (merged 'tutorialsForPaper' into 'dev')
May 7, 2019
c7dd26c
Revert "Merge pull request #149 from cortex-lab/expStop"
May 7, 2019
bc3f9c0
updated 'expStop' issue after testing
May 8, 2019
e5683cd
Update README.md
May 8, 2019
781d366
merged 'documentation' into dev
k1o0 Apr 12, 2019
7cc8fd4
updated signals and alyx-matlab submodules (just documentation)
May 10, 2019
7d714b8
added name-value args to srv.expServer
Mar 8, 2019
7f2c6a4
Merge branch 'uiux' of https://github.com/cortex-lab/Rigbox into uiux
May 14, 2019
e2ff7ff
small doc updates
May 14, 2019
0a1aab9
typo fix in 'inferParameters'
May 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions +dat/addLogEntry.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
%% create and store entry
e = entry(nextidx);
log(nextidx) = e;
% Store an instance of Alyx for narrative registration
if nargin > 5; e.AlyxInstance = AlyxInstance; end

%% store updated log to *all* repos locations
Expand Down
2 changes: 1 addition & 1 deletion +dat/delParamProfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function delParamProfile(expType, profileName)

%path to repositories
fn = 'parameterProfiles.mat';
repos = fullfile(dat.reposPath('expInfo'), fn);
repos = fullfile(dat.reposPath('main'), fn);

%load existing profiles for specified expType
profiles = dat.loadParamProfiles(expType);
Expand Down
7 changes: 5 additions & 2 deletions +dat/expExists.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
function b = expExists(expRef)
%DAT.EXPEXISTS Confirm existence of experiment(s) with reference
% b = DAT.EXPEXISTS(expRef) TODO
% b = DAT.EXPEXISTS(expRef) Returns true is expRef exists, where expRef
% is an experiment reference string or cell array thereof.
%
% See Also DAT.LISTEXPS, DAT.PATHS
%
% Part of Rigbox

Expand All @@ -14,7 +17,7 @@

function b = check(expRef)
% ensure the standard folder given the reference exists
b = file.exists(dat.expPath(expRef, 'expInfo', 'master'));
b = file.exists(dat.expPath(expRef, 'main', 'master'));
end

end
109 changes: 60 additions & 49 deletions +dat/expFilePath.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,105 +7,117 @@
% e.g. to get the paths for an experiments 2 photon TIFF movie:
% DAT.EXPFILEPATH('mouse1', datenum(2013, 01, 01), 1, '2p-raw');
%
% [full, filename] = expFilePath(ref, type, [reposlocation])
% [full, filename] = expFilePath(ref, type, [reposlocation, ext])
%
% [full, filename] = expFilePath(subject, date, seq, type, [reposlocation])
% [full, filename] = expFilePath(subject, date, seq, type, [reposlocation, ext])
%
% Options for reposlocation are: 'local' or 'master'
% Many options for type, e.g. 'block', '2p-raw', 'eyetracking', etc
% If ext is specified, the path returned has the extention ext, otherwise
% the default for that type is used.
%
% Part of Rigbox

% 2013-03 CB created

if nargin == 3 || nargin == 5
% repos argument was passed, save the value and remove from varargin
location = varargin(end);
varargin(end) = [];
elseif nargin < 2
error('Not enough arguments supplied.');
else
% repos argument not passed
location = {};
assert(length(varargin) > 1, 'Error: Not enough arguments supplied.')

parsed = catStructs(regexp(varargin{1}, dat.expRefRegExp, 'names'));
if isempty(parsed) % Subject, not ref
if nargin > 4
location = varargin{5};
varargin(5) = [];
else
location = {};
end
typeIdx = 4;
else % Ref, not subject
typeIdx = 2;
if nargin > 2
location = varargin{3};
varargin(3) = [];
else
location = {};
end
end

% tabulate the args to get complete rows
[varargin{1:end}, singleArgs] = tabulateArgs(varargin{:});

% last argument is the file type
fileType = varargin{end};
fileType = varargin{typeIdx};
extention = iff(any(numel(varargin) == [3,5]), varargin{end},...
cell(1,length(varargin{1})));
if any(numel(varargin) == [3,5]); varargin(end) = []; end

% convert file types to file suffixes
[repos, suffix, dateLevel] = mapToCell(@typeInfo, fileType);
[repos, suffix, dateLevel] = mapToCell(@typeInfo, fileType(:), extention(:));

reposArgs = cat(2, {repos}, location);

% and the rest are for the experiment reference
[expPath, expRef] = dat.expPath(varargin{1:end - 1}, reposArgs{:});

function [repos, suff, dateLevel] = typeInfo(type)
function [repos, suff, dateLevel] = typeInfo(type, newExt)
% whether this repository is at the date level or otherwise deeper at the sequence
% level (default)
% level (default). FIXME: Date level doesn't work, perhaps this should
% be modified to work with deeper sequences also? E.g.
% default\2018-05-04\1\2
dateLevel = false;
repos = 'main';
ext = '.mat';
switch lower(type)
case 'block' % MAT-file with info about each set of trials
repos = 'expInfo';
suff = '_Block.mat';
suff = '_Block';
case 'hw-info' % MAT-file with info about the hardware used for an experiment
repos = 'expInfo';
suff = '_hardwareInfo.mat';
suff = '_hardwareInfo';
case '2p-raw' % TIFF with 2-photon raw fluorescence movies
repos = 'twoPhoton';
suff = '_2P.tif';
ext = '.tif';
case 'calcium-preview'
repos = 'twoPhoton';
suff = '_2P_CalciumPreview.tif';
suff = '_2P_CalciumPreview';
ext = '.tif';
case 'calcium-reg'
repos = 'twoPhoton';
suff = '_2P_CalciumReg';
ext = '';
case 'calcium-regframe'
repos = 'twoPhoton';
suff = '_2P_CalciumRegFrame.tif';
suff = '_2P_CalciumRegFrame';
ext = '.tif';
case 'timeline' % MAT-file with acquired timing information
repos = 'expInfo';
suff = '_Timeline.mat';
suff = '_Timeline';
case 'calcium-roi'
repos = 'twoPhoton';
suff = '_ROI.mat';
suff = '_ROI';
case 'calcium-fc' % minimally filtered fractional change frames
repos = 'twoPhoton';
suff = '_2P_CalciumFC';
ext = '';
case 'calcium-ffc' % ROI filtered fractional change frames
repos = 'twoPhoton';
suff = '_2P_CalciumFFC';
ext = '';
case 'calcium-widefield-svd'
repos = 'widefield';
suff = '_SVD';
ext = '';
case 'eyetracking'
repos = 'eyeTracking';
suff = '_eye';
ext = '';
case 'parameters' % MAT-file with parameters used for experiment
repos = 'expInfo';
suff = '_parameters.mat';
suff = '_parameters';
case 'lasermanip'
repos = 'expInfo';
suff = '_laserManip.mat';
suff = '_laserManip';
case 'img-info'
repos = 'twoPhoton';
suff = '_imgInfo.mat';
suff = '_imgInfo';
case 'tmaze'
repos = 'expInfo';
suff = '_TMaze.mat';
suff = '_TMaze';
case 'expdeffun'
repos = 'expInfo';
suff = '_expDef.m';
suff = '_expDef';
ext = '.m';
case 'svdspatialcomps'
dateLevel = true;
% expPath = mapToCell(@fileparts, expPath);
% repos = 'expInfo';
% suff = '_expDef.m';
otherwise
error('"%s" is not a valid file type', type);
end
% Append extention to suffix
ext = iff(isempty(newExt)&&~ischar(newExt), ext, newExt);
suff = iff((isempty(ext)&&ischar(ext))||(~isempty(ext)&&ext(1)=='.'),...
[suff, ext], [suff, '.', ext]);
end

% generate a filename for each experiment
Expand All @@ -120,5 +132,4 @@
filename = filename{1};
end

end

end
2 changes: 1 addition & 1 deletion +dat/expLogRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

if nargin < 2
args = struct;
elseif nargin == 2 && isstruct(varargin{1});
elseif nargin == 2 && isstruct(varargin{1})
else
args = varargin2struct(varargin{:});
end
Expand Down
4 changes: 2 additions & 2 deletions +dat/expPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
% sames as the above, but returns paths for an experiment with a
% specified 'subject', on a particular 'date', and numbered 'seq'.
%
% e.g. to get the paths for the 'expInfo' repository, for the first
% e.g. to get the paths for the 'main' repository, for the first
% experiment of the day for 'SUBJECTA':
%
% paths = DAT.EXPPATH('SUBJECTA', now, 1, 'expInfo');
% paths = DAT.EXPPATH('SUBJECTA', now, 1, 'main');
%
% Part of Rigbox

Expand Down
6 changes: 3 additions & 3 deletions +dat/listExps.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

% 2013-03 CB created

% The master 'expInfo' repository is the reference for the existence of
% The master 'main' repository is the reference for the existence of
% experiments, as given by the folder structure
expInfoPath = dat.reposPath('expInfo', 'master');
mainPath = dat.reposPath('main', 'master');

function [expRef, expDate, expSeq] = subjectExps(subject)
% finds experiments for individual subjects
% experiment dates correpsond to date formated folders in subject's
% folder
subjectPath = fullfile(expInfoPath, subject);
subjectPath = fullfile(mainPath, subject);
subjectDirs = file.list(subjectPath, 'dirs');
dateRegExp = '^(?<year>\d\d\d\d)\-?(?<month>\d\d)\-?(?<day>\d\d)$';
dateMatch = regexp(subjectDirs, dateRegExp, 'names');
Expand Down
46 changes: 36 additions & 10 deletions +dat/listSubjects.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,43 @@
function subjects = listSubjects()
function subjects = listSubjects(varargin)
%DAT.LISTSUBJECTS Lists recorded subjects
% subjects = DAT.LISTSUBJECTS() Lists the experimental subjects present
% in experiment info repository ('expInfo').
% subjects = DAT.LISTSUBJECTS([alyxInstance]) Lists the experimental subjects present
% in experiment info repository ('main').
%
% Optional input argument of an alyx instance will enable generating this
% list from alyx rather than from the directory structure on zserver
%
% Part of Rigbox

% 2013-03 CB created
% 2018-01 NS added Alyx compatibility

% The master 'expInfo' repository is the reference for the existence of
% experiments, as given by the folder structure
expInfoPath = dat.reposPath('expInfo', 'master');

dirs = file.list(expInfoPath, 'dirs');
subjects = setdiff(dirs, {'misc'}); %exclude the misc directory

if nargin>0 && ~isempty(varargin{1}) % user provided an alyx instance
ai = varargin{1}; % an alyx instance

% get list of all living, non-stock mice from alyx
s = alyx.getData(ai, 'subjects?stock=False&alive=True');

% determine the user for each mouse
respUser = cellfun(@(x)x.responsible_user, s, 'uni', false);

% get cell array of subject names
subjNames = cellfun(@(x)x.nickname, s, 'uni', false);

% determine which subjects belong to this user
thisUserSubs = sort(subjNames(strcmp(respUser, ai.username)));

% all the subjects
otherUserSubs = sort(subjNames(~strcmp(respUser, ai.username)));

% the full, ordered list
subjects = [{'default'}, thisUserSubs, otherUserSubs]';
else

% The master 'main' repository is the reference for the existence of
% experiments, as given by the folder structure
mainPath = dat.reposPath('main', 'master');

dirs = file.list(mainPath, 'dirs');
subjects = dirs(~cellfun(@(d)startsWith(d, '@'), dirs)); % exclude misc directories
end
end
5 changes: 3 additions & 2 deletions +dat/loadParamProfiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% 2017-02 MW Param struct now sorted in ASCII dictionary order

fn = 'parameterProfiles.mat';
masterPath = fullfile(dat.reposPath('expInfo', 'master'), fn);
masterPath = fullfile(dat.reposPath('main', 'master'), fn);

p = struct; %default is to return an empty struct

Expand All @@ -18,7 +18,8 @@
loaded = load(masterPath, expType); %load profiles for specific experiment type
warning(origState);
if isfield(loaded, expType)
p = orderfields(loaded.(expType)); %extract those profiles to return
[~, I] = sort(lower(fieldnames(loaded.(expType))));
p = orderfields(loaded.(expType), I); %extract those profiles to return
end
end

Expand Down
4 changes: 2 additions & 2 deletions +dat/logPath.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

%ensure the subject exists
assert(dat.subjectExists(subject), 'Subject "%s" does not exist', subject);
% get path(s) to expInfo repository
reposPath = dat.reposPath('expInfo', varargin{:});
% get path(s) to main repository
reposPath = dat.reposPath('main', varargin{:});

filename = sprintf('%s_log.mat', subject);
subjectPath = file.mkPath(reposPath, subject);
Expand Down
Loading