Пример #1
0
    Impl( EventSource& output, const URIHandler& params )
        : _output( output )
        , _report( params.getConfig().getReportSource( params.getReport( )),
                   brion::MODE_READ, params.getGIDs( ))
    {
        const brain::Circuit circuit( params.getConfig( ));
        const auto morphologies = circuit.loadMorphologies(
            params.getGIDs(), brain::Circuit::COORDINATES_GLOBAL );

        helpers::addCompartmentEvents( morphologies, _report, output );
    }
Пример #2
0
    Impl( EventSource& output, const URIHandler& params )
        : _output( output )
        , _report( params.getConfig().getReportSource( params.getReport( )),
                   brion::MODE_READ, params.getGIDs( ))
    {
        const brain::Circuit circuit( params.getConfig( ));
        const auto morphologies = circuit.loadMorphologies(
            params.getGIDs(), brain::Circuit::Coordinates::global );

        // add soma events only
        helpers::addCompartmentEvents( morphologies, _report, output, true );
    }
Пример #3
0
    Impl( EventSource& output, const URIHandler& params )
        : _output( output )
        , _duration( params.getDuration( ))
        , _spikesStart( 0.f )
        , _spikesEnd( 0.f )
    {
        const brion::GIDSet& gids = params.getGIDs();

        const brain::Circuit circuit( params.getConfig( ));
        const brion::Vector3fs& positions = circuit.getPositions( gids );

        size_t i = 0;
        _gidIndex.resize( *gids.rbegin() + 1 );
        for( const uint32_t gid: gids )
        {
            _output.add( Event( positions[ i ], VALUE_UNSET ));
            _gidIndex[gid] = i++;
        }
        _spikesPerNeuron.resize( gids.size( ));
        const std::string& spikePath = params.getSpikes();
        _loadSpikes( spikePath.empty() ? params.getConfig().getSpikeSource() :
                                         brion::URI( spikePath ));

    }
Пример #4
0
    explicit Impl( const URI& parameters )
        : uri( parameters )
        , useTestData( false )
    {
        if( getType() == VolumeType::test )
            return;

#ifdef FIVOX_USE_BBPTESTDATA
        useTestData = uri.getPath().empty( );
        config.reset( new brion::BlueConfig( useTestData ? BBP_TEST_BLUECONFIG3
                                                         : uri.getPath( )));
#else
        config.reset( new brion::BlueConfig( uri.getPath( )));
#endif

        const brain::Circuit circuit( *config );
        const std::string target = _get( "target", _get( "postTarget",
                         useTestData ? "mini50" : config->getCircuitTarget( )));
        const std::string preTarget = _get( "preTarget" );
        const float gidFraction = getGIDFraction();
        if( target == "*" )
        {
            gids = gidFraction == 1.f ? circuit.getGIDs()
                                      : circuit.getRandomGIDs( gidFraction );
        }
        else
        {
            gids = gidFraction == 1.f ? circuit.getGIDs( target )
                                 : circuit.getRandomGIDs( gidFraction, target );

            if( !preTarget.empty( ))
            {
                preGIDs = gidFraction == 1.f ? circuit.getGIDs( preTarget )
                              : circuit.getRandomGIDs( gidFraction, preTarget );

                if( preGIDs.empty( ))
                    LBTHROW( std::runtime_error(
                             "No GIDs found for requested target '" +
                                 preTarget + "'" ));
            }
        }

        if( gids.empty( ))
            LBTHROW( std::runtime_error(
                     "No GIDs found for requested target '" + target + "'" ));
    }