This module will be imported by the experiment script (i.e. client) running in the cloud and provide the interfaces for all functionality provided to the client by the rt-cloud projectServer.
The client script instantiates a clientInterface object. It will automatically connect to the projectServer running on the localhost (i.e. same host as the client). If a connection is established the interfaces listed below will be stubs that forward requests to remote servers that will handle the requsts. If the connection fails (i.e. there is no projectServer running), then local versions of the services will be instantiated, for example to access local files instead of remote files. The user will be prompted if local versions will be used.
- Client Service Interfaces provided (i.e. for the classification script client):
dataInterface - to read and write files from the remote server subjectInterface - to send subject feedback and receive responses webInterface - to set browser messages, update plots, send/receive configs
This class provides the API that an experiment script can use to communicate with the
Rpyc commands return a rpyc.core.netref object to as a reference to the remote object.
- class rtCommon.clientInterface.ClientInterface(rpyc_timeout=120, yesToPrompts=False)
This class provides the API that an experiment script can use to communicate with the project server. It provides both a DataInterface for reading or writing files, and a SubjectInterface for sending/receiving feedback and response to the subject in the MRI scanner.
Will return false if either no project server is running, or if a projectServer is running with data being served locally by the projectServer (remember that the projectServer and classification client script always run on the same computer).
Same semantics as isDataRemote above.
- class rtCommon.clientInterface.WrapRpycObject(rpycObject)
Rpyc commands return a rpyc.core.netref object to as a reference to the remote object. This class wraps all calls to the remote in order to dereference the rpyc.core.netref and return the actual object using rpyc.classic.obtain(ref)
Return getattr(self, name).