Open data specifications and software for neurophysiology |
This page gives details about using neuroshare libraries in your C code.
Everything is an entity, and there are 4 types of entities: Segment, Event, Analog and Neural Events.
Almost all data is organized using the same pattern. An example is likely the easist to follow.
Lets say we are interested in finding the 3rd data point, of the 2nd entity in the 1st file. Then:
Most applications using neuroshare data will act the same way. In particular the following steps will be done:
Every pointer value is allowed to be NULL. A value of NULL means that this information is not to be returned. In particular this means it is perfectly valid to do a call to ns_GetFileInfo with the Info pointer set to NULL. This would not be useful, but it is allowed and no error would be generated.
In the function ns_GetAnalogData you pass in the size of the buffer and get back the number of points until a gap is found. Lets say you have 100 points, a gap, then 100 more points. If you ask for 200 points, you will get just that. 200 points, and the num-of-points-until-a-gap will be set to 100. If as a consumer of a dll, you choose to ignore that the 2nd hundred points really are there (as is more natural), and then do a call for the 100 points starting at point 101, that is your prerogative. This weirdness is a potential gotcha for people who create DLLs.
The DLL tester will allow you see your data. It will not graph data, but does allow you to verify what the values should be. It is GUI based and easy to understand.
The file main.cpp is part of our very simple test of using a neuroshare dll. We hope you find it useful.
BACK TO TOP | Comments/Suggestions to webmaster@neuroshare.org Copyright (C) 2001-2011 neuroshare.org, All rights reserved. |