CLASS ndi.calc.vis.temporal_frequency_tuning¶
TEMPORAL_FREQUENCY_TUNING - a temporal_frequency_tuning demonstration of an ndi.calculator object
TEMPORAL_FREQUENCY_TUNING_OBJ = TEMPORAL_FREQUENCY_TUNING(SESSION)
Creates a TEMPORAL_FREQUENCY_TUNING ndi.calculator object
Superclasses¶
ndi.calc.tuning_fit, ndi.calculator, ndi.app, ndi.documentservice, ndi.app.appdoc, ndi.mock.ctest
Properties¶
| Property | Description |
|---|---|
| fast_start | |
| numberOfSelfTests | |
| defaultParametersCanFunction | |
| session | |
| name | |
| doc_types | |
| doc_document_types | |
| doc_session |
Methods¶
| Method | Description |
|---|---|
| add_appdoc | Load data from an application document |
| appdoc_description | a function that prints a description of all appdoc types |
| are_input_parameters_equivalent | are two sets of input parameters equivalent? |
| bring_gui_to_front | ndi.calc.vis.temporal_frequency_tuning.bring_gui_to_front is a function. |
| calc_path | CALC_PATH return the path to the ndi.calculator object |
| calculate | perform the calculator for ndi.calc.example.temporal_frequency_tuning |
| calculate_temporal_frequency_indexes | calculate contrast index values from a tuning curve |
| clean_mock_docs | remove mock/test documents |
| clear_appdoc | remove an ndi.app.appdoc document from a session database |
| compare_mock_docs | compare an expected calculation answer with an actual answer |
| default_parameters_query | what queries should be used to search for input parameters if none are provided? |
| default_search_for_input_parameters | default parameters for searching for inputs |
| defaultstruct_appdoc | return a default appdoc structure for a given APPDOC type |
| doc2struct | create an ndi.document from an input structure and input parameters |
| doc_about | ndi.calc.vis.temporal_frequency_tuning/doc_about is a function. |
| docfiletext | return the text in the requested documentation file |
| find_appdoc | find an ndi.app.appdoc document in the session database |
| find_calculator_subclasses | find all subclasses of ndi.calculator on the MATLAB path |
| generate_mock_docs | generate mock documents and expected answers for tests |
| generate_mock_parameters | generate mock parameters for testing ndi.calc.vis.oridir_tuning |
| get_available_parameters | ndi.calc.vis.temporal_frequency_tuning.get_available_parameters is a function. |
| graphical_edit_calculator | open a graphical editor for an ndi.calculator instance |
| is_valid_dependency_input | is a potential dependency input actually valid for this calculator? |
| isequal_appdoc_struct | are two APPDOC data structures the same (equal)? |
| isvalid_appdoc_struct | is an input structure a valid descriptor for an APPDOC? |
| load_mock_comparison | load comparison object for a calculation |
| load_mock_expected_output | load expected NDI document answer for a calculation |
| load_parameter_code | ndi.calc.vis.temporal_frequency_tuning.load_parameter_code is a function. |
| loaddata_appdoc | Load data from an application document |
| mock_comparison_filename | file of expected NDI document comparison for a calculation |
| mock_expected_filename | file of expected NDI document answer for a calculation |
| mock_path | return the path to the stored mock example output documents |
| newdocument | return a new database document of type ndi.document based on an app |
| parameter_default | ndi.calc.vis.temporal_frequency_tuning.parameter_default is a function. |
| plot | provide a diagnostic plot to show the results of the calculator |
| plot_parameters | provide a diagnostic plot to show the results of the calculator, if appropriate |
| run | run calculator on all possible inputs that match some parameters |
| save_parameter_file | ndi.calc.vis.temporal_frequency_tuning.save_parameter_file is a function. |
| search_for_calculator_docs | search for previous calculators |
| search_for_input_parameters | search for valid inputs to the calculator |
| searchquery | return a search query for an ndi.document related to this app |
| struct2doc | create an ndi.document from an input structure and input parameters |
| temporal_frequency_tuning | a temporal_frequency_tuning demonstration of an ndi.calculator object |
| test | perform a test of an ndi.calculator object |
| user_parameter_template | ndi.calc.vis.temporal_frequency_tuning.user_parameter_template is a function. |
| varappname | return the name of the application for use in variable creation |
| version_url | return the app version and url |
| write_mock_expected_output | write |
Methods help¶
add_appdoc - Load data from an application document
[...] = ADD_APPDOC(NDI_APPDOC_OBJ, APPDOC_TYPE, ...
APPDOC_STRUCT, DOCEXISTSACTION, [additional arguments])
Creates a new ndi.document that is based on the type APPDOC_TYPE with creation data
specified by APPDOC_STRUCT. [additional inputs] are used to find or specify the
NDI_document in the database. They are passed to the function FIND_APPDOC,
so see help FIND_APPDOC for the documentation for each app.
The DOC is returned as a cell array of NDI_DOCUMENTs (should have 1 entry but could have more than
1 if the document already exists).
If APPDOC_STRUCT is empty, then default values are used. If it is a character array, then it is
assumed to be a filename of a tab-separated-value text file. If it is an ndi.document, then it
is assumed to be an ndi.document and it will be converted to the parameters using DOC2STRUCT.
This function also takes a string DOCEXISTSACTION that describes what it should do
in the event that the document fitting the [additional inputs] already exists:
DOCEXISTACTION value | Description
----------------------------------------------------------------------------------
'Error' | An error is generating indicating the document exists.
'NoAction' | The existing document is left alone. The existing ndi.document
| is returned in DOC.
'Replace' | Replace the document; note that this deletes all NDI_DOCUMENTS
| that depend on the original.
'ReplaceIfDifferent' | Conditionally replace the document, but only if the
| the data structures that define the document are not equal.
Help for ndi.calc.vis.temporal_frequency_tuning/add_appdoc is inherited from superclass ndi.app.appdoc
appdoc_description - a function that prints a description of all appdoc types
Every subclass should override this function to describe the APPDOC types available
to the subclass. It should follow the following form.
--------------------
The APPDOCs available to this class are the following:
APPDOC_TYPE | Description
----------------------------------------------------------------------------------------------
'doctype1' | The first app document type.
(in the base class, there are no APPDOCS; in subclasses, the document types should appear here)
(here, 'doctype1' is a dummy example.)
----------------------------------------------------------------------------------------------
APPDOC 1: DOCTYPE1
----------------------------------------------------------------------------------------------
---------------------
| DOCTYPE1 -- ABOUT |
---------------------
DOCTYPE documents store X. It DEPENDS ON documents Y and Z.
Definition: app/myapp/doctype1
--------------------------
| DOCTYPE1 -- CREATION |
--------------------------
DOC = STRUCT2DOC(NDI_APPDOC_OBJ, 'doctype1', DOCTYPE1PARAMS, ...)
DOCTYPE1PARAMS should contain the following fields:
Fieldname | Description
-------------------------------------------------------------------------
field1 | field1 description
overlap | field2 description
------------------------
| DOCTYPE1 - FINDING |
------------------------
[DOCTYPE1_DOC] = FIND_APPDOC(NDI_APPDOC_OBJ, 'doctype1', INPUT1, INPUT2, ...)
INPUTS:
INPUT1 - first input needed to find doctype1 documents
INPUT2 - the second input needed to find doctype1 documents
OUTPUT:
DOCTYPE1_DOC - the ndi.document of the application document DOCTYPE1
------------------------
| DOCTYPE1 - LOADING |
------------------------
[OUTPUT1,OUTPUT2,...,DOCTYPE1_DOC] = LOADDOC_APPDOC(NDI_APPDOC_OBJ, ...
'doctype1', INPUT1, INPUT2,...);
INPUTS:
INPUT1 - first input needed to find doctype1 documents
INPUT2 - the second input needed to find doctype1 documents
OUTPUT:
OUTPUT1 - the first type of loaded data contained in DOCTYPE1 documents
OUTPUT2 - the second type of loaded data contained in DOCTYPE1 documents
(If there were more appdoc types, list them here...)
Help for ndi.calc.vis.temporal_frequency_tuning/appdoc_description is inherited from superclass ndi.app.appdoc
are_input_parameters_equivalent - are two sets of input parameters equivalent?
B = ARE_INPUT_PARAMETERS_EQUIVALENT(NDI_CALCULATOR_OBJ, INPUT_PARAMETERS1, INPUT_PARAMETERS2)
Are two sets of input parameters equivalent? This function is used by
SEARCH_FOR_CALCULATOR_DOCS to determine whether potential documents
were actually generated by identical input parameters.
In the base class, the structures are first re-organized so that all one-dimensional
substructures are columns and then compared with vlt.data.eqlen(INPUT_PARAMETERS1, INPUT_PARAMETERS2).
It is necessary to "columnize" the substructures because Matlab does not not necessarily preserve that
orientation when data is written to or read from JSON.
This function is primarily intended as an internal function but is left exposed
(not private) so that it can be used for debugging. But in general, user code should
not call this function.
bring_gui_to_front - ndi.calc.vis.temporal_frequency_tuning.bring_gui_to_front is a function.
ndi.calc.vis.temporal_frequency_tuning.bring_gui_to_front(fig)
calc_path - CALC_PATH return the path to the ndi.calculator object
P = CALC_PATH(CTEST_OBJ)
Return the path of an ndi.calculator object.
Help for ndi.calc.vis.temporal_frequency_tuning/calc_path is inherited from superclass ndi.mock.ctest
calculate - perform the calculator for ndi.calc.example.temporal_frequency_tuning
DOC = CALCULATE(NDI_CALCULATOR_OBJ, PARAMETERS)
Creates a temporal_frequency_tuning_calc document given input parameters.
The document that is created temporal_frequency_tuning
by the input parameters.
calculate_temporal_frequency_indexes - calculate contrast index values from a tuning curve
TEMPORAL_FREQUENCY_PROPS_DOC = CALCULATE_TEMPORAL_FREQUENCY_INDEXES(NDI_TEMPORAL_FREQUENCY_TUNING_CALC_OBJ, TUNING_DOC)
Given a 1-dimensional tuning curve document, this function calculates contrast response
parameters and stores them in TEMPORAL_FREQUENCY_TUNING document TEMPORAL_FREQUENCY_PROPS_DOC.
clean_mock_docs - remove mock/test documents
Help for ndi.calc.vis.temporal_frequency_tuning/clean_mock_docs is inherited from superclass ndi.mock.ctest
clear_appdoc - remove an ndi.app.appdoc document from a session database
B = CLEAR_APPDOC(NDI_APPDOC_OBJ, APPDOC_TYPE, [additional inputs])
Deletes the app document of style DOC_NAME from the database.
[additional inputs] are used to find the NDI_document in the database.
They are passed to the function FIND_APPDOC, so see help FIND_APPDOC for the documentation
for each app.
B is 1 if the document is found, and 0 otherwise.
Help for ndi.calc.vis.temporal_frequency_tuning/clear_appdoc is inherited from superclass ndi.app.appdoc
compare_mock_docs - compare an expected calculation answer with an actual answer
[B, REPORT] = COMPARE_MOCK_DOCS(CTEST_OBJ, EXPECTED_DOC, ACTUAL_DOC, SCOPE, [DOCCOMPARE])
Given an NDI document with the expected answer to a calculation (EXPECTED_DOC),
the ACTUAL_DOC computed, and the SCOPE (a string: 'highSNR', 'lowSNR'),
this function computes whether the ACTUAL_DOC is within an allowed tolerance of
EXPECTED_DOC.
B is 1 if the differences in the documents are within the tolerance of the class.
Otherwise, B is 0.
If B is 0, REPORT is a string or report structure that indicates where the ACTUAL_DOC is out of tolerance.
In this abstract class, B is always 1 and REPORT is always an empty string.
Developer's note: this method should be overridden in each calculator object.
Help for ndi.calc.vis.temporal_frequency_tuning/compare_mock_docs is inherited from superclass ndi.mock.ctest
default_parameters_query - what queries should be used to search for input parameters if none are provided?
QUERY = DEFAULT_PARAMETERS_QUERY(NDI_CALCULATOR_OBJ, PARAMETERS_SPECIFICATION)
When one calls SEARCH_FOR_INPUT_PARAMETERS, it is possible to specify a 'query' structure to
select particular documents to be placed into the parameters 'depends_on' specification.
If one does not provide any 'query' structure, then the default values here are used.
The function returns:
|-----------------------|----------------------------------------------|
| query | A structure with 'name' and 'query' fields |
| | that describes a search to be performed to |
| | identify inputs for the 'depends_on' field |
| | in the PARAMETERS output. |
|-----------------------|-----------------------------------------------
For the ndi.calc.stimulus.temporal_frequency_tuning_calc class, this looks for
documents of type 'stimulus_response_scalar' with 'response_type' fields
the contain 'mean' or 'F1'.
default_search_for_input_parameters - default parameters for searching for inputs
PARAMETERS = DEFAULT_SEARCH_FOR_INPUT_PARAMETERS(NDI_CALCULATOR_OBJ)
Returns a list of the default search parameters for finding appropriate inputs
to the calculator. For temporal_frequency_tuning_calc, there is no appropriate default parameters
so this search will yield empty.
defaultstruct_appdoc - return a default appdoc structure for a given APPDOC type
APPDOC_STRUCT = DEFAULTSTRUCT_APPDOC(NDI_APPDOC_OBJ, APPDOC_TYPE)
Return the default data structure for a given APPDOC_TYPE of an ndi.app.appdoc object.
In the base class, the blank version of the ndi.document is read in and the
default structure is built from the ndi.document's class property list.
Help for ndi.calc.vis.temporal_frequency_tuning/defaultstruct_appdoc is inherited from superclass ndi.app.appdoc
doc2struct - create an ndi.document from an input structure and input parameters
DOC = STRUCT2DOC(NDI_APPDOC_OBJ, SESSION, APPDOC_TYPE, APPDOC_STRUCT, [additional parameters]
Create an ndi.document from a data structure APPDOC_STRUCT. The ndi.document is created
according to the APPDOC_TYPE of the NDI_APPDOC_OBJ.
In the base class, this uses the property info in the ndi.document to load the data structure.
Help for ndi.calc.vis.temporal_frequency_tuning/doc2struct is inherited from superclass ndi.app.appdoc
doc_about - ndi.calc.vis.temporal_frequency_tuning/doc_about is a function.
text = doc_about(ndi_calculator_obj)
docfiletext - return the text in the requested documentation file
TEXT = ndi.calculator.docfiletext(CALCULATOR_TYPE, DOC_TYPE)
Returns the text of the documentation files.
CALCULATOR_TYPE should be the full object name of the calculator of interest.
(for example: 'ndi.calc.stimulus.tuningcurve' or 'ndi.calc.vis.contrasttuning')
DOC_TYPE should be the type of document requested ('general', 'output', 'searching for inputs')
Example:
text = ndi.calculator.docfiletext('ndi.calc.stimulus.tuningcurve','general');
find_appdoc - find an ndi.app.appdoc document in the session database
DOC = FIND_APPDOC(NDI_APPDOC_OBJ, APPDOC_TYPE, [additional inputs])
Using search criteria that is supported by [additional inputs], FIND_APPDOC
searches the database for the ndi.document object DOC that is
described by APPDOC_TYPE.
DOC is always a cell array of all matching NDI_DOCUMENTs.
In this superclass, empty is always returned. Subclasses should override
this function to search for each document type.
The documentation for subclasses should be in the overridden function
APPDOC_DESCRIPTION.
Help for ndi.calc.vis.temporal_frequency_tuning/find_appdoc is inherited from superclass ndi.app.appdoc
find_calculator_subclasses - find all subclasses of ndi.calculator on the MATLAB path
CLASSNAMES = ndi.calculator.find_calculator_subclasses()
CLASSNAMES = ndi.calculator.find_calculator_subclasses('ClearCache', true)
Searches the MATLAB path for all classes under the ndi.calc namespace
that are subclasses of ndi.calculator. Returns a column cell array of character arrays of
fully-qualified class names (e.g., 'ndi.calc.example.simple').
The results are cached in a persistent variable. Set 'ClearCache' to
true to clear the cache and re-scan.
generate_mock_docs - generate mock documents and expected answers for tests
[DOCS, DOC_OUTPUT, DOC_EXPECTED_OUTPUT] = GENERATE_MOCK_DOCS(OBJ, ...
SCOPE, NUMBER_OF_TESTS, ...)
Creates a set of documents to test the calculator.
SCOPE is the scope to be tested: 'highSNR' or 'lowSNR'
NUMBER_OF_TESTS indicates the number of tests to be performed.
DOCS{i} is the set of helper documents that may have been created
in generating the ith test.
DOC_OUTPUT{i} is the actual output of the calculator when operating on
DOCS{i} (the ith test).
DOC_EXPECTED_OUTPUT{i} is what the output of the calculator should be, if there
were no noise.
The quality of these outputs are evaluted using the function COMPARE_MOCK_DOCS
as part of the TEST function for ndi.calculator objects.
This function's behavior can be modified by name/value pairs.
--------------------------------------------------------------------------------
| Parameter (default): | Description: |
|--------------------------|---------------------------------------------------|
| generate_expected_docs(0)| Should we generate the expected docs? (That is, |
| | generate the "right answer"?) Use carefully. |
| specific_test_inds([]) | A vector of test indices to run. If empty, all |
| | tests are run. DOCS and DOC_OUTPUT will have |
| | empty entries for skipped tests, but |
| | DOC_EXPECTED_OUTPUT will be populated. |
|--------------------------|---------------------------------------------------|
Help for ndi.calc.vis.temporal_frequency_tuning/generate_mock_docs is inherited from superclass ndi.calc.tuning_fit
generate_mock_parameters - generate mock parameters for testing ndi.calc.vis.oridir_tuning
[PARAM_STRUCT, INDEPENDENT_VARIABLE, X, R] = GENERATE_MOCK_PARAMETERS(OBJ, SCOPE, INDEX)
Generates a parameter set for generating a mock document with a given index value.
P will be a row vector of parameters [a1 b1 a2 b2].
SCOPE can be 'standard', 'low_noise', or 'high_noise'.
INDEX selects which parameters are used to generate a mock document
add options for different scopes - see issue #27
get_available_parameters - ndi.calc.vis.temporal_frequency_tuning.get_available_parameters is a function.
params = ndi.calc.vis.temporal_frequency_tuning.get_available_parameters(classname, root_dir)
graphical_edit_calculator - open a graphical editor for an ndi.calculator instance
ndi.calculator.graphical_edit_calculator('command', COMMAND, ...)
Opens or controls a GUI window for editing ndi.calculator parameters,
viewing documentation, running calculators, and managing saved parameter
files. The editor allows the user to interactively configure and execute
an ndi.calculator on an ndi.session.
The GUI provides the following sections:
- Documentation panel: displays general, input, or output documentation
for the selected calculator class.
- Parameter code editor: edit MATLAB code that defines the 'parameters'
struct used by the calculator. Saved parameter sets can be loaded from
a dropdown or created via 'Save As'.
- Commands dropdown: search for inputs, show/plot existing outputs, or
run the calculator with the current parameters.
- Buttons: Save, Save As, Delete, Refresh, and Exit.
This function takes input arguments as name/value pairs:
|-------------------------------|----------------------------------------------|
| Parameter (default) | Description |
|-------------------------------|----------------------------------------------|
| command ('New') | The GUI command to execute. Valid values: |
| | 'New' - open a new editor window |
| | 'Edit' - open editor for existing params |
| | 'Close' - close the editor window |
|-------------------------------|----------------------------------------------|
| session ([]) | An ndi.session object. Required for commands |
| | that search or run the calculator. |
|-------------------------------|----------------------------------------------|
| name ('') | The instance name for the calculator. |
|-------------------------------|----------------------------------------------|
| calculatorClassname ('') | The full classname of the calculator |
| | (e.g., 'ndi.calc.stimulus.tuningcurve'). |
|-------------------------------|----------------------------------------------|
| window_params | A struct with fields 'height' and 'width' |
| (struct('height',450, | specifying the figure window size in pixels. |
| 'width',700)) | |
|-------------------------------|----------------------------------------------|
| fig ([]) | A figure handle. If empty, a new figure is |
| | created for 'New' or 'Edit' commands. |
|-------------------------------|----------------------------------------------|
| pipelinePath ('') | Path to a pipeline directory for loading and |
| | saving parameter files. |
|-------------------------------|----------------------------------------------|
| paramName ('') | Name of a saved parameter set to load on |
| | startup. |
|-------------------------------|----------------------------------------------|
Examples:
% Open a new editor for a tuningcurve calculator:
ndi.calculator.graphical_edit_calculator('command', 'New', ...
'calculatorClassname', 'ndi.calc.stimulus.tuningcurve', ...
'name', 'mytc', 'session', S);
% Open an editor with a specific saved parameter set:
ndi.calculator.graphical_edit_calculator('command', 'Edit', ...
'calculatorClassname', 'ndi.calc.stimulus.tuningcurve', ...
'name', 'mytc', 'session', S, 'paramName', 'default');
See also: ndi.calc.vis.temporal_frequency_tuning, ndi.calc.vis.temporal_frequency_tuning.run, ndi.calc.vis.temporal_frequency_tuning.docfiletext,
ndi.calc.vis.temporal_frequency_tuning.get_available_parameters, ndi.cpipeline.edit
is_valid_dependency_input - is a potential dependency input actually valid for this calculator?
B = IS_VALID_DEPENDENCY_INPUT(NDI_CALCULATOR_OBJ, NAME, VALUE)
Tests whether a potential input to a calculator is valid.
The potential dependency name is provided in NAME and its base id is
provided in VALUE.
The base class behavior of this function is simply to return true, but it
can be overriden if additional criteria beyond an ndi.query are needed to
assess if a document is an appropriate input for the calculator.
isequal_appdoc_struct - are two APPDOC data structures the same (equal)?
B = ISEQUAL_APPDOC_STRUCT(NDI_APPDOC_OBJ, APPDOC_TYPE, APPDOC_STRUCT1, APPDOC_STRUCT2)
Returns 1 if the structures APPDOC_STRUCT1 and APPDOC_STRUCT2 are valid and equal. In the base class, this is
true if APPDOC_STRUCT1 and APPDOC_STRUCT2 have the same field names and same values and same sizes. That is,
B is vlt.data.eqlen(APPDOC_STRUCT1, APPDOC_STRUCT2).
Help for ndi.calc.vis.temporal_frequency_tuning/isequal_appdoc_struct is inherited from superclass ndi.app.appdoc
isvalid_appdoc_struct - is an input structure a valid descriptor for an APPDOC?
[B,ERRORMSG] = ISVALID_APPDOC_STRUCT(NDI_APPDOC_OBJ, APPDOC_TYPE, APPDOC_STRUCT)
Examines APPDOC_STRUCT and determines whether it is a valid input for creating an
ndi.document described by APPDOC_TYPE. B is 1 if it is valid and 0 otherwise.
In the base class, B is always 0 with ERRORMSG 'Base class always returns invalid.'
Help for ndi.calc.vis.temporal_frequency_tuning/isvalid_appdoc_struct is inherited from superclass ndi.app.appdoc
load_mock_comparison - load comparison object for a calculation
DOCCOMPARE = LOAD_MOCK_COMPARISON(CTEST_OBJ, N)
Load the Nth stored ndi.database.doctools.docComparison object that contains the
comparison parameters for the Nth standard mock test.
If the file does not exist, empty is returned.
Help for ndi.calc.vis.temporal_frequency_tuning/load_mock_comparison is inherited from superclass ndi.mock.ctest
load_mock_expected_output - load expected NDI document answer for a calculation
DOC = LOAD_MOCK_EXPECTED_OUTPUT(CTEST_OBJ, N)
Load the Nth stored ndi.document that contains the expected answer for the
Nth standard mock test.
Help for ndi.calc.vis.temporal_frequency_tuning/load_mock_expected_output is inherited from superclass ndi.mock.ctest
load_parameter_code - ndi.calc.vis.temporal_frequency_tuning.load_parameter_code is a function.
code = ndi.calc.vis.temporal_frequency_tuning.load_parameter_code(classname, param_name, root_dir)
loaddata_appdoc - Load data from an application document
[...] = LOADDATA_APPDOC(NDI_APPDOC_OBJ, APPDOC_TYPE, [additional arguments])
Loads the data from app document of style DOC_NAME from the database.
[additional inputs] are used to find the NDI_document in the database.
They are passed to the function FIND_APPDOC, so see help FIND_APPDOC for the documentation
for each app.
In the base class, this always returns empty. This function should be overridden by each
subclass.
The documentation for subclasses should be in the overridden function APPDOC_DESCRIPTION.
Help for ndi.calc.vis.temporal_frequency_tuning/loaddata_appdoc is inherited from superclass ndi.app.appdoc
mock_comparison_filename - file of expected NDI document comparison for a calculation
FNAME = MOCK_COMPARISON_FILENAME(CTEST_OBJ, N)
Return the filename for the Nth stored ndi.database.doctools.docComparison JSON object
that contains the comparison parameters for the Nth standard mock test.
Help for ndi.calc.vis.temporal_frequency_tuning/mock_comparison_filename is inherited from superclass ndi.mock.ctest
mock_expected_filename - file of expected NDI document answer for a calculation
FNAME = MOCK_EXPECTED_FILENAME(CTEST_OBJ, N)
Return the filename for the Nth stored ndi.document that contains the expected
answer for the Nth standard mock test.
Help for ndi.calc.vis.temporal_frequency_tuning/mock_expected_filename is inherited from superclass ndi.mock.ctest
mock_path - return the path to the stored mock example output documents
MP = MOCK_PATH(CTEST_OBJ)
Returns the path to the mock document example outputs.
The returned path ends in a file separator.
Help for ndi.calc.vis.temporal_frequency_tuning/mock_path is inherited from superclass ndi.mock.ctest
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 'app'. The 'app.name' field
is filled out with the name of NDI_APP_OBJ.VARAPPNAME().
Help for ndi.calc.vis.temporal_frequency_tuning/newdocument is inherited from superclass ndi.app
parameter_default - ndi.calc.vis.temporal_frequency_tuning.parameter_default is a function.
contents = ndi.calc.vis.temporal_frequency_tuning.parameter_default(calculator_type)
plot - provide a diagnostic plot to show the results of the calculator
H=PLOT(NDI_CALCULATOR_OBJ, DOC_OR_PARAMETERS, ...)
Produce a plot of the tuning curve.
Handles to the figure, the axes, and any objects created are returned in H.
This function takes additional input arguments as name/value pairs.
See ndi.calculator.plot_parameters for a description of many parameters.
Also takes:
|----------------------|-------------------------------------------------------|
| Parameter (default) | Description |
|----------------------|-------------------------------------------------------|
| useAbsolute (0) | Plot the absolute value of the responses and fits of |
| | absolute value. |
|----------------------|-------------------------------------------------------|
plot_parameters - provide a diagnostic plot to show the results of the calculator, if appropriate
PLOT_PARAMETERS(NDI_CALCULATOR_OBJ, DOC_OR_PARAMETERS, ...)
Produce a diagnostic plot that can indicate to a reader whether or not
the calculator has been performed in a manner that makes sense with
its input data. Useful for debugging / validating a calculator.
By default, this plot is made in the current axes.
This function takes additional input arguments as name/value pairs:
|---------------------------|--------------------------------------|
| Parameter (default) | Description |
|---------------------------|--------------------------------------|
| newfigure (0) | 0/1 Should we make a new figure? |
| holdstate (0) | 0/1 Should we preserve the 'hold' |
| | state of the current axes? |
| suppress_x_label (0) | 0/1 Should we suppress the x label? |
| suppress_y_label (0) | 0/1 Should we suppress the y label? |
| suppress_z_label (0) | 0/1 Should we suppress the z label? |
| suppress_title (0) | 0/1 Should we suppress the title? |
|---------------------------|--------------------------------------|
run - run calculator on all possible inputs that match some parameters
DOCS = RUN(NDI_CALCULATOR_OBJ, DOCEXISTSACTION, PARAMETERS)
DOCEXISTSACTION can be 'Error', 'NoAction', 'Replace', or 'ReplaceIfDifferent'
For calculators, 'ReplaceIfDifferent' is equivalent to 'NoAction' because
the input parameters define the calculator.
This function is primarily intended to be called by external programs and users.
save_parameter_file - ndi.calc.vis.temporal_frequency_tuning.save_parameter_file is a function.
ndi.calc.vis.temporal_frequency_tuning.save_parameter_file(classname, param_name, code, root_dir)
search_for_calculator_docs - search for previous calculators
[DOCS] = SEARCH_FOR_CALCULATOR_DOCS(NDI_CALCULATOR_OBJ, PARAMETERS)
Performs a search to find all previously-created calculator
documents that this mini-app creates.
PARAMETERS is a structure with the following fields
|------------------------|----------------------------------|
| Fieldname | Description |
|-----------------------------------------------------------|
| input_parameters | A structure of input parameters |
| | needed by the calculator. |
| depends_on | A structure with fields 'name' |
| | and 'value' that indicates any |
| | exact matches that should be |
| | satisfied. |
|------------------------|----------------------------------|
in the abstract class, this returns empty
This function is primarily intended as an internal function but is left exposed
(not private) so that it can be used for debugging. But in general, user code should
not call this function.
search_for_input_parameters - search for valid inputs to the calculator
PARAMETERS = SEARCH_FOR_INPUT_PARAMETERS(NDI_CALCULATOR_OBJ, PARAMETERS_SPECIFICATION)
Identifies all possible sets of specific input PARAMETERS that can be
used as inputs to the calculator. PARAMETERS is a cell array of parameter
structures with fields 'input_parameters' and 'depends_on'.
This function is primarily intended as an internal function but is left exposed
(not private) so that it can be used for debugging. But in general, user code should
not call this function.
PARAMETERS_SPECIFICATION is a structure with the following fields:
|----------------------------------------------------------------------|
| input_parameters | A structure of fixed input parameters needed |
| | by the calculator. Should not depend on |
| | values in other documents. |
| depends_on | A structure with 'name' and 'value' fields |
| | that lists specific inputs that should be |
| | used for the 'depends_on' field in the |
| | PARAMETERS output. |
| query | A structure with 'name' and 'query' fields |
| | that describes a search to be performed to |
| | identify inputs for the 'depends_on' field |
| | in the PARAMETERS output. |
|-----------------------|-----------------------------------------------
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.calc.vis.temporal_frequency_tuning/searchquery is inherited from superclass ndi.app
struct2doc - create an ndi.document from an input structure and input parameters
DOC = STRUCT2DOC(NDI_APPDOC_OBJ, APPDOC_TYPE, APPDOC_STRUCT, [additional parameters]
Create an ndi.document from a data structure APPDOC_STRUCT. The ndi.document is created
according to the APPDOC_TYPE of the NDI_APPDOC_OBJ.
In the base class, this always returns empty. It must be overridden in subclasses.
The documentation for overridden functions should be in the function APPDOC_DESCRIPTION.
Help for ndi.calc.vis.temporal_frequency_tuning/struct2doc is inherited from superclass ndi.app.appdoc
temporal_frequency_tuning - a temporal_frequency_tuning demonstration of an ndi.calculator object
TEMPORAL_FREQUENCY_TUNING_OBJ = TEMPORAL_FREQUENCY_TUNING(SESSION)
Creates a TEMPORAL_FREQUENCY_TUNING ndi.calculator object
Documentation for ndi.calc.vis.temporal_frequency_tuning/temporal_frequency_tuning
doc ndi.calc.vis.temporal_frequency_tuning
test - perform a test of an ndi.calculator object
[B, REPORTS, B_EXPECTED] = test(CTEST_OBJ, SCOPE, NUMBER_OF_TESTS, PLOT_IT, ...)
Perform tests of the calculator for a certain SCOPE.
B is a NUMBER_OF_TESTS x NUMBER_OF_TESTS array of whether the comparisons
of the expected output of test i and actual output of test j are equal.
Generally, b(i,i) should be 1 for all tests, and b(i,j) for i~=j should
be 0, although results might be close enough for some comparisons to be
equal even if there are no errors. If test indices are
specified, B becomes a numel(specific_test_inds) x
numel(specific_test_inds) array.
REPORTS{i,j} is a structure array of reports from docCompare given if the comparison between the
expected outcome of test i and the actual outcome of test j.
B_EXPECTED is the result of the comparisons between the expected
outcome of test i and the expected outcome of test j. Some tests
might have the same expected outcome, which can be useful for
interpreting the results in B.
SCOPE should be one of 'highSNR' or 'lowSNR'.
'highSNR' performs tests on specific hard-coded inputs.
'lowSNR' performs tests on specific hard-coded inputs with noise added.
NUMBER_OF_TESTS indicates the number of tests to perform.
PLOT_IT indicates (0/1) whether or not the results should be plotted.
This function's behavior can be modified by name/value pairs.
--------------------------------------------------------------------------------
| Parameter (default): | Description: |
|--------------------------|---------------------------------------------------|
| specific_test_inds([]) | Should we specify which tests to run? |
|--------------------------|---------------------------------------------------|
Help for ndi.calc.vis.temporal_frequency_tuning/test is inherited from superclass ndi.mock.ctest
user_parameter_template - ndi.calc.vis.temporal_frequency_tuning.user_parameter_template is a function.
contents = ndi.calc.vis.temporal_frequency_tuning.user_parameter_template(calculator_type)
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.calc.vis.temporal_frequency_tuning/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.calc.vis.temporal_frequency_tuning/version_url is inherited from superclass ndi.app
write_mock_expected_output - write
B = WRITE_MOCK_EXPECTED_OUTPUT(CTEST_OBJ, NUMBER, DOC)
Set the expected mock document for mock calculation NUMBER to
be the ndi.document DOC.
This function will not overwrite an existing expected mock document.
It must be deleted manually to ensure programmer really wants to overwrite it.
Help for ndi.calc.vis.temporal_frequency_tuning/write_mock_expected_output is inherited from superclass ndi.mock.ctest