Skip to content

CLASS ndi.setup.NDIMaker.stimulusDocMaker

  Folder: +ndi/+setup/+NDIMaker/


Superclasses

handle

Properties

Property Description
session The NDI session object (e.g., ndi.session.dir or ndi.database.dir) where stimulus documents will be added.
mixtureFilename
bathtargetsFilename
mixtureStruct
bathtargetsStruct

Methods

Method Description
addlistener addlistener Add listener for event.
createApproachDoc CREATEAPPROACHDOC Creates and adds NDI 'openminds' documents to the session database.
createBathDoc CREATEBATHDOC Creates and adds NDI 'stimulus_bath' documents to the session database.
delete DELETE Delete a handle object.
eq == (EQ) Test handle equality.
findobj FINDOBJ Find objects matching specified conditions.
findprop findprop Find property of MATLAB handle object.
ge >= (GE) Greater than or equal relation for handles.
gt > (GT) Greater than relation for handles.
isvalid ISVALID Test handle validity.
le <= (LE) Less than or equal relation for handles.
listener listener Add listener for event without binding the listener to the source object.
lt < (LT) Less than relation for handles.
ne ~= (NE) Not equal relation for handles.
notify NOTIFY Notify listeners of event.
stimulusDocMaker STIMULUSDOCMAKER Constructor for this class.
table2approachDocs TABLE2APPROACHDOCS Converts rows in a table into stimulus approach documents via CREATEAPPROACHDOCS.
table2bathDocs TABLE2BATHDOCS Converts rows in a table into stimulus bath documents via CREATEBATHDOCS.

Methods help

addlistener - addlistener Add listener for event.

el = addlistener(hSource, Eventname, callbackFcn) creates a listener
    for the event named Eventname.  The source of the event is the handle 
    object hSource.  If hSource is an array of source handles, the listener
    responds to the named event on any handle in the array.  callbackFcn
    is a function handle that is invoked when the event is triggered.

    el = addlistener(hSource, PropName, Eventname, Callback) adds a 
    listener for a property event.  Eventname must be one of
    'PreGet', 'PostGet', 'PreSet', or 'PostSet'. Eventname can be
    a string scalar or character vector.  PropName must be a single 
    property name specified as string scalar or character vector, or a 
    collection of property names specified as a cell array of character 
    vectors or a string array, or as an array of one or more 
    matlab.metadata.Property objects.  The properties must belong to the 
    class of hSource.  If hSource is scalar, PropName can include dynamic 
    properties.

    For all forms, addlistener returns an event.listener.  To remove a
    listener, delete the object returned by addlistener.  For example,
    delete(el) calls the handle class delete method to remove the listener
    and delete it from the workspace.

    addlistener binds the listener's lifecycle to the object that is the 
    source of the event.  Unless you explicitly delete the listener, it is
    destroyed only when the source object is destroyed.  To control the
    lifecycle of the listener independently from the event source object, 
    use listener or the event.listener constructor to create the listener.

    See also listener, event.listener, ndi.setup.ndimaker.stimulusdocmaker, matlab.metadata.Property, events

Help for ndi.setup.NDIMaker.stimulusDocMaker/addlistener is inherited from superclass handle

createApproachDoc - CREATEAPPROACHDOC Creates and adds NDI 'openminds' documents to the session database.

Constructs one or more 'openminds' NDI documents for a specific
    stimulator and epoch, based on provided approach name(s).

    Inputs:
        obj: An instance of the stimulusDocMaker class.
        stimulatorid: The NDI element ID of the stimulator device.
        epochid: The NDI epoch ID for which the document is being created.
        approachStrings: A character vector or a cell array of character
                           vectors specifying the approach name(s).

    Optional Name-Value Arguments:
        Overwrite: A flag intended to control whether existing documents 
                        should be overwritten. Default: false.

    Outputs:
        docs: A cell array containing the newly created 'openminds' NDI document
              object(s). A separate document is created for each distinct location
              associated with the provided 'approachStrings'.

    See also: NDI.DATABASE.FUN.NDICLOUD_ONTOLOGY_LOOKUP,

createBathDoc - CREATEBATHDOC Creates and adds NDI 'stimulus_bath' documents to the session database.

