Skip to content

CLASS ndi.app.markgarbage

  ndi.app.markgarbage - an application for marking portions of recordings as "garbage" that shouldn't be analyzed

  **Example 1**: Mark a time period as VALID (the rest of the interval is "garbage"), on an ndi.element E from ndi.session S

    G = ndi.app.markgarbage(S); % create app instance
    epoch_id = 'myepochid';
    timeref = ndi.time.timereference(E, 'dev_local_time', epoch_id, 0); % time reference is local time on ndi.element E
    t0 = 10; t1 = 100; % mark from 10 to 100 seconds as valid
    G.markvalidinterval(E, t0, timeref, t1, timeref); 

  **Example 2**: Clear previously marked garbage periods on an ndi.element E from ndi.session S

    G = ndi.app.markgarbage(S); % create app instance
    G.clearvalidinterval(E);

Superclasses

ndi.app, ndi.documentservice

Properties

Property Description
session
name

Methods

Method Description
clearvalidinterval clear all 'valid_interval' records for an ndi.epoch.epochset from session database
identifyvalidintervals identify valid region within an interval
loadvalidinterval Load all valid interval records from session database
markgarbage an app to help exclude garbage data from sessions
markvalidinterval mark a valid intervalin an epoch (all else is garbage)
newdocument return a new database document of type ndi.document based on an app
savevalidinterval save a valid interval structure to the session database
searchquery return a search query for an ndi.document related to this app
varappname return the name of the application for use in variable creation
version_url return the app version and url

Methods help

clearvalidinterval - clear all 'valid_interval' records for an ndi.epoch.epochset from session database

B = CLEARVALIDINTERVAL(NDI_APP_MARKGARBAGE_OBJ, NDI_EPOCHSET_OBJ)

  Clears all valid interval entries from the session database for object NDI_EPOCHSET_OBJ.

  Returns 1 on success, 0 otherwise.

  See also: ndi.app.markgarbage/MARKVALIDINTERVAL, ndi.app.markgarbage/SAVEALIDINTERVAL, ...
       ndi.app.markgarbage/LOADVALIDINTERVAL

identifyvalidintervals - identify valid region within an interval

INTERVALS = IDENTIFYVALIDINTERVALS(NDI_APP_MARKGARBAGE_OBJ, NDI_EPOCHSET_OBJ, TIMEREF, T0, T1)

  Examines whether there is a stored 'validinterval' variable by the app 'ndi.app.markgarbage' for
  this NDI_EPOCHSET_OBJ, and, if so, returns valid intervals [t1_0 t1_1; t2_0 t2_1; ...] indicating
  valid snips of data within the range T0 T1 (with respect to ndi.time.timereference object TIMEREF).
  INTERVALS has time with respect to TIMEREF.

  disp(['Call of identifyvalidintervals..']);

loadvalidinterval - Load all valid interval records from session database

[VI,MYDOC] = LOADVALIDINTERVAL(NDI_APP_MARKGARBAGE_OBJ, NDI_EPOCHSET_OBJ)

  Loads stored valid interval records generated by ndi.app.markgarbage/MAKEVALIDINTERVAL

  MYDOC is the ndi.document that was loaded.

markgarbage - an app to help exclude garbage data from sessions

NDI_APP_MARKGARBAGE_OBJ = ndi.app.markgarbage(SESSION)

  Creates a new ndi.app.markgarbage object that can operate on
  NDI_SESSIONS. The app is named 'ndi.app.markgarbage'.

markvalidinterval - mark a valid intervalin an epoch (all else is garbage)

B = MARKVALIDINTERVAL(NDI_APP_MARKGARBAGE_APP, NDI_EPOCHSET_OBJ, T0, TIMEREF_T0, ...
    T1, TIMEREF_T1)

  Saves a variable marking a valid interval from T0 to T1 with respect
  to an ndi.time.timereference object TIMEREF_T0 (for T0) and TIMEREF_T1 (for T1) for
  an ndi.epoch.epochset object NDI_EPOCHSET_OBJ.  Examples of ndi.epoch.epochset objects include
  ndi.daq.system and ndi.probe and their subclasses.

  TIMEREF_T0 and TIMEREF_T1 are saved as a name and type for looking up later.

  developer note: might be good idea to make sure these times exist at saving

newdocument - return a new database document of type ndi.document based on an app

NDI_DOCUMENT_OBJ = NEWDOCUMENT(NDI_APP_OBJ)

  Creates a blank ndi.document object of type 'ndi_document_app'. The 'app.name' field
  is filled out with the name of NDI_APP_OBJ.VARAPPNAME().

Help for ndi.app.markgarbage/newdocument is inherited from superclass NDI.APP

savevalidinterval - save a valid interval structure to the session database

B = SAVEVALIDINTERVAL(NDI_APP_MARKGARBAGE_OBJ, NDI_EPOCHSET_OBJ, VALIDINTERVALSTRUCT)

  Saves a VALIDINTERVALSTRUCT to an experment database, in the appropriate place for
  the NDI_EPOCHSET_OBJ data.

  If the entry is a duplicate, it is not saved but b is still 1.

searchquery - return a search query for an ndi.document related to this app

C = SEARCHQUERY(NDI_APP_OBJ)

  Returns a cell array of strings that allow the creation or searching of an
  ndi.database document for this app with field 'app' that has subfield 'name' equal
  to the app's VARAPPNAME.

Help for ndi.app.markgarbage/searchquery is inherited from superclass NDI.APP

varappname - return the name of the application for use in variable creation

AN = VARAPPNAME(NDI_APP_OBJ)

  Returns the name of the app modified for use as a variable name, either as
  a Matlab variable or a name in a document.

Help for ndi.app.markgarbage/varappname is inherited from superclass NDI.APP

version_url - return the app version and url

[V, URL] = VERSION_URL(NDI_APP_OBJ)

  Return the version and url for the current app. In the base class,
  it is assumed that GIT is used and is available from the command line
  and the version and url are read from the git directory.

  Developers should override this method in their own class if they use a 
  different version control system.

Help for ndi.app.markgarbage/version_url is inherited from superclass NDI.APP