Lab Management
getKnownExperiments
cExperiments = getKnownExperiments()
Returns a cell array of the string values of known experiments.
Example
Retrieve existing experiments from the Synapse database.
result = syn.getKnownExperiments()
if numel(result) < 1
error('no experiments found')
end
result = syn.getKnownExperiments()
if len(result) < 1:
raise Exception('no experiments found')
getKnownSubjects
cSubjects = getKnownSubjects()
Returns a cell array of the string values of known subjects.
Example
Retrieve existing subjects from the Synapse database.
result = syn.getKnownSubjects()
if numel(result) < 1
error('no subjects found')
end
result = syn.getKnownSubjects()
if len(result) < 1:
raise Exception('no subjects found')
getKnownUsers
cUsers = getKnownUsers()
Returns a cell array of the string values of known users.
Example
Retrieve existing users from the Synapse database.
result = syn.getKnownUsers()
if numel(result) < 1
error('no users found')
end
result = syn.getKnownUsers()
if len(result) < 1:
raise Exception('no users found')
getKnownTanks
cTanks = getKnownTanks()
Returns a cell array of the string values of known tanks.
Example
Retrieve existing tanks from from the Synapse database.
result = syn.getKnownTanks()
if numel(result) < 1
error('no tanks found')
end
result = syn.getKnownTanks()
if len(result) < 1:
raise Exception('no tanks found')
getKnownBlocks
cBlocks = getKnownBlocks()
Returns a cell array of the string values of known blocks.
Example
Retrieve existing block names from the Synapse database.
result = syn.getKnownBlocks()
if numel(result) < 1
error('no blocks found')
end
result = syn.getKnownBlocks()
if len(result) < 1:
raise Exception('no blocks found')
getCurrentExperiment
sExperiment = getCurrentExperiment()
Returns the name of the currently selected experiment.
Example
Retrieve the current experiment name.
currExperiment = syn.getCurrentExperiment()
currExperiment = syn.getCurrentExperiment()
getCurrentSubject
sSubject = getCurrentSubject()
Returns the name of the currently selected subject.
Example
Retrieve the current subject name.
currSubject = syn.getCurrentSubject()
currSubject = syn.getCurrentSubject()
getCurrentUser
sUser = getCurrentUser()
Returns the name of the currently selected user.
Example
Retrieve the current user name.
currUser = syn.getCurrentUser()
currUser = syn.getCurrentUser()
getCurrentTank
sTank = getCurrentTank()
Returns the name of the currently selected tank.
Example
Retrieve the current tank name.
currTank = syn.getCurrentTank()
currTank = syn.getCurrentTank()
getCurrentBlock
sBlock = getCurrentBlock()
Returns the name of the currently recording block.
Example
Retrieve the current block name.
currBlock = syn.getCurrentBlock()
currBlock = syn.getCurrentBlock()
createSubject
bSuccess = createSubject(sName, sDesc, sIcon)
Creates a subject with the given name, description, and icon.
Example
Create a new subject, and set it as the current subject before recording.
nextSubj = 'ABC123';
syn.createSubject(nextSub, 'Control', 'mouse')
syn.setCurrentSubject(nextSub)
syn.setMode(3)
nextSub = 'ABC123'
syn.createSubject(nextSub, 'Control', 'mouse')
syn.setCurrentSubject(nextSub)
syn.setMode(3)
createTank
bSuccess = createTank(sTankPath)
Creates a tank at the given path.
Example
Create a new tank, set it as the current tank, and start recording.
nextTank = 'C:\TDT\NEXTTANK'
syn.createTank(nextTank)
syn.setCurrentTank(nextTank)
syn.setMode(3)
nextTank = 'C:\\TDT\\NEXTTANK'
syn.createTank(nextTank)
syn.setCurrentTank(nextTank)
syn.setMode(3)
setCurrentExperiment
bSuccess = setCurrentExperiment(sExperiment)
Creates a tank at the given path.
Example
Find first known experiment and select it.
result = syn.knownExperiments()
syn.setCurrentExperiment(result{1})
result = syn.knownExperiments()
syn.setCurrentExperiment(result[0])
setCurrentSubject
bSuccess = setCurrentSubject(sSubject)
Creates a tank at the given path.
Example
Find first known subject and select it.
result = syn.knownSubjects()
syn.setCurrentSubject(result{1})
result = syn.knownSubjects()
syn.setCurrentSubject(result[0])
setCurrentUser
bSuccess = setCurrentUser(sUser, sPassword)
Creates a tank at the given path.
Example
Find first known user and select it.
result = syn.knownUsers()
syn.setCurrentUser(result{1})
result = syn.knownUsers()
syn.setCurrentUser(result[0])
setCurrentTank
bSuccess = setCurrentTank(sTank)
Switches to the specified tank.
Note
The Auto Tank Naming
option in the Preferences menu must be disabled
for this to succeed.
Example
Set the tank name before the next recording.
nextTank = 'C:\TDT\SYNTANK';
syn.setMode(0)
syn.setCurrentTank(nextTank)
syn.setMode(3)
disp(syn.getCurrentTank())
nextTank = 'C:\\TDT\\SYNTANK'
syn.setMode(0)
syn.setCurrentTank(nextTank)
syn.setMode(3)
print(syn.getCurrentTank())
setCurrentBlock
bSuccess = setCurrentBlock(sBlock)
Switches to the specified block.
Note
Note that the Block Naming
option in the Preferences
menu must be set to Prompt
for this to succeed.
Example
Set the block name before the next recording.
nextBlock = 'MyBlockName';
syn.setMode(0)
syn.setCurrentBlock(nextBlock)
syn.setMode(3)
disp(syn.getCurrentBlock())
nextBlock = 'MyBlockName'
syn.setMode(0)
syn.setCurrentBlock(nextBlock)
syn.setMode(3)
print(syn.getCurrentBlock())
getSubjectMemos
cNotes = getSubjectMemos(sSubject)
Retrieves the log entries from the Synapse database for the specified subject. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.
Example
Retrieve specific notes from the Synapse database.
currSubject = syn.currentSubject()
allNotes = syn.getSubjectMemos(currSubject)
% get notes from 2019
filteredNotes = syn.getSubjectMemos(currSubject, 'STARTTIME',
20190101000000, 'ENDTIME', 20191231235959)
currSubject = syn.currentSubject()
allNotes = syn.getSubjectMemos(currSubject)
# get notes from 2019
filteredNotes = syn.getSubjectMemos(currSubject,
startTime='20190101000000', endTime='20191231235959')
getExperimentMemos
cNotes = getExperimentMemos(sExperiment)
Retrieves the log entries from the Synapse database for the specified experiment. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.
Example
Retrieve specific notes from the Synapse database.
currExperiment = syn.currentExperiment()
allNotes = syn.getExperimentMemos(currExperiment)
% get notes from 2019
filteredNotes = syn.getExperimentMemos(currExperiment, 'STARTTIME',
20190101000000, 'ENDTIME', 20191231235959)
currExperiment = syn.currentExperiment()
allNotes = syn.getExperimentMemos(currExperiment)
# get notes from 2019
filteredNotes = syn.getExperimentMemos(currExperiment,
startTime='20190101000000', endTime='20191231235959')
getUserMemos
cNotes = getUserMemos(sUser)
Retrieves the log entries from the Synapse database for the specified user. These can optionally be filtered by time using the STARTTIME and STOPTIME parameters which are formatted like %Y%m%d%H%M%S, e.g. May 22, 2020 9:53 am would be 20200522095300.
Example
Retrieve specific notes from the Synapse database.
currUser = syn.currentUser()
allNotes = syn.getUserMemos(currUser)
% get notes from 2019
filteredNotes = syn.getUserMemos(currUser, 'STARTTIME',
20190101000000, 'ENDTIME', 20191231235959)
currUser = syn.currentUser()
allNotes = syn.getUserMemos(currUser)
# get notes from 2019
filteredNotes = syn.getUserMemos(currUser,
startTime='20190101000000', endTime='20191231235959')
appendSubjectMemo
bSuccess = appendSubjectMemo(sSubject, sMemo)
Adds a database entry linked to this specified subject, just as if the user typed it in the Logs dialog.
Example
Add memo to current subject.
currSubject = syn.currentSubject()
syn.appendSubjectMemo(currSubject, 'Subject memo from MATLAB')
currSubject = syn.currentSubject()
syn.appendSubjectMemo(currSubject, 'Subject memo from Python')
appendExperimentMemo
bSuccess = appendExperimentMemo(sExperiment, sMemo)
Adds a database entry linked to this specified experiment, just as if the user typed it in the Logs dialog.
Example
Add memo to current experiment.
currExperiment = syn.currentExperiment()
syn.appendExperimentMemo(currExperiment, 'Experiment memo from MATLAB')
currExperiment = syn.currentExperiment()
syn.appendExperimentMemo(currExperiment, 'Experiment memo from Python')
appendUserMemo
bSuccess = appendUserMemo(sUser, sMemo)
Adds a database entry linked to this specified user, just as if the user typed it in the Logs dialog.
Example
Add memo to current user.
currUser = syn.currentUser()
syn.appendUserMemo(currUser, 'User memo from MATLAB')
currUser = syn.currentUser()
syn.appendUserMemo(currUser, 'User memo from Python')