Constructs one or more 'stimulus_bath' NDI documents for a specific
    stimulator and epoch, based on provided bath target(s) and mixture(s).
    It looks up ontology details (location name, mixture components) using
    the loaded structures.

    Inputs:
        obj: An instance of the stimulusDocMaker class.
        stimulatorid: The NDI element ID of the stimulator device.
        epochid: The NDI epoch ID for which the document is being created.
        bathtargetStrings: A character vector or a cell array of character
                           vectors specifying the bath target(s) by name. These names
                           must match keys (case-sensitively) in 'obj.bathtargetsStruct'.
        mixtureStrings: A character vector or a cell array of character
                        vectors specifying the mixture(s) by name. These names
                        must match keys (case-sensitively) in 'obj.mixtureStruct'.

    Optional Name-Value Arguments:
        Overwrite: A flag intended to control whether existing documents 
                        should be overwritten. Default: false.

    Outputs:
        docs: A cell array containing the newly created 'stimulus_bath' NDI document
              object(s). A separate document is created for each distinct location
              associated with the provided 'bathtargetStrings'.

    See also: NDI.SETUP.CONV.MARDER.MIXTURESTR2MIXTURETABLE,
        NDI.DATABASE.FUN.FINDDOCS_ELEMNTEPOCHTYPE,
        NDI.DATABASE.FUN.UBERON_ONTOLOGY_LOOKUP,
        NDI.DATABASE.FUN.WRITETABLECHAR

delete - DELETE Delete a handle object.

DELETE(H) deletes all handle objects in array H. After the delete 
    function call, H is an array of invalid objects.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/ISVALID, CLEAR

Help for ndi.setup.NDIMaker.stimulusDocMaker/delete is inherited from superclass handle

eq - == (EQ) Test handle equality.

Handles are equal if they are handles for the same object.

    H1 == H2 performs element-wise comparisons between handle arrays H1 and
    H2.  H1 and H2 must be of the same dimensions unless one is a scalar.
    The result is a logical array of the same dimensions, where each
    element is an element-wise equality result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = EQ(H1, H2) stores the result in a logical array of the same 
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/NE

Help for ndi.setup.NDIMaker.stimulusDocMaker/eq is inherited from superclass handle

findobj - FINDOBJ Find objects matching specified conditions.

The FINDOBJ method of the HANDLE class follows the same syntax as the 
    MATLAB FINDOBJ command, except that the first argument must be an array
    of handles to objects.

    HM = FINDOBJ(H, <conditions>) searches the handle object array H and 
    returns an array of handle objects matching the specified conditions.
    Only the public members of the objects of H are considered when 
    evaluating the conditions.

    See also FINDOBJ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER

Help for ndi.setup.NDIMaker.stimulusDocMaker/findobj is inherited from superclass handle

findprop - findprop Find property of MATLAB handle object.

p = findprop(H,PropName) finds and returns the matlab.metadata.Property 
    object associated with property name PropName of scalar handle object H.
    PropName can be a string scalar or character vector.  It can be the 
    name of a property defined by the class of H or a dynamic property 
    added to scalar object H.

    If no property named PropName exists for object H, an empty 
    matlab.metadata.Property array is returned.

    See also ndi.setup.ndimaker.stimulusdocmaker, ndi.setup.ndimaker.stimulusdocmaker/findobj, dynamicprops, matlab.metadata.Property

Help for ndi.setup.NDIMaker.stimulusDocMaker/findprop is inherited from superclass handle

ge - >= (GE) Greater than or equal relation for handles.

H1 >= H2 performs element-wise comparisons between handle arrays H1 and
    H2.  H1 and H2 must be of the same dimensions unless one is a scalar.
    The result is a logical array of the same dimensions, where each
    element is an element-wise >= result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = GE(H1, H2) stores the result in a logical array of the same 
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/EQ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/NE

Help for ndi.setup.NDIMaker.stimulusDocMaker/ge is inherited from superclass handle

gt - > (GT) Greater than relation for handles.

H1 > H2 performs element-wise comparisons between handle arrays H1 and 
    H2.  H1 and H2 must be of the same dimensions unless one is a scalar.  
    The result is a logical array of the same dimensions, where each
    element is an element-wise > result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = GT(H1, H2) stores the result in a logical array of the same 
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/EQ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/NE

Help for ndi.setup.NDIMaker.stimulusDocMaker/gt is inherited from superclass handle

isvalid - ISVALID Test handle validity.

TF = ISVALID(H) performs an element-wise check for validity on the 
    handle elements of H.  The result is a logical array of the same 
    dimensions as H, where each element is the element-wise validity 
    result.

    A handle is invalid if it has been deleted or if it is an element
    of a handle array and has not yet been initialized.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/DELETE

Help for ndi.setup.NDIMaker.stimulusDocMaker/isvalid is inherited from superclass handle

le - <= (LE) Less than or equal relation for handles.

