-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for NEST circuits (and spikes visualization) #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of comments...more are coming, but I think it's better to sit together and discuss.
@@ -101,6 +97,10 @@ void BraynsViewer::keypress(char key, const Vector2f& where) | |||
BRAYNS_INFO << "Default renderer activated" << std::endl; | |||
renderingParams.setRenderer("exobj"); | |||
break; | |||
case '7': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start thinking about this hotkeys madness... soon we'll need bigger keyboards :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! I think the nice way to do it is to create a 'key manager' than can be shared between the UI and Deflect so that we get the same interaction on all displays. TODO then ;-)
size_t ts = _brayns->getParametersManager().getSceneParameters().getTimestamp(); | ||
if( ts != std::numeric_limits<size_t>::max() ) | ||
float ts = _brayns->getParametersManager().getSceneParameters().getTimestamp(); | ||
if( ts != std::numeric_limits< float >::max() ) | ||
ss << " (frame " << ts << ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is a float now because it contains the actual timestamp instead of the frame number. If that's the case, the message should also be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the timestamp as a float, rather than a frame as a int. In any simulation, what is interesting is the timestamp.
@@ -35,6 +35,7 @@ void FlyingModeManipulator::keypress( int32 key ) | |||
{ | |||
const float fwd = _window.getMotionSpeed(); | |||
viewport.translate( dir*fwd, true ); | |||
std::cout << viewport << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch...
{ | ||
SceneParameters& sceneParameters = | ||
_parametersManager->getSceneParameters(); | ||
const std::string& transferFunctionFilename = | ||
sceneParameters.getTransferFunctionFilename(); | ||
if( !transferFunctionFilename.empty() ) | ||
{ | ||
TransferFunctionLoader transferFunctionLoader; | ||
TransferFunctionLoader transferFunctionLoader( | ||
brayns::Vector2f( -92.0915, 49.5497 )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -94,7 +102,7 @@ class GeometryParameters : public AbstractParameters | |||
float getRadiusMultiplier( ) const { return _radiusMultiplier; } | |||
|
|||
/** Radius correction applied to spheres and cylinders. | |||
* @param value Radius value. The radius contained in the data source is | |||
* @param value Radius vPARAM_SIMULATION_CACHE_FILENAMEalue. The radius contained in the data source is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow...
@@ -731,35 +730,38 @@ void OSPRayScene::commitSimulationData() | |||
const uint64_t frame = _sceneParameters.getTimestamp(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not float?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, float...
@@ -99,9 +102,15 @@ struct Brayns::Impl | |||
{ | |||
GeometryParameters& geometryParameters = | |||
_parametersManager->getGeometryParameters(); | |||
if(!geometryParameters.getSimulationCacheFile().empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this is already checked inside the function, so we could remove it from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if(!geometryParameters.getMorphologyFolder().empty()) | ||
_loadMorphologyFolder(); | ||
|
||
if(!geometryParameters.getNESTCircuit().empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if( !circuit.empty( )) | ||
{ | ||
size_t nbMaterials; | ||
NESTLoader* loader( new NESTLoader( geometryParameters )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a smart ptr here too? Same as others that are typedef'd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, no need for a pointer at all... Removed it.
namespace zerobuf.data; | ||
|
||
// Spikes activated for a given timestamp | ||
table Spikes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, but will eventually.
{ | ||
BRAYNS_PROGRESS( gid, _frameSize ); | ||
const size_t index = | ||
int(xColor[gid]) + int(yColor[gid] * 256) + int(zColor[gid] * 65536); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explain why it's like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
for( size_t i = 0; i < _nbElements; ++i ) | ||
{ | ||
const float time = _values[ i ]; | ||
// whith the next check, simulation only plays forward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it like this so the loading could be faster, considering only timestamps bigger than current. But now you can only play the simulation forward. If that's ok it should be documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go for the timestamp, that makes everything more consistent, externally and internally. Modifications done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I mean the if-clause at line 235. I added the if to spend less time reading the file, which I found slow. And if you keep it, it will only play the simulation nicely in one direction (forward).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see what you mean. The only way to play the simulation backwards is to store the actual value of the spike intensity in the cache file itself, instead of computing it in the shader. Problem in doing this is that the speed of the decay will be stored in the cache file and cannot be changed at runtime. AFAIK, the simulation is always played forward. I suggest we keep the current implementation and document it. Ok with you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I don't see the need of playing backwards for now.
|
||
// we store the frame on which the spike happens, as the renderer keeps | ||
// track of the current frame (not timestamp) | ||
_spikingTimes[ gid ] = time / NEST_TIMESTEP; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Times or frames, up to you (I think I prefer frames internally). But it should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* @param filename File containing the circuit | ||
* @param scene Scene in which spheres should be added | ||
*/ | ||
void importCircuit( const std::string& filename, Scene& scene, size_t& nbMaterials ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doxygen nbMaterials
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* @param filename File containing the report | ||
* @param scene Scene to which the simulation should be attached | ||
*/ | ||
bool importSpikeReport( const std::string& filename, Scene& scene ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doxygen return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -334,6 +367,30 @@ bool ZeroEQPlugin::_requestFrameBuffers() | |||
return true; | |||
} | |||
|
|||
bool ZeroEQPlugin::_requestSpikes() | |||
{ | |||
BRAYNS_INFO << "Spikes requested" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware this was already in place. Was it tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really for now. We need a data provider service that does not yet exist. Experimental for now.
Retest this please |
5c190ad
to
3f54e65
Compare
Conflicts: brayns/io/MorphologyLoader.cpp tests/brayns.cpp
No description provided.