Handles are equal if they are handles for the same object.  All 
    comparisons use a number associated with each handle object.  Nothing
    can be assumed about the result of a handle comparison except that the
    repeated comparison of two handles in the same MATLAB session will 
    yield the same result.  The order of handle values is purely arbitrary 
    and has no connection to the state of the handle objects being 
    compared.

    H1 <= H2 performs element-wise comparisons between handle arrays H1 and
    H2.  H1 and H2 must be of the same dimensions unless one is a scalar.
    The result is a logical array of the same dimensions, where each
    element is an element-wise >= result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = LE(H1, H2) stores the result in a logical array of the same 
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/EQ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/NE

Help for ndi.setup.NDIMaker.stimulusDocMaker/le is inherited from superclass handle

listener - listener Add listener for event without binding the listener to the source object.

el = listener(hSource, Eventname, callbackFcn) creates a listener
    for the event named Eventname.  The source of the event is the handle  
    object hSource.  If hSource is an array of source handles, the listener
    responds to the named event on any handle in the array.  callbackFcn
    is a function handle that is invoked when the event is triggered.

    el = listener(hSource, PropName, Eventname, callback) adds a 
    listener for a property event.  Eventname must be one of  
    'PreGet', 'PostGet', 'PreSet', or 'PostSet'. Eventname can be a 
    string sclar or character vector.  PropName must be either a single 
    property name specified as a string scalar or character vector, or 
    a collection of property names specified as a cell array of character 
    vectors or a string array, or as an array of one ore more 
    matlab.metadata.Property objects. The properties must belong to the 
    class of hSource.  If hSource is scalar, PropName can include dynamic 
    properties.

    For all forms, listener returns an event.listener.  To remove a
    listener, delete the object returned by listener.  For example,
    delete(el) calls the handle class delete method to remove the listener
    and delete it from the workspace.  Calling delete(el) on the listener
    object deletes the listener, which means the event no longer causes
    the callback function to execute. 

    listener does not bind the listener's lifecycle to the object that is
    the source of the event.  Destroying the source object does not impact
    the lifecycle of the listener object.  A listener created with listener
    must be destroyed independently of the source object.  Calling 
    delete(el) explicitly destroys the listener. Redefining or clearing 
    the variable containing the listener can delete the listener if no 
    other references to it exist.  To tie the lifecycle of the listener to 
    the lifecycle of the source object, use addlistener.

    See also addlistener, event.listener, ndi.setup.ndimaker.stimulusdocmaker, matlab.metadata.Property, events

Help for ndi.setup.NDIMaker.stimulusDocMaker/listener is inherited from superclass handle

lt - < (LT) Less than relation for handles.

H1 < H2 performs element-wise comparisons between handle arrays H1 and
    H2.  H1 and H2 must be of the same dimensions unless one is a scalar.
    The result is a logical array of the same dimensions, where each
    element is an element-wise < result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = LT(H1, H2) stores the result in a logical array of the same 
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/EQ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/NE

Help for ndi.setup.NDIMaker.stimulusDocMaker/lt is inherited from superclass handle

ne - ~= (NE) Not equal relation for handles.

Handles are equal if they are handles for the same object and are 
    unequal otherwise.

    H1 ~= H2 performs element-wise comparisons between handle arrays H1 
    and H2.  H1 and H2 must be of the same dimensions unless one is a 
    scalar.  The result is a logical array of the same dimensions, where 
    each element is an element-wise equality result.

    If one of H1 or H2 is scalar, scalar expansion is performed and the 
    result will match the dimensions of the array that is not scalar.

    TF = NE(H1, H2) stores the result in a logical array of the same
    dimensions.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/EQ, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/GT, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LE, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LT

Help for ndi.setup.NDIMaker.stimulusDocMaker/ne is inherited from superclass handle

notify - NOTIFY Notify listeners of event.

NOTIFY(H, eventname) notifies listeners added to the event named 
    eventname for handle object array H that the event is taking place. 
    eventname can be a string scalar or character vector.  
    H is the array of handles to the event source objects, and 'eventname'
    must be a character vector.

    NOTIFY(H,eventname,ed) provides a way of encapsulating information 
    about an event which can then be accessed by each registered listener.
    ed must belong to the EVENT.EVENTDATA class.

    See also NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/ADDLISTENER, NDI.SETUP.NDIMAKER.STIMULUSDOCMAKER/LISTENER, EVENT.EVENTDATA, EVENTS

Help for ndi.setup.NDIMaker.stimulusDocMaker/notify is inherited from superclass handle

stimulusDocMaker - STIMULUSDOCMAKER Constructor for this class.

Initializes the stimulusDocMaker by loading mixture and bath
    target ontology files specific to the given labName and associating
    it with the provided NDI session.

    Inputs:
        session: An NDI session object (e.g., an instance of
                 ndi.session.dir or ndi.database.dir).
        labName: A character vector specifying the name of the lab.
                 This is used to locate the appropriate ontology files
                 (e.g., 'labName_mixtures.json','labName_bathtargets.json')
                 in the 'NDI-MATLAB/+ndi/+setup/+conv/+labName' folder.

    Optional Name-Value Arguments:
        GetProbes: Runs session.getprobes. Depeneding on the
                 size of the session, this can add significant
                 processing time.

    Outputs:
        obj: An instance of the stimulusDocMaker class.

    Example:
        session = ndi.session.dir('/path/to/my/session');
        labName = 'labName';
        stimulusMaker = ndi.setup.NDIMaker.stimulusDocMaker(session, labName);

    Documentation for ndi.setup.NDIMaker.stimulusDocMaker/stimulusDocMaker
       doc ndi.setup.NDIMaker.stimulusDocMaker

table2approachDocs - TABLE2APPROACHDOCS Converts rows in a table into stimulus approach documents via CREATEAPPROACHDOCS.

Processes a MATLAB table where rows represent experimental epochs.
    For each valid epoch row, it extracts filename and approach
    information, then calls `createApproachDoc` to generate and add
    the corresponding 'stimulus_approach' NDI document(s) to the database.

    Inputs:
        obj: An instance of the stimulusDocMaker class.
        variableTable: A MATLAB table. Rows usually correspond to epochs.
                       Columns specified by `BathVariable`,
                       `MixtureVariable`, and `options.FilenameVariable`
                        are used if they exist.
        approachVariable: The name of the column in 'variableTable'
                       containing the bath target string(s).
                       If the column doesn't exist, this value is used as a fixed
                       approach name string for all processed epochs.

    Optional Name-Value Arguments:
        FilenameVariable: The name of the column in 'variableTable'
                       containing the filename for each epoch, used to derive
                       the NDI 'epochid'. If empty or not provided, defaults 
                       to using the table's 'RowNames'.
        NonNaNVariableNames: Variable names in 'variableTable'. Values in 
                       these columns must not be NaN for a valid epoch.
                       Default: {} (assumes all rows are valid epochs).
        Overwrite: A flag intended to control whether existing documents 
                       should be overwritten. Default: false.

    Outputs:
        docs: A cell array where each cell corresponds to an input epoch row
              processed. Each cell contains another cell array holding the
              'stimulus_approach' NDI document object(s) created for that epoch 
              by `createApproachDoc`.

table2bathDocs - TABLE2BATHDOCS Converts rows in a table into stimulus bath documents via CREATEBATHDOCS.

Processes a MATLAB table where rows represent experimental epochs.
    For each valid epoch row, it extracts filename,bath target, and 
    mixture information, then calls `createBathDoc` to generate
    and add the corresponding 'stimulus_bath' NDI document(s) to the database.

    Inputs:
        obj: An instance of the stimulusDocMaker class.
        variableTable: A MATLAB table. Rows usually correspond to epochs.
                       Columns specified by `BathVariable`,
                       `MixtureVariable`, and `options.FilenameVariable`
                        are used if they exist.
        bathVariable: The name of the column in 'variableTable'
                       containing the bath target string(s).
                       If the column doesn't exist, this value is used as a fixed
                       bath target string for all processed epochs.
        mixtureVariable: The name of the column in 'variableTable'
                       containing the mixture string(s). If the column doesn't exist,
                       this value is used as a fixed mixture string for all epochs.

    Optional Name-Value Arguments:
        FilenameVariable: The name of the column in 'variableTable'
                       containing the filename for each epoch, used to derive
                       the NDI 'epochid'. If empty or not provided, defaults 
                       to using the table's 'RowNames'.
        NonNaNVariableNames: Variable names in 'variableTable'. Values in 
                       these columns must not be NaN for a valid epoch.
                       Default: {} (assumes all rows are valid epochs).
        MixtureDictionary: Struct to map mixture names to keys
                       in 'mixtureStruct'. Dictionary keys are names from data (spaces->'_'),
                       values are the corresponding 'mixtureStruct' key names.
                       Defaults to empty (no mapping). (e.g. 'Pre' -> 'aCSF')
        MixtureDelimeter: Character(s) seperating mixture names
                       (e.g. ',' or ' + '). Default: ','.
        Overwrite: A flag intended to control whether existing documents 
                       should be overwritten. Default: false.

    Outputs:
        docs: A cell array where each cell corresponds to an input epoch row
              processed. Each cell contains another cell array holding the
              'stimulus_bath' NDI document object(s) created for that epoch 
              by `createBathDoc`.