From 9f01bcfad2f99251085817afa487f4204dc9506e Mon Sep 17 00:00:00 2001 From: Cyrille Favreau Date: Sat, 1 Apr 2017 10:14:05 +0200 Subject: [PATCH 1/2] Added simulation model --- brayns/Brayns.cpp | 2 +- brayns/common/vocabulary/parameters.fbs | 1 + brayns/io/MorphologyLoader.cpp | 32 +- brayns/parameters/GeometryParameters.cpp | 11 +- brayns/parameters/GeometryParameters.h | 13 + plugins/engines/ospray/OSPRayRenderer.cpp | 8 +- plugins/engines/ospray/OSPRayScene.cpp | 48 +- plugins/engines/ospray/OSPRayScene.h | 3 +- .../ospray/ispc/render/ProximityRenderer.ispc | 3 +- .../ospray/ispc/render/SimulationRenderer.cpp | 5 +- .../ospray/ispc/render/SimulationRenderer.h | 2 + .../ispc/render/SimulationRenderer.ispc | 85 +- .../ispc/render/utils/AbstractRenderer.cpp | 1 + .../ispc/render/utils/AbstractRenderer.ispc | 11 +- .../ispc/render/utils/RandomGenerator.ih | 16 +- .../ispc/render/utils/RandomGenerator.ispc | 1101 +---------------- plugins/extensions/plugins/ZeroEQPlugin.cpp | 5 + 17 files changed, 226 insertions(+), 1121 deletions(-) diff --git a/brayns/Brayns.cpp b/brayns/Brayns.cpp index bd760f90f..970bbca5e 100644 --- a/brayns/Brayns.cpp +++ b/brayns/Brayns.cpp @@ -459,7 +459,7 @@ struct Brayns::Impl auto& scene = _engine->getScene(); strings filters = {".obj", ".dae", ".fbx", ".ply", ".lwo", - ".stl", ".3ds", ".ase", ".ifc"}; + ".stl", ".3ds", ".ase", ".ifc", ".off"}; strings files = parseFolder(folder, filters); size_t progress = 0; for (const auto& file : files) diff --git a/brayns/common/vocabulary/parameters.fbs b/brayns/common/vocabulary/parameters.fbs index 5904f89be..5b9ef05d4 100644 --- a/brayns/common/vocabulary/parameters.fbs +++ b/brayns/common/vocabulary/parameters.fbs @@ -82,6 +82,7 @@ table DataSource { end_simulation_time: float; simulation_values_range: [float:2]; simulation_cache_file: string; + use_simulation_model: bool; nest_cache_file: string; morphology_section_types: [SectionType]; morphology_layout: MorphologyLayout; diff --git a/brayns/io/MorphologyLoader.cpp b/brayns/io/MorphologyLoader.cpp index 4bc275145..aa9bf7fa0 100644 --- a/brayns/io/MorphologyLoader.cpp +++ b/brayns/io/MorphologyLoader.cpp @@ -234,16 +234,38 @@ bool MorphologyLoader::_importMorphology( const brain::neuron::Soma& soma = morphology.getSoma(); const size_t material = _getMaterialFromSectionType( morphologyIndex, size_t(brain::neuron::SectionType::soma)); - const Vector3f& center = soma.getCentroid() + translation; + const Vector3f somaPosition = soma.getCentroid() + translation; - const float radius = + float radius = (_geometryParameters.getRadiusCorrection() != 0.f ? _geometryParameters.getRadiusCorrection() : soma.getMeanRadius() * _geometryParameters.getRadiusMultiplier()); - spheres[material].push_back( - SpherePtr(new Sphere(material, center, radius, 0.f, offset))); - bounds.merge(center); + + spheres[material].push_back(SpherePtr( + new Sphere(material, somaPosition, radius, 0.f, offset))); + bounds.merge(somaPosition); + + if (_geometryParameters.getUseSimulationModel()) + { + // When using a simulation model, parametric geometries must + // occupy as much space as possible in the mesh. This code + // inserts a Cone between the soma and the beginning of each + // branch. + const auto& children = soma.getChildren(); + for (const auto& child : children) + { + const auto& samples = child.getSamples(); + const Vector3f sample = {samples[0].x(), samples[0].y(), + samples[0].z()}; + cones[material].push_back(ConePtr( + new Cone(material, somaPosition, sample, radius, + samples[0].w() * 0.5f * + _geometryParameters.getRadiusMultiplier(), + 0.f, offset))); + bounds.merge(sample); + } + } } // Dendrites and axon diff --git a/brayns/parameters/GeometryParameters.cpp b/brayns/parameters/GeometryParameters.cpp index b0b8d1460..fd1ae4721 100644 --- a/brayns/parameters/GeometryParameters.cpp +++ b/brayns/parameters/GeometryParameters.cpp @@ -60,6 +60,7 @@ const std::string PARAM_METABALLS_GRIDSIZE = "metaballs-grid-size"; const std::string PARAM_METABALLS_THRESHOLD = "metaballs-threshold"; const std::string PARAM_METABALLS_SAMPLES_FROM_SOMA = "metaballs-samples-from-soma"; +const std::string PARAM_USE_SIMULATION_MODEL = "use-simulation-model"; const std::string COLOR_SCHEMES[8] = { "none", "neuron-by-id", @@ -93,6 +94,7 @@ GeometryParameters::GeometryParameters() , _metaballsGridSize(0) , _metaballsThreshold(1.f) , _metaballsSamplesFromSoma(3) + , _useSimulationModel(false) { _parameters.add_options()(PARAM_MORPHOLOGY_FOLDER.c_str(), po::value(), @@ -170,7 +172,10 @@ GeometryParameters::GeometryParameters() "Metaballs threshold [float]")( PARAM_METABALLS_SAMPLES_FROM_SOMA.c_str(), po::value(), "Number of morphology samples (or segments) from soma used by " - "automated meshing [int]"); + "automated meshing [int]")(PARAM_USE_SIMULATION_MODEL.c_str(), + po::value(), + "Defines if a different model is used to " + "handle the simulation geometry [bool]"); } bool GeometryParameters::_parse(const po::variables_map& vm) @@ -282,6 +287,8 @@ bool GeometryParameters::_parse(const po::variables_map& vm) if (vm.count(PARAM_METABALLS_SAMPLES_FROM_SOMA)) _metaballsSamplesFromSoma = vm[PARAM_METABALLS_SAMPLES_FROM_SOMA].as(); + if (vm.count(PARAM_USE_SIMULATION_MODEL)) + _useSimulationModel = vm[PARAM_USE_SIMULATION_MODEL].as(); return true; } @@ -351,6 +358,8 @@ void GeometryParameters::print() << std::endl; BRAYNS_INFO << " - Samples from soma : " << _metaballsSamplesFromSoma << std::endl; + BRAYNS_INFO << "Use simulation model : " + << (_useSimulationModel ? "Yes" : "No") << std::endl; } const std::string& GeometryParameters::getColorSchemeAsString( diff --git a/brayns/parameters/GeometryParameters.h b/brayns/parameters/GeometryParameters.h index 12a3279bc..26b4f9e58 100644 --- a/brayns/parameters/GeometryParameters.h +++ b/brayns/parameters/GeometryParameters.h @@ -168,6 +168,18 @@ class GeometryParameters : public AbstractParameters /** Metaballs enabled? */ bool useMetaballs() const { return _metaballsGridSize != 0; } + /** + * Defines if a different model is used to handle the simulation geometry. + * If set to True, the shading of the main geometry model will be done + * using information stored in a secondary model that contains the + * simulation information. See OSPRay simulation renderer for more details. + */ + bool getUseSimulationModel() const { return _useSimulationModel; } + void setUseSimulationModel(const bool value) + { + _useSimulationModel = value; + } + protected: bool _parse(const po::variables_map& vm) final; @@ -204,6 +216,7 @@ class GeometryParameters : public AbstractParameters size_t _metaballsGridSize; float _metaballsThreshold; size_t _metaballsSamplesFromSoma; + bool _useSimulationModel; }; } #endif // GEOMETRYPARAMETERS_H diff --git a/plugins/engines/ospray/OSPRayRenderer.cpp b/plugins/engines/ospray/OSPRayRenderer.cpp index 0bb1b2660..9c2fedcc5 100644 --- a/plugins/engines/ospray/OSPRayRenderer.cpp +++ b/plugins/engines/ospray/OSPRayRenderer.cpp @@ -96,12 +96,14 @@ void OSPRayRenderer::commit() _scene->getParametersManager().getSceneParameters().getTimestamp(); const auto model = osprayScene->modelImpl(ts); if (model) - { ospSetObject(_renderer, "world", *model); - ospCommit(_renderer); - } else BRAYNS_ERROR << "No model found for timestamp " << ts << std::endl; + + const auto simulationModel = osprayScene->simulationModelImpl(); + if (simulationModel) + ospSetObject(_renderer, "simulationModel", *simulationModel); + ospCommit(_renderer); } void OSPRayRenderer::setCamera(CameraPtr camera) diff --git a/plugins/engines/ospray/OSPRayScene.cpp b/plugins/engines/ospray/OSPRayScene.cpp index 46805916c..cfd2122b7 100644 --- a/plugins/engines/ospray/OSPRayScene.cpp +++ b/plugins/engines/ospray/OSPRayScene.cpp @@ -51,6 +51,7 @@ static TextureTypeMaterialAttribute textureTypeMaterialAttribute[6] = { OSPRayScene::OSPRayScene(Renderers renderers, ParametersManager& parametersManager) : Scene(renderers, parametersManager) + , _simulationModel(0) , _ospLightData(0) , _ospMaterialData(0) , _ospVolumeData(0) @@ -77,6 +78,21 @@ void OSPRayScene::reset() ospCommit(model.second); } + if (_simulationModel) + { + for (size_t materialId = 0; materialId < _materials.size(); + ++materialId) + { + ospRemoveGeometry(_simulationModel, + _ospExtendedSpheres[materialId]); + ospRemoveGeometry(_simulationModel, + _ospExtendedCylinders[materialId]); + ospRemoveGeometry(_simulationModel, _ospExtendedCones[materialId]); + } + ospCommit(_simulationModel); + } + _simulationModel = 0; + _models.clear(); _ospMaterials.clear(); @@ -99,6 +115,11 @@ void OSPRayScene::commit() { for (auto model : _models) ospCommit(model.second); + if (_simulationModel) + { + BRAYNS_INFO << "Committing simulation model" << std::endl; + ospCommit(_simulationModel); + } } OSPModel* OSPRayScene::modelImpl(const size_t timestamp) @@ -501,6 +522,7 @@ void OSPRayScene::_createModel(const size_t timestamp) uint64_t OSPRayScene::_serializeSpheres(const size_t materialId) { + const auto& geometryParameters = _parametersManager.getGeometryParameters(); uint64_t size = 0; size_t count = 0; @@ -558,7 +580,12 @@ uint64_t OSPRayScene::_serializeSpheres(const size_t materialId) ospCommit(_ospExtendedSpheres[materialId]); - ospAddGeometry(model.second, _ospExtendedSpheres[materialId]); + if (geometryParameters.getUseSimulationModel()) + ospAddGeometry(_simulationModel, + _ospExtendedSpheres[materialId]); + else + ospAddGeometry(model.second, + _ospExtendedSpheres[materialId]); } } } @@ -567,6 +594,7 @@ uint64_t OSPRayScene::_serializeSpheres(const size_t materialId) uint64_t OSPRayScene::_serializeCylinders(const size_t materialId) { + const auto& geometryParameters = _parametersManager.getGeometryParameters(); uint64_t size = 0; size_t count = 0; @@ -624,7 +652,12 @@ uint64_t OSPRayScene::_serializeCylinders(const size_t materialId) _ospMaterials[materialId]); ospCommit(_ospExtendedCylinders[materialId]); - ospAddGeometry(model.second, _ospExtendedCylinders[materialId]); + if (geometryParameters.getUseSimulationModel()) + ospAddGeometry(_simulationModel, + _ospExtendedCylinders[materialId]); + else + ospAddGeometry(model.second, + _ospExtendedCylinders[materialId]); } } } @@ -633,6 +666,7 @@ uint64_t OSPRayScene::_serializeCylinders(const size_t materialId) uint64_t OSPRayScene::_serializeCones(const size_t materialId) { + const auto& geometryParameters = _parametersManager.getGeometryParameters(); uint64_t size = 0; size_t count = 0; @@ -685,8 +719,11 @@ uint64_t OSPRayScene::_serializeCones(const size_t materialId) _ospMaterials[materialId]); ospCommit(_ospExtendedCones[materialId]); - ospRemoveGeometry(model.second, _ospExtendedCones[materialId]); - ospAddGeometry(model.second, _ospExtendedCones[materialId]); + if (geometryParameters.getUseSimulationModel()) + ospAddGeometry(_simulationModel, + _ospExtendedCones[materialId]); + else + ospAddGeometry(model.second, _ospExtendedCones[materialId]); } } } @@ -776,6 +813,9 @@ void OSPRayScene::buildGeometry() // If no timestamp is available, create a default model at timestamp 0 _models[0] = ospNewModel(); + if (_parametersManager.getGeometryParameters().getUseSimulationModel()) + _simulationModel = ospNewModel(); + BRAYNS_INFO << "Models to process: " << _models.size() << std::endl; uint64_t size = serializeGeometry(); diff --git a/plugins/engines/ospray/OSPRayScene.h b/plugins/engines/ospray/OSPRayScene.h index 675f26d5c..60026a580 100644 --- a/plugins/engines/ospray/OSPRayScene.h +++ b/plugins/engines/ospray/OSPRayScene.h @@ -79,7 +79,7 @@ class OSPRayScene : public brayns::Scene bool isVolumeSupported(const std::string& volumeFile) const final; OSPModel* modelImpl(const size_t timestamp); - + OSPModel* simulationModelImpl() { return &_simulationModel; }; private: OSPTexture2D _createTexture2D(const std::string& textureName); void _createModel(const size_t timestamp); @@ -93,6 +93,7 @@ class OSPRayScene : public brayns::Scene void _saveCacheFile(); std::map _models; + OSPModel _simulationModel; std::vector _ospMaterials; std::map _ospTextures; diff --git a/plugins/engines/ospray/ispc/render/ProximityRenderer.ispc b/plugins/engines/ospray/ispc/render/ProximityRenderer.ispc index 3bc08388c..ac2648861 100644 --- a/plugins/engines/ospray/ispc/render/ProximityRenderer.ispc +++ b/plugins/engines/ospray/ispc/render/ProximityRenderer.ispc @@ -144,8 +144,7 @@ inline vec3f ProximityRenderer_shadeRay( ray.t < self->detectionDistance * 1000.f) { // Generate random ray and trace it - varying vec3f ao_dir = - getRandomVector(sample, normal, self->abstract.randomNumber); + varying vec3f ao_dir = getRandomVector(normal); if (dot(ao_dir, normal) < 0.f) ao_dir = ao_dir * -1.f; diff --git a/plugins/engines/ospray/ispc/render/SimulationRenderer.cpp b/plugins/engines/ospray/ispc/render/SimulationRenderer.cpp index 0a4c28faa..0255b12a9 100644 --- a/plugins/engines/ospray/ispc/render/SimulationRenderer.cpp +++ b/plugins/engines/ospray/ispc/render/SimulationRenderer.cpp @@ -24,6 +24,7 @@ // ospray #include +#include // ispc exports #include "SimulationRenderer_ispc.h" @@ -36,6 +37,7 @@ void SimulationRenderer::commit() { AbstractRenderer::commit(); + _simulationModel = (ospray::Model*)getParamObject("simulationModel", 0); _volumeData = getParamData("volumeData"); _volumeDimensions = getParam3i("volumeDimensions", ospray::vec3i(0)); _volumeElementSpacing = @@ -52,7 +54,8 @@ void SimulationRenderer::commit() _threshold = getParam1f("threshold", _transferFunctionMinValue); ispc::SimulationRenderer_set( - getIE(), (ispc::vec3f&)_bgColor, _shadowsEnabled, _softShadowsEnabled, + getIE(), (_simulationModel ? _simulationModel->getIE() : nullptr), + (ispc::vec3f&)_bgColor, _shadowsEnabled, _softShadowsEnabled, _ambientOcclusionStrength, _shadingEnabled, _randomNumber, _timestamp, _spp, _electronShadingEnabled, _lightPtr, _lightArray.size(), _materialPtr, _materialArray.size(), diff --git a/plugins/engines/ospray/ispc/render/SimulationRenderer.h b/plugins/engines/ospray/ispc/render/SimulationRenderer.h index 4a1b54a72..ef2a9d503 100644 --- a/plugins/engines/ospray/ispc/render/SimulationRenderer.h +++ b/plugins/engines/ospray/ispc/render/SimulationRenderer.h @@ -39,6 +39,8 @@ class SimulationRenderer : public AbstractRenderer void commit() final; private: + ospray::Model *_simulationModel; + ospray::Ref _volumeData; ospray::Ref _simulationData; ospray::Ref _transferFunctionDiffuseData; diff --git a/plugins/engines/ospray/ispc/render/SimulationRenderer.ispc b/plugins/engines/ospray/ispc/render/SimulationRenderer.ispc index 63ea08e98..6d5fe07d2 100644 --- a/plugins/engines/ospray/ispc/render/SimulationRenderer.ispc +++ b/plugins/engines/ospray/ispc/render/SimulationRenderer.ispc @@ -27,10 +27,17 @@ struct SimulationRenderer { AbstractRenderer abstract; + Model* simulationModel; uniform float* uniform simulationData; float threshold; }; +/** + The getSimulationValue reads simulation value from the simulation data buffer. + The geometry contains the offset of the buffer in it's X texture coordinates. + The value from the simulation data buffer is then converted into a color, + according to the colormap. + */ inline varying vec4f getSimulationValue(const uniform SimulationRenderer* uniform self, DifferentialGeometry& dg, varying vec3f& lightEmission) @@ -43,6 +50,7 @@ inline varying vec4f if (value < self->threshold) return color; + // Normalize the value according colormap size const varying float normalizedValue = self->abstract.colorMapSize * (value - self->abstract.colorMapMinValue) / @@ -57,6 +65,62 @@ inline varying vec4f return color; } +/** + The purpose of the getValueFromSimulationModel function is to retreive the + value of the simulation from a secondary model attached to the OSPRay scene. + The geometry is defined by the primary model, but the shading is computed + according to a second, non-visible model that contains the simulation values. + In the case of circuit rendering for examples, neurons are meshes, and + compartment reports are cones and cylinders that are inside the neuron. When + an intersection is found at the surface of a mesh, a ray defined by the + intersection point and the opposite normal to the surface is launched to hit + the secondary model. When the secondary model is intersected, the simulation + value is retrieved and used to shade the surface of the mesh. +*/ +inline void getValueFromSimulationModel( + const uniform SimulationRenderer* uniform self, + varying ScreenSample& sample, const varying vec3f& intersection, + const varying vec3f& normal, const int materialID, + varying vec3f& simulationColor, varying float& lightEmission) +{ + // Get simulation color from simulation model + varying Ray colorRay; + colorRay.org = intersection; + colorRay.dir = getRandomVector(neg(normal)); + colorRay.t0 = 0.f; + colorRay.time = infinity; + colorRay.t = infinity; + colorRay.primID = -1; + colorRay.geomID = -1; + colorRay.instID = -1; + + // Trace ray to hit the simulation model + traceRay(self->simulationModel, colorRay); + + // Default color is initialized with the first value of the colormap + simulationColor = simulationColor * (1.f - self->abstract.colorMap[0].w); + + if (colorRay.geomID >= 0) + { + // Intersection found. Simulation ray hit a primitive + DifferentialGeometry colorDg; + postIntersect(self->simulationModel, colorDg, colorRay, + DG_MATERIALID | DG_TEXCOORD); + if (materialID == colorDg.materialID && self->simulationData) + { + // The mesh and it's corresponding representation in the + // simulation model must use the same material ID. This is to make + // sure that one neuron is not shaded with the simulation value + // of another neuron. + vec3f emission = make_vec3f(0.f); + const vec4f color = getSimulationValue(self, colorDg, emission); + simulationColor = + simulationColor * (1.f - color.w) + make_vec3f(color) * color.w; + lightEmission = reduce_max(emission); + } + } +} + inline vec3f SimulationRenderer_shadeRay( const uniform SimulationRenderer* uniform self, varying ScreenSample& sample) @@ -103,8 +167,6 @@ inline vec3f SimulationRenderer_shadeRay( } else { - // Intersection found - // Retreive information about the geometry, typically geometry ID, // normal to the surface, material ID, texture coordinates, etc. DifferentialGeometry dg; @@ -125,10 +187,11 @@ inline vec3f SimulationRenderer_shadeRay( varying vec3f localNormal = dg.Ns; varying float localLightIntensity = 1.f; - // Get simulation value from geometry ID + // Get simulation value from geometry ID if no simulation model + // is used. varying vec3f lightEmission = make_vec3f(0.f); vec4f simulationValue = make_vec4f(0.f); - if (self->simulationData) + if (!self->simulationModel && self->simulationData) simulationValue = getSimulationValue(self, dg, lightEmission); localSimulationColor = lightEmission + make_vec3f(simulationValue); @@ -226,11 +289,19 @@ inline vec3f SimulationRenderer_shadeRay( if (localOpacity > 0.01f) { + if (self->simulationModel) + // Get color from simulation model + getValueFromSimulationModel(self, sample, dg.P, dg.Ng, + dg.materialID, + localDiffuseColor, + localLightEmission); + // Intersection point with geometry, slightly above the surface, // along the normal const varying vec3f intersection = dg.P + self->abstract.super.epsilon * dg.Ng; + // Indirect shading varying vec3f indirectShadingColor = make_vec3f(0.f); varying float indirectShadingIntensity = 0.f; const varying vec3f reflectedDirection = @@ -454,8 +525,9 @@ export void* uniform SimulationRenderer_create(void* uniform cppE) } export void SimulationRenderer_set( - void* uniform _self, const uniform vec3f& bgColor, - const uniform bool& shadowsEnabled, const uniform bool& softShadowsEnabled, + void* uniform _self, void* uniform simulationModel, + const uniform vec3f& bgColor, const uniform bool& shadowsEnabled, + const uniform bool& softShadowsEnabled, const uniform float& ambientOcclusionStrength, const uniform bool& shadingEnabled, const uniform int& randomNumber, const uniform float& timestamp, const uniform int& spp, @@ -507,6 +579,7 @@ export void SimulationRenderer_set( self->abstract.colorMapMinValue = colorMapMinValue; self->abstract.colorMapRange = colorMapRange; + self->simulationModel = (uniform Model * uniform)simulationModel; self->simulationData = (uniform float* uniform)simulationData; self->threshold = threshold; } diff --git a/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.cpp b/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.cpp index 38b908bab..3e1d9865a 100644 --- a/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.cpp +++ b/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.cpp @@ -28,6 +28,7 @@ // ospray #include #include + // sys #include diff --git a/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.ispc b/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.ispc index 6af21f77c..f3cc0c8fc 100644 --- a/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.ispc +++ b/plugins/engines/ospray/ispc/render/utils/AbstractRenderer.ispc @@ -27,7 +27,7 @@ inline bool launchRandomRay( varying vec3f& backgroundColor, varying float& distanceToIntersection, varying vec3f& randomDirection) { - randomDirection = getRandomVector(sample, normal, self->randomNumber); + randomDirection = getRandomVector(normal); backgroundColor = self->bgColor; if (dot(randomDirection, normal) < 0.f) @@ -161,8 +161,7 @@ inline float shadedLightIntensity(const uniform AbstractRenderer* uniform self, if (self->softShadowsEnabled) { // Slightly alter light direction for Soft shadows - const varying vec3f ss = - getRandomVector(sample, normal, self->randomNumber); + const varying vec3f ss = getRandomVector(normal); lightDirection = lightDirection + ss * 0.1f; } @@ -290,8 +289,7 @@ inline varying vec4f getVolumeContribution( while (t < tMax && pathAlpha < 1.f) { - const float x = - getRandomValue(sample, self->randomNumber) * self->volumeEpsilon; + const float x = getRandomValue() * self->volumeEpsilon; vec3f point = ((ray.org + ray.dir * (t + x)) - self->volumeOffset) / self->volumeElementSpacing; @@ -321,8 +319,7 @@ inline varying vec4f getVolumeContribution( Ray lightRay = ray; lightRay.org = point; if (self->softShadowsEnabled) - lightRay.dir = getRandomVector(sample, lightSample.dir, - self->randomNumber); + lightRay.dir = getRandomVector(lightSample.dir); else lightRay.dir = lightSample.dir; const vec4f voxelColor = diff --git a/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ih b/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ih index 4c22029dc..bd5afb2f1 100644 --- a/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ih +++ b/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ih @@ -22,22 +22,14 @@ #include -float getRandomValue(varying ScreenSample& sample, const int randomNumber); +float getRandomValue(); /** - Returns a random direction based on location in the frame buffer, the - normal - to the surface and rotation parameters for the precomputed hard-coded - random - distribution. - @param sample Frame buffer sample being rendered + Returns a random direction based on normal to the surface @param normal Normal vector to the surface - @param randomNumber A random number that introduces noise in the - distribution - @return A random direction based on specified parameters + @return A random direction */ -vec3f getRandomVector(varying ScreenSample& sample, const vec3f& normal, - const int randomNumber); +vec3f getRandomVector(const vec3f& normal); /** Returns tangent vectors for a given normal. diff --git a/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ispc b/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ispc index da7cac077..f66684c70 100644 --- a/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ispc +++ b/plugins/engines/ospray/ispc/render/utils/RandomGenerator.ispc @@ -23,1091 +23,36 @@ #include -/** -Random values were generated using the following python code: - import random - RANDOM_SET_SIZE = 64 - s = '{ ' - for j in range(0,RANDOM_SET_SIZE): - if j != 0: - s = s + ', ' - s = s + '{ ' - for i in range(0,RANDOM_SET_SIZE): - if i != 0: - s = s + ', ' - if i % 16 == 0 : - s = s + '\n' - s = s + str(random.uniform(0,10000) / 10000.0) - s = s + ' }' - s = s + ' }' - print(s) -*/ +uniform bool seedInitialized = false; +struct RNGState rngState; -#define RANDOM_SET_SIZE 64 +#define HIGH_QUALITY_RANDOM -uniform float randomDistribution[RANDOM_SET_SIZE][RANDOM_SET_SIZE] = { - {0.28148369141, 0.796861024715, 0.074193743197, 0.482440306945, - 0.992773878589, 0.709310247315, 0.988484235866, 0.714714091734, - 0.643116781373, 0.718637647581, 0.926101047171, 0.846328419497, - 0.00297438943897, 0.137931361741, 0.17772706582, 0.444643858689, - 0.629288179636, 0.613382480923, 0.630336849193, 0.311776793613, - 0.08508451954, 0.30789230424, 0.0498092039943, 0.773779960365, - 0.768769637233, 0.882161981223, 0.976723516158, 0.449556805562, - 0.817669534955, 0.616539655821, 0.758216742242, 0.858237417116, - 0.979179183398, 0.65720513278, 0.386168029804, 0.0998493897615, - 0.962177647248, 0.108548816296, 0.996156105474, 0.941749314739, - 0.406174983692, 0.158989971035, 0.654907085688, 0.538001003242, - 0.332477591342, 0.978302973988, 0.98409103864, 0.241245008961, - 0.68183193795, 0.653235229058, 0.0606653606997, 0.0566309454523, - 0.919881491327, 0.905670025614, 0.637338702024, 0.121894161196, - 0.937476480417, 0.017741798193, 0.61697799368, 0.709261525057, - 0.859211525517, 0.96409034113, 0.0972400297964, 0.181073145261}, - {0.284798532204, 0.413248667128, 0.332659388212, 0.340977212815, - 0.820090638467, 0.560592082547, 0.183689859617, 0.2575201395, - 0.289725466835, 0.522736633275, 0.882031679296, 0.654563598748, - 0.531309473163, 0.134963142807, 0.601297763714, 0.483506281956, - 0.283419807601, 0.454826306306, 0.508528602139, 0.897831546117, - 0.900287116387, 0.688215721818, 0.615842816633, 0.78273583615, - 0.927051829764, 0.425934500525, 0.741948788292, 0.0813684454157, - 0.998899378243, 0.551326196783, 0.0682702415237, 0.389893584905, - 0.15548746549, 0.468047910542, 0.948034950244, 0.202074251433, - 0.347536181502, 0.024377007386, 0.2214820153, 0.846643514875, - 0.391710310296, 0.692284401129, 0.244449478476, 0.0181219259474, - 0.336741055884, 0.70325501105, 0.968370058703, 0.892508506776, - 0.538387343968, 0.843838154621, 0.0790397063184, 0.103191163974, - 0.243711484807, 0.694622402023, 0.798540922368, 0.21746310996, - 0.870761691473, 0.368350833275, 0.228505271004, 0.3741636072, - 0.347291149036, 0.753449262487, 0.890757112194, 0.167150644248}, - {0.457110762238, 0.190058663824, 0.966983051308, 0.174913405303, - 0.965892823569, 0.750044043691, 0.0728237849264, 0.463130610325, - 0.103124025349, 0.0350371212321, 0.614530612652, 0.197451537566, - 0.0184625703081, 0.566999317215, 0.612328754432, 0.399783838505, - 0.660004388597, 0.685620326735, 0.277093888672, 0.4642131075, - 0.457331478583, 0.635307702024, 0.0361877408296, 0.979451068209, - 0.276375073748, 0.613864979726, 0.494276937162, 0.37392133765, - 0.583857606651, 0.500115628484, 0.387341124462, 0.706045700049, - 0.383262560734, 0.463189914652, 0.760029931823, 0.292082718455, - 0.719905611326, 0.828468179941, 0.286280437812, 0.46192051449, - 0.129676457745, 0.705149158196, 0.0800629670919, 0.562030236756, - 0.564841314682, 0.795934568553, 0.314761888299, 0.255566096902, - 0.370668062821, 0.469511051618, 0.583897706459, 0.826684088787, - 0.412163126416, 0.608457222305, 0.861867806972, 0.115412000687, - 0.227781885073, 0.247482444407, 0.952923783151, 0.0619481618527, - 0.59917445202, 0.353454198543, 0.604871261807, 0.913720224463}, - {0.154529159799, 0.608373262825, 0.828093245878, 0.884878282853, - 0.328643969797, 0.337801467365, 0.908743272706, 0.858987950853, - 0.337251244648, 0.107829078551, 0.445796450208, 0.00551456673851, - 0.261843395455, 0.717634089203, 0.283692866456, 0.901246969714, - 0.00251000083146, 0.418718563248, 0.353102006281, 0.729572923848, - 0.124249675902, 0.184442168626, 0.119806303173, 0.410560835043, - 0.431793992163, 0.870215222196, 0.111452032889, 0.0771025500452, - 0.0116005894716, 0.725131860309, 0.250901569649, 0.363658788266, - 0.132819984884, 0.954583506183, 0.677710820265, 0.447935194971, - 0.334163246347, 0.754929591065, 0.463874583, 0.317324496606, - 0.133136796126, 0.738113152709, 0.885964303001, 0.473861988076, - 0.281836022781, 0.323897440462, 0.0273717147221, 0.13399810515, - 0.775599802612, 0.161301129064, 0.422712724011, 0.259397474345, - 0.792757715537, 0.441721985567, 0.307730917559, 0.52494071924, - 0.720542773367, 0.882597592812, 0.978415404836, 0.379162724862, - 0.733923548878, 0.792597071567, 0.240934600517, 0.656639670607}, - {0.358837299613, 0.353045704081, 0.311573609587, 0.651932281608, - 0.794066869328, 0.869877226906, 0.950364479942, 0.670294566684, - 0.771104447969, 0.771968364302, 0.601820715467, 0.936856279878, - 0.317084165707, 0.450553956753, 0.940444797613, 0.890247899907, - 0.653066500043, 0.722351199729, 0.0974322170522, 0.0760582680413, - 0.954274081317, 0.963926135083, 0.584863442632, 0.742551775609, - 0.757198627444, 0.936524746091, 0.667946182977, 0.688056141105, - 0.929488622754, 0.0753725601563, 0.191001047242, 0.908676664152, - 0.498016676591, 0.432833783975, 0.312926489931, 0.953902717702, - 0.235031914009, 0.857907522074, 0.790913347557, 0.530852362465, - 0.86792244704, 0.983750544608, 0.171782686001, 0.730658266658, - 0.0145164264049, 0.182825497369, 0.603116049017, 0.211449776177, - 0.738479621913, 0.91553884426, 0.59443374206, 0.0640549389828, - 0.581410908366, 0.616682138362, 0.856655317212, 0.55743307224, - 0.167823588156, 0.748559381699, 0.807811510411, 0.339896428757, - 0.883337864368, 0.543341381539, 0.453243356669, 0.487068721811}, - {0.299535453655, 0.913320454769, 0.971782779326, 0.171081350472, - 0.625717680808, 0.195619820715, 0.132836662146, 0.499525888033, - 0.468645373373, 0.294388239697, 0.929846182612, 0.496486160697, - 0.242549949137, 0.195062520874, 0.396630694799, 0.95358534658, - 0.976003526344, 0.125135322387, 0.739711572738, 0.988727878486, - 0.912659668612, 0.973010722894, 0.124575695432, 0.270564016931, - 0.659556299616, 0.63082893029, 0.802671290312, 0.398023516815, - 0.458920238178, 0.321101594944, 0.0868611932926, 0.831747781205, - 0.0268500975193, 0.508487413052, 0.477289690377, 0.057921001955, - 0.723158797189, 0.324473983356, 0.233179307121, 0.591830012145, - 0.710565581231, 0.28764409623, 0.308487086595, 0.0196307834741, - 0.58899809125, 0.357187128193, 0.410067541092, 0.853476063339, - 0.708188954945, 0.853343799133, 0.698060079727, 0.0624860048786, - 0.514730490365, 0.315469540531, 0.555629736369, 0.639631243119, - 0.376877505588, 0.190721769, 0.810494963911, 0.804416667526, - 0.216860200774, 0.962460708895, 0.51851728381, 0.569318712172}, - {0.881523365245, 0.437182587309, 0.119055734103, 0.969435820607, - 0.118322977399, 0.209429181503, 0.239105756054, 0.77830215109, - 0.0430497475282, 0.123242983435, 0.98120496217, 0.0524998983507, - 0.622791502544, 0.803553699856, 0.475597826486, 0.391599979462, - 0.564399195227, 0.481879086374, 0.0147840077956, 0.892333937051, - 0.395460053949, 0.247442235769, 0.226569030514, 0.914045787034, - 0.378759187927, 0.57638504929, 0.672098857226, 0.0833980745008, - 0.50397080379, 0.292001935895, 0.176882984857, 0.599996312333, - 0.741902824797, 0.0536534978543, 0.985965497321, 0.941351237501, - 0.986693231239, 0.733360513898, 0.428722154116, 0.87439373331, - 0.3235833822, 0.457656006463, 0.51780167629, 0.97734070692, - 0.925787020893, 0.433386783835, 0.184207594695, 0.226803890355, - 0.184429355539, 0.490534565955, 0.492349580553, 0.307197246184, - 0.196369878634, 0.811062123401, 0.00464241425083, 0.522819338452, - 0.810204189091, 0.845264028573, 0.0939219644426, 0.974591847119, - 0.339249933685, 0.130115685345, 0.871517345081, 0.6427030285}, - {0.571758916637, 0.42767024206, 0.276738647275, 0.159036560634, - 0.784477966718, 0.809298954049, 0.612143383503, 0.194934138433, - 0.949848331686, 0.972812526647, 0.628913244397, 0.527553179853, - 0.597787149164, 0.519073224607, 0.122598324774, 0.544152148804, - 0.0187609066683, 0.821333558857, 0.217702456549, 0.929226296624, - 0.394301861331, 0.163074549587, 0.331660239966, 0.00284965428489, - 0.852543884861, 0.228112553577, 0.318702387376, 0.745795009855, - 0.318814113144, 0.343942230165, 0.913018983925, 0.182914420274, - 0.380842768134, 0.389992235374, 0.216384242365, 0.922411188476, - 0.908209210201, 0.517768218323, 0.77764544302, 0.909577241158, - 0.146317749867, 0.366397092574, 0.907616727168, 0.811820329862, - 0.57698052993, 0.16056257801, 0.510129340998, 0.753256766212, - 0.599845283983, 0.546107522854, 0.117245034451, 0.450857365637, - 0.165832741892, 0.257048480519, 0.0708843682851, 0.353201176886, - 0.681786600701, 0.202492341912, 0.657560948972, 0.416360562188, - 0.960771248083, 0.553884414781, 0.328801232524, 0.916191908943}, - {0.998834980384, 0.973687779877, 0.324477012238, 0.529135515322, - 0.143439009085, 0.540000026637, 0.702267985141, 0.692604698196, - 0.666457911588, 0.770574828745, 0.316692329896, 0.924446487131, - 0.751968510616, 0.484247756731, 0.441614235128, 0.378357103404, - 0.138414281883, 0.381844108549, 0.0491501653865, 0.389590202775, - 0.49857381831, 0.435236620598, 0.666586816058, 0.677548022827, - 0.930023794309, 0.91997343834, 0.859993024129, 0.0517330686016, - 0.612199551889, 0.158892960666, 0.610891137675, 0.174731780619, - 0.851070434057, 0.53958377884, 0.566894620543, 0.244450572949, - 0.567642885664, 0.707554510012, 0.936461921534, 0.664866151519, - 0.865699078562, 0.0843043034826, 0.338465548944, 0.816413280972, - 0.362665954149, 0.874200370399, 0.275529143917, 0.0548951807737, - 0.144923676282, 0.133376815652, 0.0407487648242, 0.388504315179, - 0.0684211516451, 0.529655804036, 0.18855627524, 0.348722308452, - 0.816131359655, 0.135124930045, 0.387379835081, 0.633828334196, - 0.3430785258, 0.821496407341, 0.437311512963, 0.471317762058}, - {0.94339821284, 0.790933507989, 0.608528978466, 0.528245946524, - 0.0176057554141, 0.0352867809524, 0.962564726582, 0.415499220251, - 0.228923300479, 0.165210023383, 0.635194485962, 0.735881158789, - 0.45639645014, 0.100853246047, 0.791355894157, 0.186055424205, - 0.593071203672, 0.913414272721, 0.0451925255258, 0.172567633909, - 0.767454349571, 0.917572773972, 0.952427299115, 0.232143007263, - 0.485641031044, 0.369195899061, 0.75619676211, 0.76001310118, - 0.211509200961, 0.641723684384, 0.886251855723, 0.296652118318, - 0.68078310366, 0.190455494373, 0.187680692713, 0.311871878468, - 0.877506728746, 0.539028136002, 0.260512188285, 0.941675029047, - 0.731532182054, 0.220151807458, 0.178493061893, 0.881892515299, - 0.49981951225, 0.229930858341, 0.790486948829, 0.102271901751, - 0.706599984762, 0.314908368422, 0.840969100918, 0.330308741948, - 0.872727788897, 0.817845375305, 0.161196850642, 0.903330367149, - 0.819696200329, 0.320354827349, 0.202299251113, 0.684295854464, - 0.622786014645, 0.387732889972, 0.0345701427481, 0.587698873008}, - {0.284896869817, 0.817905232486, 0.810039165407, 0.878888987673, - 0.379397963006, 0.0459300803181, 0.400673529967, 0.243032141215, - 0.388078727855, 0.732340174339, 0.314310763119, 0.75874015023, - 0.877459009373, 0.605227136278, 0.00121898298797, 0.527945639918, - 0.413659372987, 0.543761902954, 0.916120501318, 0.623222250348, - 0.461122256301, 0.134419763106, 0.303125953158, 0.0139856880968, - 0.156636011623, 0.282208956583, 0.97874296294, 0.575447527459, - 0.270047598768, 0.558398720815, 0.473239620459, 0.654000629564, - 0.272245218906, 0.775016331473, 0.586618600664, 0.084155832064, - 0.249747010396, 0.52495636634, 0.615511789615, 0.752847603879, - 0.651155222831, 0.368012150972, 0.240874865554, 0.225089762971, - 0.0732938184788, 0.610753660923, 0.744320330833, 0.36132889875, - 0.465250509109, 0.271325453467, 0.559323989097, 0.177041486042, - 0.800750949583, 0.894756217572, 0.00617727113404, 0.0518819910985, - 0.299672608682, 0.392003614201, 0.831747895179, 0.930273156053, - 0.989235723881, 0.771284734085, 0.480244972134, 0.612807852022}, - {0.302627854498, 0.305965985922, 0.766022141283, 0.230716668205, - 0.384859953882, 0.614149308776, 0.448529345531, 0.126652787233, - 0.124699483816, 0.822847177302, 0.180627702432, 0.590416802794, - 0.0916689682335, 0.557125226135, 0.452470095345, 0.429035915214, - 0.203576244544, 0.414538236925, 0.346494185236, 0.71665186735, - 0.499107201192, 0.517333434858, 0.826812169306, 0.687029696942, - 0.303768838569, 0.208762377877, 0.370606350893, 0.626940151911, - 0.791855125736, 0.662306029324, 0.0348974519421, 0.0661864987493, - 0.774382806607, 0.173255748956, 0.601122207597, 0.0581658466148, - 0.494053092515, 0.877344090971, 0.443995367975, 0.506298793934, - 0.26327685041, 0.226646130587, 0.628999222451, 0.410577258238, - 0.347138374, 0.0329636053955, 0.929604688132, 0.0692098354715, - 0.614981936576, 0.634191190459, 0.980369251865, 0.087233380714, - 0.0928108870257, 0.500612124855, 0.0989580056963, 0.725776064617, - 0.735916414091, 0.182665221074, 0.201430050667, 0.665774381834, - 0.631637615683, 0.749652176218, 0.867267872447, 0.175485639487}, - {0.39463934899, 0.281231614279, 0.877379488114, 0.167713751214, - 0.406001767577, 0.717509217527, 0.617881653067, 0.331499058583, - 0.787103301606, 0.522831674497, 0.345189045459, 0.484683375398, - 0.149665886723, 0.578947359667, 0.670412095004, 0.154215365001, - 0.913524085298, 0.533136432223, 0.569330185029, 0.307385600908, - 0.0995544968592, 0.700646714496, 0.941157447051, 0.777740316445, - 0.652087159563, 0.924091445911, 0.034753335454, 0.289860646114, - 0.12982307699, 0.0176432067294, 0.533938929899, 0.757698209134, - 0.728564023257, 0.413381743397, 0.759713031336, 0.827449634157, - 0.586584270739, 0.804344413799, 0.569104667206, 0.155088690485, - 0.932001299969, 0.200048478645, 0.529394562351, 0.623016722059, - 0.728076172602, 0.882682390942, 0.673734098612, 0.770653113277, - 0.225476000784, 0.572002018889, 0.0841446317378, 0.619709263289, - 0.560315154999, 0.983467318606, 0.0218218266121, 0.81384959655, - 0.250423537835, 0.00201151947167, 0.861016217358, 0.920366107499, - 0.176729599298, 0.64007375069, 0.73290900447, 0.330244411366}, - {0.409297798469, 0.948788352821, 0.761223874855, 0.855143751505, - 0.560195375862, 0.828679086071, 0.00661399791409, 0.36235774848, - 0.450222777988, 0.961338555091, 0.853193889996, 0.681849611613, - 0.734014544097, 0.473024384999, 0.313014161525, 0.0273047761671, - 0.312230862927, 0.711842569214, 0.910144060915, 0.863068947747, - 0.393944342694, 0.430892432391, 0.144748779084, 0.437284774671, - 0.738615357473, 0.541826336812, 0.401725817542, 0.604591875044, - 0.949856624858, 0.417359931391, 0.721511729547, 0.653790637521, - 0.472769955913, 0.386553136575, 0.473825955084, 0.237503282368, - 0.20935033771, 0.903030319147, 0.987822700152, 0.759659999371, - 0.721100366315, 0.947936681272, 0.473776170662, 0.378657009621, - 0.451872265995, 0.0753532483806, 0.861593759086, 0.597122993692, - 0.965956687407, 0.435801403706, 0.00828707976207, 0.242869508076, - 0.697905114641, 0.825283087985, 0.38771493256, 0.970625186816, - 0.155901003284, 0.0428393130303, 0.806961161635, 0.1233530778, - 0.590744681198, 0.787011389109, 0.813176906353, 0.176785644933}, - {0.0996987355247, 0.944699143859, 0.842394243851, 0.369522776431, - 0.0261523663511, 0.500630543851, 0.926981297974, 0.463753858114, - 0.00275776762873, 0.00286056915752, 0.327188625496, 0.908126233953, - 0.0909789548639, 0.431533605808, 0.640076029679, 0.418504896179, - 0.244731554475, 0.283719743867, 0.621861838541, 0.154833534642, - 0.983929566299, 0.873211910316, 0.561357369161, 0.00593510536046, - 0.0257379112828, 0.514322218764, 0.284961053636, 0.220207634002, - 0.548332607996, 0.73680668341, 0.383029909399, 0.136591936078, - 0.99111261838, 0.774109626986, 0.759252217581, 0.973624774841, - 0.0970709268942, 0.217186301872, 0.323483837925, 0.700027780802, - 0.689721275966, 0.704567060573, 0.796236402743, 0.328741017657, - 0.279493863283, 0.683197985594, 0.334874484085, 0.208401127015, - 0.479075187762, 0.470557420731, 0.914139894892, 0.790934647643, - 0.0804004741063, 0.762086501493, 0.772626707746, 0.548779481975, - 0.229870891551, 0.207866864421, 0.225943889267, 0.521237456207, - 0.0560659413822, 0.243998516005, 0.982211417842, 0.452990118116}, - {0.164388738784, 0.501492491314, 0.537469975197, 0.57679574591, - 0.272281461334, 0.441179181962, 0.519328117302, 0.337317007724, - 0.338953094522, 0.833038304442, 0.463887472436, 0.160193544845, - 0.9848653714, 0.63051572434, 0.18822999732, 0.092417554839, - 0.582060763562, 0.331421263656, 0.44430338387, 0.409583011789, - 0.0478951735026, 0.600816623258, 0.0978146593333, 0.22071559925, - 0.407187233867, 0.324707894408, 0.397239210457, 0.0892571185103, - 0.714171998169, 0.914422236907, 0.257031184448, 0.793433306492, - 0.432806131843, 0.502492722743, 0.971356622363, 0.599565652557, - 0.909199955861, 0.658444934329, 0.414896987473, 0.478633371023, - 0.252254669943, 0.879276524667, 0.544036226636, 0.588337571516, - 0.34243892088, 0.540925190887, 0.189156881091, 0.364214338136, - 0.223954240374, 0.261634935207, 0.202778526889, 0.869452997092, - 0.915244189978, 0.857254180027, 0.749441024986, 0.232822225678, - 0.592124782264, 0.598357215054, 0.933796224332, 0.783617890077, - 0.943430307756, 0.207262966443, 0.622620186815, 0.772894696786}, - {0.602099239809, 0.788472368355, 0.251534199093, 0.90912703988, - 0.0897849630195, 0.904492047747, 0.521713955507, 0.905734603349, - 0.854006190756, 0.651506658544, 0.682154540146, 0.266758189805, - 0.350255385263, 0.331531776845, 0.927505995648, 0.24945073025, - 0.727279030339, 0.680374965654, 0.950494671643, 0.36866305432, - 0.192282930828, 0.592041716312, 0.614895604865, 0.161432918923, - 0.644660497559, 0.904270799778, 0.627470135201, 0.349399877219, - 0.392014292819, 0.492033403343, 0.506655298094, 0.26296624852, - 0.459706338032, 0.634210501379, 0.882916455544, 0.652565587491, - 0.508444150938, 0.571094885487, 0.277233878274, 0.545582765672, - 0.243029192748, 0.929337261016, 0.247914100605, 0.0656063561217, - 0.145114458662, 0.441763950753, 0.381092899899, 0.394309030545, - 0.299465180872, 0.473625150598, 0.633478570659, 0.0896172155617, - 0.591732776489, 0.568057914854, 0.407252184419, 0.351028644197, - 0.0515278260384, 0.10010676328, 0.131441005046, 0.680962517608, - 0.953763906607, 0.66328886659, 0.578002358358, 0.0879142804762}, - {0.614125987841, 0.0838329838513, 0.481931060281, 0.459099144579, - 0.966317277092, 0.0228554519927, 0.0648105636766, 0.0662368363085, - 0.517953589938, 0.42599644358, 0.568104674822, 0.124451454578, - 0.749782878156, 0.448825883712, 0.270961727513, 0.856048365554, - 0.31977359973, 0.872678511051, 0.186232006511, 0.236969540901, - 0.253473571103, 0.124079572303, 0.594547394987, 0.628294990433, - 0.654831167998, 0.604726708647, 0.902048357944, 0.478501236289, - 0.740361515242, 0.641269641431, 0.143067016795, 0.529744070626, - 0.947402746167, 0.421215230832, 0.647139956504, 0.67554040037, - 0.210804214932, 0.755545719332, 0.413949552983, 0.604480093588, - 0.948584963681, 0.274466521001, 0.0525509285802, 0.50297952375, - 0.959294211115, 0.740564280702, 0.0154872549443, 0.302762678437, - 0.053849116958, 0.373695877721, 0.668553771738, 0.977871224999, - 0.0842820527754, 0.318173834501, 0.382120019067, 0.871966105834, - 0.532384683339, 0.31807472469, 0.207275600134, 0.363358456967, - 0.0463949361818, 0.43315551058, 0.538091862069, 0.357520661053}, - {0.721311589863, 0.665932297679, 0.174738330438, 0.800901896487, - 0.316193083773, 0.135459829618, 0.628819420252, 0.365894316434, - 0.00445736340174, 0.90805949605, 0.920975245771, 0.917034458798, - 0.575722092916, 0.153512280208, 0.188793710574, 0.163955883752, - 0.969833817199, 0.231560833975, 0.70706858368, 0.50073811485, - 0.339286227775, 0.0704629629621, 0.330840767373, 0.772918974044, - 0.951015415783, 0.057030950707, 0.854764899171, 0.136396576924, - 0.571168516789, 0.013335512144, 0.932543543181, 0.155643413589, - 0.592059814007, 0.125711495648, 0.145097880507, 0.373396214406, - 0.475403603552, 0.348649597612, 0.28643408177, 0.525832276188, - 0.428484879969, 0.872431064942, 0.98674727418, 0.885859972777, - 0.0976394566188, 0.764146303718, 0.00169575318534, 0.865021020342, - 0.744075891428, 0.20234678161, 0.967521805507, 0.471128876167, - 0.228594275229, 0.699768343412, 0.561097464623, 0.330190890657, - 0.339980820968, 0.732248139274, 0.56606401949, 0.278594609419, - 0.925255754132, 0.855645916606, 0.937728432458, 0.489370495194}, - {0.659669921092, 0.749795380824, 0.187181332593, 0.644847838915, - 0.220400986313, 0.127452364854, 0.340747657295, 0.384438993479, - 0.21337689625, 0.343497916823, 0.406855335745, 0.547236761594, - 0.719533456004, 0.0674906406495, 0.126429484334, 0.801812094031, - 0.902105807828, 0.184591974369, 0.995860237755, 0.0872127298679, - 0.898231554245, 0.900589917429, 0.019895857857, 0.249289847736, - 0.667177786705, 0.067269192995, 0.520387975528, 0.408151374404, - 0.574330465514, 0.232100182706, 0.734206179949, 0.42396526945, - 0.102513676987, 0.579035028105, 0.394829050812, 0.81170251938, - 0.521679719766, 0.405144658361, 0.149784873903, 0.211789298713, - 0.167466087037, 0.537200102065, 0.60927025509, 0.0736224013259, - 0.771972178724, 0.830028581156, 0.619056539487, 0.676376017111, - 0.0037009059299, 0.974501965192, 0.343043264785, 0.00198023080065, - 0.705049019417, 0.0812303612379, 0.511902415918, 0.98660465571, - 0.477013212965, 0.440705273705, 0.84051767523, 0.903734363161, - 0.199565740555, 0.672207050741, 0.521598638868, 0.618950405185}, - {0.554156158827, 0.582242526278, 0.288212688398, 0.964256126762, - 0.767141154699, 0.394230935268, 0.0206430909611, 0.664268424773, - 0.257080948764, 0.545282280748, 0.466729504147, 0.63874287318, - 0.0459400280823, 0.540747163738, 0.392352935975, 0.318082418407, - 0.414595194989, 0.106245330137, 0.672875435707, 0.522155655792, - 0.219167540796, 0.89019714755, 0.199013249594, 0.44790201807, - 0.912008546298, 0.312316983542, 0.0257953702666, 0.222139500138, - 0.647936496457, 0.873261974957, 0.918377689742, 0.75863868248, - 0.68084266981, 0.843029856939, 0.593870114616, 0.735639105193, - 0.590478588412, 0.908688059395, 0.977854686509, 0.0955880293816, - 0.907659814033, 0.201086505893, 0.671348872413, 0.288999398339, - 0.476771384491, 0.367362532771, 0.648500055512, 0.243147004334, - 0.946797236208, 0.585358143876, 0.442536345072, 0.474917506009, - 0.528137141153, 0.156735412987, 0.696890851333, 0.225008266591, - 0.518803580745, 0.622744251345, 0.838257845592, 0.857669154293, - 0.346860459591, 0.86835703323, 0.934646495947, 0.249276189633}, - {0.0542237124141, 0.838509284037, 0.322440743957, 0.599765771956, - 0.687600414064, 0.652413093786, 0.132766760505, 0.938347935285, - 0.806350001412, 0.840880106239, 0.900752889778, 0.104985805001, - 0.155674773607, 0.7831287007, 0.504596021968, 0.963350691699, - 0.633697997742, 0.578106905397, 0.0509524674422, 0.667383537349, - 0.319015257239, 0.429651227809, 0.23812957343, 0.0891431995952, - 0.970110815176, 0.56710319919, 0.722347640045, 0.181224735042, - 0.000526671158742, 0.399622518493, 0.353559703243, 0.90019148723, - 0.679571681987, 0.160988073212, 0.462646826335, 0.740943692957, - 0.531579630735, 0.238531728459, 0.386334415768, 0.164482654499, - 0.313296077922, 0.213982324174, 0.400603840276, 0.156937127909, - 0.759521529228, 0.359095989571, 0.735338247982, 0.594360924215, - 0.850473377773, 0.873012744517, 0.810244789718, 0.627504478489, - 0.252077212161, 0.413822502781, 0.0661839543932, 0.495266889749, - 0.897208822067, 0.758245328896, 0.0841479389208, 0.453361366756, - 0.733280424676, 0.979023018893, 0.0779081860119, 0.460141430602}, - {0.689139287887, 0.613534771049, 0.239906686135, 0.944713062357, - 0.815199305778, 0.570647878618, 0.560927228651, 0.108430585564, - 0.0299280888191, 0.738222781315, 0.717585566829, 0.769371856876, - 0.775008364118, 0.141716981717, 0.563061300132, 0.593713641569, - 0.9202692267, 0.227517783728, 0.642699174662, 0.663986315282, - 0.126119046247, 0.300102922104, 0.665663431561, 0.187711081784, - 0.277232448256, 0.42160407197, 0.230436764403, 0.464626015297, - 0.300807048331, 0.0396097286519, 0.274826844201, 0.489415735551, - 0.141976020226, 0.213468910025, 0.661859036532, 0.0760840959506, - 0.100723809726, 0.258218091405, 0.517405095165, 0.361004589017, - 0.760878548735, 0.0140353127252, 0.319791012487, 0.75787656538, - 0.123757947957, 0.0175834686332, 0.78981105039, 0.571670249201, - 0.485445824823, 0.904696256245, 0.688304781942, 0.422034395104, - 0.184725396914, 0.451753278529, 0.34219106774, 0.999388168524, - 0.0519095597407, 0.485061816162, 0.963354900128, 0.614127495598, - 0.713022534835, 0.853573578524, 0.558845519826, 0.66153407504}, - {0.497351293707, 0.470776286195, 0.185240321933, 0.0319550428042, - 0.9944091905, 0.495514265677, 0.664059933516, 0.609487614037, - 0.319726431887, 0.00587435761151, 0.682271180896, 0.426329408923, - 0.885967213177, 0.553844897333, 0.0807165289983, 0.274640049543, - 0.694013208146, 0.523797718475, 0.716438114686, 0.778057551658, - 0.609036627705, 0.50833115188, 0.939669095446, 0.268306424822, - 0.89205639859, 0.893860658135, 0.53632627357, 0.902714923438, - 0.672942527887, 0.165493140054, 0.456861254085, 0.0379109402397, - 0.966158639132, 0.312267790298, 0.974195885036, 0.479128822852, - 0.723410577372, 0.227845211569, 0.922622799108, 0.248667120692, - 0.743149927091, 0.271066415099, 0.69613637229, 0.289293172546, - 0.719614779098, 0.0825172987185, 0.0881943975351, 0.51354943906, - 0.771549904417, 0.905705307848, 0.15291718361, 0.177398879265, - 0.717522366104, 0.435350301138, 0.417501871549, 0.344599143151, - 0.0787518640269, 0.633125412744, 0.703906657861, 0.144597383867, - 0.892963831487, 0.124019980373, 0.872673882751, 0.842342472619}, - {0.765464418688, 0.570420625344, 0.123941121975, 0.278974869464, - 0.0833438288189, 0.160251486769, 0.332666273846, 0.71347750602, - 0.303979633283, 0.367021084494, 0.27417496476, 0.66391021642, - 0.286001830869, 0.722851152646, 0.0281544276677, 0.661132595922, - 0.588365442884, 0.166910988163, 0.304298146287, 0.00793223705339, - 0.162914976271, 0.00346713393422, 0.938790309498, 0.233729534102, - 0.660267887686, 0.911547955787, 0.326259266395, 0.517009012814, - 0.812556209794, 0.637192790489, 0.456316808987, 0.827267902278, - 0.252038354489, 0.474419624083, 0.191574017912, 0.192193156723, - 0.68747054642, 0.0840204545537, 0.968231745382, 0.00380459910733, - 0.2407687105, 0.871962393621, 0.703051669871, 0.507208284769, - 0.10946110229, 0.296777206967, 0.894583291375, 0.967855612353, - 0.700789218319, 0.735179912142, 0.218649171588, 0.903259652289, - 0.430663641322, 0.440213271187, 0.200775660844, 0.246566950561, - 0.929051393259, 0.00569222254157, 0.992504059201, 0.0256627334066, - 0.936591303418, 0.210534205615, 0.472813857583, 0.332113504306}, - {0.116530557912, 0.597045571194, 0.70416920943, 0.894535199226, - 0.162023181652, 0.216188099909, 0.775956590125, 0.312067114472, - 0.640667539687, 0.139134629468, 0.770646200527, 0.446465290074, - 0.10998386105, 0.0241097843292, 0.592719595317, 0.623510206275, - 0.601078812527, 0.147455861424, 0.192382404737, 0.369837274564, - 0.510524740348, 0.434508352286, 0.652306619353, 0.112283129623, - 0.799011020953, 0.322060294815, 0.469285476506, 0.267708952294, - 0.039756494728, 0.388635072334, 0.73708493976, 0.907926199777, - 0.333767721402, 0.104798958081, 0.995009035908, 0.0219592221786, - 0.647697907062, 0.340874608108, 0.784083771295, 0.456990161972, - 0.853149973572, 0.25427264194, 0.78334420858, 0.141487054427, - 0.9035701837, 0.3157135572, 0.539746506509, 0.37343598515, - 0.155836086141, 0.257522668412, 0.280893226811, 0.0675572672708, - 0.393370047043, 0.112229443219, 0.112449281577, 0.93900604141, - 0.00958378286806, 0.763862865626, 0.629057272528, 0.626728406225, - 0.688813985317, 0.632627084157, 0.320368420655, 0.582708679758}, - {0.35194529492, 0.572446660384, 0.163588170067, 0.542364542908, - 0.753136827281, 0.399392188794, 0.692538003247, 0.853335915015, - 0.381519358137, 0.790452758737, 0.835836868583, 0.102166297572, - 0.705804272333, 0.0883447682332, 0.0104405349753, 0.669275559028, - 0.286261137991, 0.189754937936, 0.680124240621, 0.744176438317, - 0.342736082182, 0.852753227548, 0.308822352102, 0.193468591818, - 0.885135631367, 0.310932194265, 0.673156780721, 0.134906458094, - 0.411057158468, 0.653025569564, 0.300961705476, 0.960053972766, - 0.050726654119, 0.412810429603, 0.746976613362, 0.915502568841, - 0.920607010513, 0.0422403162768, 0.330545900531, 0.191433242177, - 0.941407876435, 0.453611674863, 0.496927614047, 0.759405036107, - 0.506162086234, 0.199124581098, 0.237011155373, 0.425061492702, - 0.298908160694, 0.824974288782, 0.0755956234543, 0.291730518059, - 0.0621849670092, 0.327843390051, 0.56513840447, 0.531039550601, - 0.925506396599, 0.313492601384, 0.57039655658, 0.785101211666, - 0.980339560174, 0.973271158529, 0.591185652895, 0.630730492828}, - {0.36801454296, 0.694391086855, 0.536802722004, 0.525211725084, - 0.367571549174, 0.846903646125, 0.811958016938, 0.517050900725, - 0.142803784778, 0.477726800799, 0.33456753314, 0.747661692275, - 0.0529646079782, 0.643752438426, 0.285226696916, 0.503723823545, - 0.228907164456, 0.508352302032, 0.532564659179, 0.622147398855, - 0.76114789854, 0.398857112618, 0.269516358466, 0.539081579865, - 0.815637832461, 0.241704509373, 0.867661679971, 0.91559531364, - 0.678049262812, 0.88328225122, 0.706246317305, 0.941822869586, - 0.567453051045, 0.047710375148, 0.801012868568, 0.18284936221, - 0.321525733245, 0.963204820116, 0.283622095974, 0.466787084515, - 0.20837689057, 0.922590509822, 0.11993918157, 0.83607279088, - 0.119347039189, 0.297853448385, 0.532115986454, 0.741308713672, - 0.344231576195, 0.086956969635, 0.00108608297676, 0.479663233301, - 0.538159755244, 0.0395494340851, 0.161572947817, 0.0865719747831, - 0.129222956559, 0.554192206981, 0.436185163174, 0.621797579052, - 0.0779606886794, 0.297421824029, 0.501696625594, 0.699068137589}, - {0.736209080975, 0.0344351896236, 0.824398464635, 0.300611095173, - 0.123488148384, 0.596594089613, 0.719282709948, 0.208428279945, - 0.64265513715, 0.406940625231, 0.368136774966, 0.694782114941, - 0.779424096872, 0.109638917986, 0.982718414049, 0.11524528422, - 0.729669265935, 0.638983073552, 0.422312544063, 0.781393054463, - 0.248933798245, 0.106126578928, 0.72875889782, 0.761575570106, - 0.507229880091, 0.184606338667, 0.240763663701, 0.750503519859, - 0.0327920137316, 0.467839178555, 0.863845496398, 0.517675360626, - 0.98104923195, 0.599893101558, 0.74580631863, 0.838212027237, - 0.0411072621189, 0.557917953597, 0.59347999057, 0.550594997976, - 0.631944576644, 0.943086642184, 0.503191569142, 0.0140433402258, - 0.946122833112, 0.679216518641, 0.779235071768, 0.487604682218, - 0.666191587698, 0.643576211075, 0.251805770484, 0.963928348564, - 0.685393504088, 0.578427261415, 0.570983222908, 0.933526910572, - 0.912929865087, 0.795332523314, 0.67479730098, 0.772058584083, - 0.0436340601162, 0.760953054088, 0.658962798536, 0.964870858294}, - {0.656539766614, 0.567301816564, 0.469460443407, 0.00299039883388, - 0.424534104206, 0.92848667995, 0.953292633412, 0.0287313427404, - 0.491535123794, 0.440629380581, 0.820877785998, 0.450136452211, - 0.695920717625, 0.490027914155, 0.110752495737, 0.296098654411, - 0.306304913221, 0.55947695811, 0.0129162836324, 0.649612782661, - 0.303759187153, 0.910251564472, 0.753717470862, 0.208529560386, - 0.397040220102, 0.895406573371, 0.22877848526, 0.614982810382, - 0.180024072936, 0.618094469437, 0.865630847179, 0.715174055355, - 0.0133943477944, 0.774012964048, 0.763821471556, 0.209874838955, - 0.245083578102, 0.578957847119, 0.406068102468, 0.474630101166, - 0.73711600109, 0.418755384362, 0.140061246107, 0.689713471868, - 0.569742528245, 0.994262207993, 0.961788287677, 0.231394028842, - 0.620324860412, 0.0196065256265, 0.743812407928, 0.408827013902, - 0.654005357379, 0.000207275155392, 0.943546582175, 0.436615976713, - 0.747705801794, 0.675718406013, 0.256143012001, 0.774777177704, - 0.919226963481, 0.910157516954, 0.3714383818, 0.104147986575}, - {0.325831145485, 0.654415428016, 0.996381944373, 0.192831844015, - 0.946505685167, 0.315693089386, 0.961800917104, 0.228836500483, - 0.0683677221072, 0.168468478514, 0.146473577034, 0.358431568909, - 0.652742096179, 0.822108279415, 0.446424618929, 0.865531042082, - 0.0454627142676, 0.271270042163, 0.0474120751846, 0.408323002014, - 0.179577801515, 0.187455612139, 0.198522273085, 0.212585476879, - 0.982657364383, 0.924518886668, 0.818748899099, 0.260351441137, - 0.801532576853, 0.980645500456, 0.180769505997, 0.392955774024, - 0.927861010339, 0.229261272229, 0.417921303354, 0.485780171589, - 0.559111547769, 0.502615546134, 0.131903804696, 0.820386666527, - 0.613001372617, 0.471554238947, 0.0173465710993, 0.341821948846, - 0.829559420004, 0.559138049808, 0.27799388349, 0.64257143667, - 0.613076628827, 0.516520488465, 0.19318331059, 0.419098957561, - 0.284190522808, 0.447247327108, 0.965415104771, 0.0620117947888, - 0.470273534334, 0.85239807074, 0.729645712316, 0.936529290323, - 0.54647316534, 0.48339438976, 0.705606882942, 0.206449269329}, - {0.853217089983, 0.817486634571, 0.36857671532, 0.760782371495, - 0.13907772594, 0.278813903793, 0.121756681212, 0.582301666848, - 0.294583859182, 0.570254738586, 0.940434885828, 0.858946213283, - 0.102884450037, 0.737136920734, 0.151760408247, 0.782504384998, - 0.537861802209, 0.143026497329, 0.576377225389, 0.282493380159, - 0.195095669374, 0.108410370184, 0.108380787174, 0.0261607335232, - 0.331830078127, 0.725114807715, 0.611384844361, 0.857527965233, - 0.910433709665, 0.36905444843, 0.642858878638, 0.852717970555, - 0.0756746243895, 0.894586879117, 0.934836864124, 0.733698958611, - 0.681313305359, 0.907051593869, 0.482034719632, 0.639115293589, - 0.752592210985, 0.302425107391, 0.381894685663, 0.444629263721, - 0.473142126296, 0.49111648146, 0.80834986717, 0.791112800082, - 0.699250873004, 0.905525552041, 0.248491126471, 0.519346349867, - 0.0828322800539, 0.140843852063, 0.670932632856, 0.823426108553, - 0.192413418482, 0.658588904729, 0.333489414483, 0.110077311365, - 0.0792942478159, 0.47270993441, 0.839951851201, 0.352397031605}, - {0.197732940118, 0.0895837414316, 0.0760330640907, 0.254148935617, - 0.16286908969, 0.440615372752, 0.746981079508, 0.10272565059, - 0.196106212026, 0.811091984584, 0.0726070261338, 0.27312093469, - 0.513725954181, 0.71725056579, 0.773944163331, 0.578815073426, - 0.765358796752, 0.431009515556, 0.561966049906, 0.607647426701, - 0.138899494691, 0.882591778025, 0.93648140244, 0.970079319916, - 0.191674981925, 0.503942160549, 0.0156350832182, 0.438133824468, - 0.211007600617, 0.741623668307, 0.475516676847, 0.115056107317, - 0.475324780966, 0.678260484942, 0.991440109737, 0.210327561339, - 0.164807366651, 0.0972929712664, 0.638544678414, 0.856648688661, - 0.184115965225, 0.325111433407, 0.192312282323, 0.512576408991, - 0.30494161296, 0.660572919519, 0.0351555621603, 0.995846368934, - 0.195614188447, 0.869756047195, 0.244355774753, 0.174186773562, - 0.955939539997, 0.314754930481, 0.976868447068, 0.615290648012, - 0.47526532675, 0.458069301967, 0.223214739779, 0.548457386344, - 0.804743682734, 0.846647264566, 0.898725907615, 0.658405749879}, - {0.745529219228, 0.710433394816, 0.787609591513, 0.305514299513, - 0.100013358197, 0.131334780846, 0.899254385881, 0.48153187199, - 0.0336671788701, 0.749665024333, 0.441929618324, 0.881123533208, - 0.427256733923, 0.386302496157, 0.293491654409, 0.879080932313, - 0.746765656376, 0.139233939853, 0.893502843525, 0.689683178949, - 0.201605831091, 0.306596045894, 0.890181764835, 0.000298442055551, - 0.983375872884, 0.739458975994, 0.458256534382, 0.708992661149, - 0.760880832906, 0.750936144765, 0.0746474454851, 0.188091837901, - 0.420375051965, 0.787728826167, 0.100866930079, 0.729589560817, - 0.0430477098798, 0.379800487914, 0.329529043173, 0.968375575685, - 0.00351954249055, 0.4085338744, 0.39576452797, 0.770915136719, - 0.931870946967, 0.676430810268, 0.0805330496448, 0.404727265372, - 0.749220240762, 0.635005183109, 0.0451688035169, 0.25184834536, - 0.449747890301, 0.993879534139, 0.946985538653, 0.529866299912, - 0.909564083302, 0.444329948354, 0.533350504311, 0.311630501237, - 0.935031652909, 0.764053877435, 0.771959682739, 0.366208580743}, - {0.139371116057, 0.913255343502, 0.581961917101, 0.49147563134, - 0.578162476529, 0.330918869914, 0.845333579242, 0.967811282673, - 0.888948711908, 0.524420174167, 0.252525718764, 0.304275080792, - 0.567741201642, 0.830745487412, 0.901884678631, 0.863012545054, - 0.882935585896, 0.910867225584, 0.255563659657, 0.0314139500625, - 0.939821710344, 0.50022518864, 0.9697591553, 0.430155055378, - 0.382201365181, 0.581335789038, 0.0239184983035, 0.67491601804, - 0.523105355049, 0.865639685444, 0.355774104774, 0.826195998258, - 0.0507820258738, 0.494355014064, 0.450212249199, 0.971451358734, - 0.980578301154, 0.895774099089, 0.355119558683, 0.54521881866, - 0.0560001156338, 0.600417873065, 0.246593332092, 0.722098255946, - 0.901519877644, 0.168673139055, 0.991741043133, 0.904952553044, - 0.487259289851, 0.521681817025, 0.730529471655, 0.829350423475, - 0.103472363776, 0.497876902655, 0.601870017445, 0.766209505489, - 0.292930843808, 0.915862763515, 0.651545845294, 0.355536676715, - 0.694219437798, 0.868742677543, 0.346820894515, 0.364243823718}, - {0.578068558035, 0.0830173634086, 0.0504567620673, 0.119664865381, - 0.680863871207, 0.871801107123, 0.0810877213123, 0.198129069778, - 0.624987213014, 0.992103712846, 0.184639913996, 0.980353590062, - 0.311306102925, 0.699536791757, 0.709541158464, 0.9663162324, - 0.482698238439, 0.198148018644, 0.876755718834, 0.227184947233, - 0.232045169712, 0.761905813609, 0.748325096318, 0.804218975846, - 0.219665540893, 0.128286262367, 0.119818998626, 0.506343160356, - 0.731780407075, 0.201480137762, 0.937142517203, 0.811671161319, - 0.272263464399, 0.927550695956, 0.726884101761, 0.111687637175, - 0.79372061237, 0.872120151309, 0.566782565198, 0.0187654804291, - 0.592810696949, 0.124178258985, 0.244139058416, 0.62478910527, - 0.155932577145, 0.994843152883, 0.0221597494915, 0.980950159323, - 0.458327824732, 0.52276800018, 0.542895979185, 0.54622979225, - 0.843542246782, 0.550007789866, 0.860974659477, 0.240324929113, - 0.989816519511, 0.574409231867, 0.262326629133, 0.733215785241, - 0.932978630442, 0.797177601684, 0.496778906591, 0.606921881511}, - {0.308139816456, 0.66268062251, 0.718051765932, 0.240384771255, - 0.69514840714, 0.827120760723, 0.217308219034, 0.545138771644, - 0.662770353647, 0.000542066994976, 0.116045280874, 0.75510898926, - 0.972642870604, 0.0161024165077, 0.507426003225, 0.095529946976, - 0.320169393234, 0.707004348442, 0.220113939466, 0.843006416574, - 0.276324980935, 0.855659543151, 0.264139620793, 0.11370495488, - 0.97681481578, 0.827578077083, 0.674913691095, 0.659366328525, - 0.0208850358763, 0.0515771120506, 0.71797595529, 0.831941621036, - 0.332641183362, 0.254823431048, 0.828947492197, 0.94159489056, - 0.81375622384, 0.637683193176, 0.903866561939, 0.838828775707, - 0.211760213131, 0.768495895, 0.749077825167, 0.38617014504, - 0.644547400542, 0.0152777980771, 0.570022059962, 0.0547590147228, - 0.428718657434, 0.893396228431, 0.523103962455, 0.277250300499, - 0.196866993014, 0.728211406824, 0.261453631959, 0.0487686538128, - 0.535795926886, 0.0841837515485, 0.804188946296, 0.917317400672, - 0.459639117384, 0.0557352430469, 0.500016920314, 0.0557105936753}, - {0.0342366603262, 0.0233662057166, 0.300633627039, 0.0851153087098, - 0.841976505952, 0.724469236094, 0.790537913312, 0.588217555407, - 0.456682146626, 0.42503923837, 0.426931068973, 0.0455377646894, - 0.992258856276, 0.646576921763, 0.474591198483, 0.0888033204583, - 0.652220328717, 0.545031189453, 0.114051743081, 0.576103883339, - 0.192352132863, 0.734292690804, 0.299204281326, 0.229202045646, - 0.128141451696, 0.137905431854, 0.513376732365, 0.652534656685, - 0.487954111299, 0.958252696267, 0.715448701744, 0.450412597218, - 0.873279479227, 0.760523037466, 0.94278990277, 0.5875137783, - 0.107144474056, 0.631875451011, 0.847569294161, 0.76657526993, - 0.92249345702, 0.320493363824, 0.407186318029, 0.371766100119, - 0.183470929552, 0.229805493148, 0.0959758932583, 0.407502896685, - 0.293325654685, 0.27167037408, 0.750485739588, 0.541483629834, - 0.75776686311, 0.942212039884, 0.807608911505, 0.36220214081, - 0.928273682205, 0.0794074097085, 0.12938548279, 0.259642511311, - 0.77475959553, 0.339409214114, 0.958868322883, 0.135528352688}, - {0.771272135147, 0.941197483963, 0.605430853256, 0.446453833274, - 0.656107629872, 0.47705833653, 0.536066540506, 0.646741803627, - 0.895213199994, 0.740620394366, 0.288367934275, 0.212017453174, - 0.537234689365, 0.949564677862, 0.301735738962, 0.988816354068, - 0.958433498327, 0.815463769101, 0.611255054263, 0.214012911745, - 0.188482366101, 0.758735650747, 0.27430904673, 0.888931461478, - 0.0572435958298, 0.390263330644, 0.266794990763, 0.173501282795, - 0.0474068803243, 0.146495692245, 0.692999552772, 0.573267458341, - 0.194336698133, 0.129842389985, 0.996200353134, 0.408143159353, - 0.151929348458, 0.274662558146, 0.879888153809, 0.332608183147, - 0.980544823504, 0.163239916816, 0.671445156882, 0.645055304635, - 0.305110962526, 0.908474452159, 0.900230897733, 0.529058367164, - 0.68515597819, 0.543153268251, 0.786552233961, 0.476621528393, - 0.928218117146, 0.149156471046, 0.122591818676, 0.725519761326, - 0.596341643131, 0.00112996070503, 0.25357730956, 0.321688885181, - 0.131489276222, 0.421065813826, 0.215623523922, 0.334139738353}, - {0.991880864236, 0.26697826626, 0.330300285143, 0.44471376768, - 0.975672203417, 0.950274688782, 0.114498250481, 0.443746736103, - 0.493552740374, 0.244041550496, 0.731892503699, 0.0691227037347, - 0.387557284978, 0.655783772058, 0.99613199226, 0.936838838492, - 0.309097754892, 0.743093306669, 0.283327881348, 0.745989715595, - 0.664106416609, 0.0562295450889, 0.845881069461, 0.439070013634, - 0.834976195634, 0.247546161531, 0.892223765632, 0.970938805891, - 0.821194954455, 0.298407711416, 0.464619010396, 0.509328108499, - 0.756911546353, 0.439493750575, 0.453897831348, 0.301101579082, - 0.0233288798497, 0.0720182530166, 0.832091660122, 0.515251764139, - 0.250167207448, 0.089494983916, 0.650693396424, 0.770604706429, - 0.706439369825, 0.638351309708, 0.0624540391064, 0.252489046589, - 0.990025372529, 0.482428344834, 0.814450779242, 0.320386171325, - 0.793212273137, 0.674318522829, 0.533239339798, 0.527197839459, - 0.82731844191, 0.470529653986, 0.598049141238, 0.72230236936, - 0.958850904688, 0.232718100572, 0.451637765286, 0.0272545179151}, - {0.300713781346, 0.178156701747, 0.626594644205, 0.470794896402, - 0.235826208574, 0.642690867092, 0.173365221425, 0.12235589102, - 0.324794849346, 0.124947720138, 0.857963509094, 0.277743650549, - 0.966541389196, 0.377004510473, 0.181980071856, 0.571645672764, - 0.62966101102, 0.81591057059, 0.614513687622, 0.450522350223, - 0.156276536085, 0.351300500358, 0.829398345317, 0.158447648876, - 0.157017674331, 0.865698499222, 0.338965803845, 0.867686450919, - 0.77393759062, 0.64367165415, 0.335847278343, 0.11064717773, - 0.565188698482, 0.40022499664, 0.907153542552, 0.585838013064, - 0.479334028858, 0.444295400368, 0.23484579775, 0.864875294982, - 0.862608872462, 0.922778230363, 0.574771306047, 0.909486209137, - 0.27560283741, 0.0167272061112, 0.755950934129, 0.636060824279, - 0.541754926796, 0.0492719097107, 0.474795835059, 0.316588113177, - 0.881705280816, 0.116469163356, 0.969252996275, 0.596899651132, - 0.798095779536, 0.63376302442, 0.467709310143, 0.52553875295, - 0.727659750074, 0.0863143513305, 0.555157817193, 0.793185136618}, - {0.984147439556, 0.0214964005092, 0.789913814845, 0.349463862389, - 0.0218373576594, 0.743873883249, 0.280466676028, 0.400801863175, - 0.484548764765, 0.073796843294, 0.275689057554, 0.493411211476, - 0.785014734717, 0.991905153045, 0.748196026862, 0.431639451234, - 0.961315554462, 0.538628941425, 0.652272953476, 0.35321588725, - 0.501231097423, 0.239564108685, 0.28228446479, 0.804786424468, - 0.602661022203, 0.760124582772, 0.0658498789807, 0.261468404739, - 0.336591738291, 0.943803065348, 0.343222049172, 0.562257840409, - 0.855657431868, 0.23424181386, 0.000406153767697, 0.656182423142, - 0.31552440072, 0.890480570017, 0.308915046352, 0.699717866, - 0.599942215138, 0.415374189088, 0.500245771371, 0.120402569655, - 0.877265107423, 0.097483054693, 0.693534919735, 0.182890790137, - 0.516572896161, 0.291918719157, 0.145965792013, 0.629573822448, - 0.980223727679, 0.498055981171, 0.666883963558, 0.177336373921, - 0.221311682415, 0.730028368542, 0.71264667755, 0.837293203094, - 0.589634042247, 0.715478667881, 0.14105339411, 0.997208027124}, - {0.627227041113, 0.320961835728, 0.0959914924179, 0.0115384909391, - 0.271612184593, 0.61602325187, 0.26151466167, 0.955543988259, - 0.387497254146, 0.0806707216416, 0.395771013585, 0.521161187045, - 0.342416194175, 0.108352382417, 0.672726620368, 0.97482350978, - 0.830991556479, 0.514226141729, 0.452853570475, 0.197321640992, - 0.894962419357, 0.682283334739, 0.591086578785, 0.436188048556, - 0.103433675889, 0.220001077261, 0.639658657153, 0.433210328287, - 0.891978521146, 0.538534490461, 0.377948818929, 0.154772567789, - 0.358568314531, 0.321519134976, 0.384690121731, 0.34568845086, - 0.718821899972, 0.303415246512, 0.0978576876407, 0.663446414254, - 0.164234362961, 0.645519712012, 0.227597523729, 0.536975533035, - 0.546169512339, 0.357422756931, 0.742545431319, 0.0260314423671, - 0.773694266454, 0.842695251265, 0.201893414876, 0.364910655285, - 0.762040975642, 0.794916267989, 0.818650900689, 0.113988425973, - 0.983397416973, 0.445324094796, 0.150184029336, 0.559123997882, - 0.364834461982, 0.0743973406376, 0.92417504834, 0.592809306273}, - {0.0812193234432, 0.470660037838, 0.383116025942, 0.742320031873, - 0.436992341201, 0.194425435507, 0.0565046569014, 0.146999738301, - 0.674041556507, 0.646319134952, 0.955370553851, 0.606434149024, - 0.0994032742806, 0.59262957216, 0.413696464439, 0.932049131881, - 0.988130231379, 0.211623386416, 0.633292076467, 0.517586595166, - 0.865518900841, 0.849850886472, 0.554858027723, 0.225196257744, - 0.852936191588, 0.553091141458, 0.605041587261, 0.877710414635, - 0.292024223774, 0.709580820799, 0.52802719659, 0.215459370682, - 0.18139316362, 0.0115144360419, 0.59864894804, 0.194255698775, - 0.204857916028, 0.620794624827, 0.00517665299183, 0.422528141988, - 0.362437316695, 0.363960350105, 0.466506933495, 0.6278182133, - 0.011830715431, 0.303444183764, 0.155685676858, 0.344731078477, - 0.740378811141, 0.410140580487, 0.0462790518973, 0.652770358382, - 0.923039953329, 0.961553786632, 0.383922245399, 0.237166131769, - 0.622714736893, 0.462168363455, 0.815591156252, 0.0625955543104, - 0.219984616917, 0.728034690417, 0.968993047765, 0.883645862685}, - {0.307233905575, 0.710309270467, 0.222105787545, 0.723910743064, - 0.701441886795, 0.576526031849, 0.269107433071, 0.879278435947, - 0.605490077196, 0.431612744393, 0.259449497337, 0.842319454334, - 0.0782568199563, 0.607909274184, 0.882975130898, 0.14134463945, - 0.0203926504119, 0.0949429003204, 0.772590294568, 0.376424119806, - 0.913310240915, 0.850683099752, 0.830124157295, 0.689310262741, - 0.638766820843, 0.383940108318, 0.424756918427, 0.965119188061, - 0.390258555562, 0.697960880928, 0.472205429409, 0.861587141302, - 0.58333506396, 0.815402039835, 0.682264634609, 0.767704349889, - 0.023864048118, 0.926194453075, 0.610241042507, 0.956964563484, - 0.72149475626, 0.44373463443, 0.119703381146, 0.57345996066, - 0.0303038671199, 0.760241964439, 0.934933631843, 0.441991551133, - 0.58541193063, 0.653593118182, 0.438564293538, 0.715027764988, - 0.950581091372, 0.190344104684, 0.973126791299, 0.817194071481, - 0.866834603252, 0.480802990015, 0.980871600493, 0.0436509941045, - 0.217777932586, 0.798666568826, 0.892377770376, 0.255145208078}, - {0.0482528754535, 0.120436772487, 0.78961318743, 0.466014125224, - 0.992175922572, 0.0124177136635, 0.824138951771, 0.403620484327, - 0.685304350892, 0.421326897426, 0.99022694282, 0.530734314714, - 0.995232157843, 0.430550594724, 0.363037538255, 0.984057608371, - 0.80130967268, 0.29935716418, 0.27503279215, 0.525639944339, - 0.715969172449, 0.0652615310998, 0.168763726738, 0.457840584892, - 0.427316117471, 0.147760651574, 0.832848369098, 0.34550361692, - 0.0345626251019, 0.604503752878, 0.380109263504, 0.83704374153, - 0.773019185106, 0.604514549282, 0.917068344162, 0.198003304725, - 0.574377584427, 0.35876932223, 0.409482391259, 0.789744606574, - 0.577273495138, 0.738510596258, 0.2365950687, 0.546258916887, - 0.0744191815566, 0.63724391017, 0.23810165546, 0.124901285103, - 0.472663142568, 0.851628628441, 0.657619279885, 0.164812493373, - 0.3322292316, 0.432163851064, 0.892316543415, 0.0850019174236, - 0.520477003369, 0.377377187017, 0.814281765928, 0.883591574404, - 0.0713462197739, 0.0373911527245, 0.733974471138, 0.693279999832}, - {0.886172998282, 0.541201918911, 0.980087695491, 0.887040183398, - 0.191055240595, 0.326160163598, 0.70628123801, 0.537885065638, - 0.55619734826, 0.284426256689, 0.791050043118, 0.298979660227, - 0.543213447843, 0.58550886753, 0.448734288938, 0.201866940722, - 0.332364515695, 0.864110547874, 0.324080595338, 0.998704139918, - 0.112172096822, 0.59573473343, 0.520864713147, 0.341019963771, - 0.369469929656, 0.459553444591, 0.565604238004, 0.682330279003, - 0.568061550897, 0.36972225763, 0.0943574848703, 0.758976688286, - 0.0474626639586, 0.352016920487, 0.169782448735, 0.797459067188, - 0.593185585474, 0.0338482022683, 0.654601539749, 0.894575787297, - 0.277077754854, 0.307542668683, 0.42792642662, 0.948838807351, - 0.222376525978, 0.713695154213, 0.24358193153, 0.079831878564, - 0.245184018681, 0.859068979583, 0.107897223244, 0.461651964516, - 0.792723831789, 0.043684963847, 0.238127067057, 0.140424086907, - 0.140764772117, 0.131417253994, 0.7951486364, 0.511657453314, - 0.0776041894684, 0.295701655766, 0.356528908033, 0.0185886516656}, - {0.837960215184, 0.998871848372, 0.164405491832, 0.143123132365, - 0.39281298325, 0.330426310293, 0.288949238146, 0.527428199767, - 0.0370505725766, 0.692323153284, 0.107737465709, 0.985228207548, - 0.891700214245, 0.220421009475, 0.842959593622, 0.349030993658, - 0.0290858275376, 0.773663919794, 0.953914272067, 0.946057016765, - 0.882681792044, 0.211061660036, 0.200135932468, 0.579219805303, - 0.0158535213521, 0.92783776529, 0.161460615603, 0.0885758319833, - 0.119030998125, 0.814177847093, 0.000825838013153, 0.610206901994, - 0.281014292363, 0.33473879722, 0.701006456536, 0.751843428132, - 0.533186519443, 0.707219968074, 0.43193449718, 0.035889114002, - 0.219949587424, 0.671501251158, 0.49088912089, 0.525227260798, - 0.467419528933, 0.662799608719, 0.289561471241, 0.933560271384, - 0.326138782259, 0.510762750854, 0.0916789877156, 0.6853963763, - 0.405458954776, 0.581662096718, 0.924177016474, 0.267320796108, - 0.582662045522, 0.0889698769866, 0.569061296671, 0.0409508199828, - 0.904608550842, 0.37294200772, 0.126024884793, 0.411331873758}, - {0.350562998368, 0.893982700628, 0.086738411271, 0.249993740795, - 0.702970609467, 0.497247649937, 0.96711524241, 0.0149665770435, - 0.37220199616, 0.689662887178, 0.964399197018, 0.55647813232, - 0.565925753965, 0.318861767656, 0.953680557052, 0.00476326370277, - 0.704276994256, 0.580546892246, 0.0258152388188, 0.737589561241, - 0.917547703787, 0.0939619709027, 0.215467210519, 0.170814715746, - 0.592342893708, 0.781752295528, 0.172287135667, 0.196748601009, - 0.850630216311, 0.768422900231, 0.306853104745, 0.560571711119, - 0.858218842967, 0.704457819529, 0.523539141204, 0.63664316476, - 0.180904052576, 0.537347117196, 0.140488050178, 0.949365200496, - 0.911941230251, 0.45842326455, 0.202411489798, 0.807751869834, - 0.443190237985, 0.563851433782, 0.877379853245, 0.745058148692, - 0.0442612907279, 0.695943154539, 0.873361222356, 0.0835645596484, - 0.0705405584728, 0.434995841311, 0.868043177212, 0.961857802885, - 0.881450520962, 0.564374989039, 0.805202477175, 0.0782697918123, - 0.956685949647, 0.619478730094, 0.910261495532, 0.0046012127666}, - {0.610333500455, 0.802539728436, 0.0338763073576, 0.00372704389033, - 0.152730396516, 0.0863481720437, 0.301665222156, 0.847547409898, - 0.839670425012, 0.705938122976, 0.620421962947, 0.949922558862, - 0.496314341139, 0.216655000411, 0.965504039092, 0.529353045523, - 0.859906105012, 0.644373210641, 0.419864371421, 0.375920862637, - 0.300835892114, 0.250544830832, 0.181031555818, 0.731704165955, - 0.488385355986, 0.328503028137, 0.358809486231, 0.983813789723, - 0.016784613068, 0.177448548251, 0.947651410271, 0.686527981768, - 0.722348266315, 0.406177624214, 0.897418104924, 0.0592345574023, - 0.259007214887, 0.584724444522, 0.117365760592, 0.189029396289, - 0.206155474995, 0.904955258145, 0.36009729721, 0.868449680228, - 0.767556331715, 0.222596761006, 0.275352406033, 0.514395328319, - 0.259200588717, 0.872712846918, 0.603255689604, 0.703349345377, - 0.245745084931, 0.698458954831, 0.561166774321, 0.126651108681, - 0.895018117476, 0.642477910783, 0.588069482569, 0.942347787666, - 0.488376622438, 0.905081538384, 0.870700622177, 0.426359084388}, - {0.222784592231, 0.0112060890636, 0.686273232221, 0.388190703227, - 0.243056898518, 0.820005955662, 0.556535313286, 0.790989376039, - 0.210908810564, 0.729693043758, 0.78948598553, 0.894604696576, - 0.481962714112, 0.172963373311, 0.298731726366, 0.651726276532, - 0.338581102814, 0.290748393612, 0.467522345206, 0.151997616384, - 0.216531069537, 0.266892029251, 0.104489265744, 0.0323712113489, - 0.856769843414, 0.810960049005, 0.708178452543, 0.426057582222, - 0.234250180825, 0.555301785951, 0.190563053595, 0.868377388484, - 0.875639006402, 0.812534933856, 0.795684485155, 0.748101205168, - 0.365121240623, 0.159248941877, 0.629029428291, 0.762307019732, - 0.346437400091, 0.0392260182144, 0.0569124055096, 0.0208512869762, - 0.656859400206, 0.521674864095, 0.388810240931, 0.176953092521, - 0.0395843854994, 0.161104616932, 0.157525909764, 0.521482034278, - 0.47956256956, 0.583874601287, 0.878131326347, 0.359131179816, - 0.893166386751, 0.706814056432, 0.510024947715, 0.00116122835639, - 0.184824292157, 0.604006592872, 0.439416275191, 0.618682899595}, - {0.895218117833, 0.059560372395, 0.857316774828, 0.640396341136, - 0.339880093404, 0.323138342364, 0.072695902214, 0.992660754125, - 0.182919937703, 0.764352563484, 0.744049418614, 0.493278500101, - 0.530819710056, 0.0553503657363, 0.781384428186, 0.0554622043693, - 0.656702790505, 0.883688608105, 0.20353055894, 0.430241703627, - 0.83587468094, 0.976583649356, 0.777589703496, 0.97406238751, - 0.0261667790217, 0.374498641973, 0.34331934978, 0.643379611024, - 0.852798051419, 0.283445322384, 0.288805296042, 0.632304261812, - 0.265204495449, 0.295912971004, 0.681611421635, 0.842120079524, - 0.941478499174, 0.343422302528, 0.921521059845, 0.606724099932, - 0.512416254125, 0.528866139101, 0.401648995096, 0.368822902334, - 0.070108646809, 0.721875390671, 0.355555434242, 0.13404237458, - 0.861796610224, 0.314126996849, 0.314803744538, 0.107705935809, - 0.70983958845, 0.924912186857, 0.443136448605, 0.700766519345, - 0.466713358844, 0.841680874271, 0.897138271074, 0.602996037985, - 0.541516339831, 0.0252404006767, 0.442559916329, 0.162658142372}, - {0.282447508459, 0.0989301323817, 0.663831093852, 0.663244457708, - 0.479396590572, 0.626490974281, 0.622346367707, 0.0431823851156, - 0.00606598026107, 0.85868456233, 0.966120227327, 0.249705723101, - 0.639153656227, 0.744515063202, 0.483186891579, 0.592695163221, - 0.265032887693, 0.182048834916, 0.253575172011, 0.931880786393, - 0.604899102057, 0.873021615377, 0.342141397852, 0.498709961668, - 0.0470936429085, 0.283921782942, 0.657788045053, 0.614048204533, - 0.702964068783, 0.331174473875, 0.847517634621, 0.0913256808037, - 0.789795376006, 0.0511525374367, 0.282961103817, 0.774533080288, - 0.0400045036995, 0.225675007833, 0.787733633545, 0.982674953014, - 0.243474320509, 0.18432105011, 0.461041248721, 0.977158500835, - 0.965156012728, 0.461692361588, 0.444884286013, 0.866884297985, - 0.28845479425, 0.181832955342, 0.471686406167, 0.649970046078, - 0.719083238337, 0.714584902216, 0.724954430454, 0.373835016436, - 0.417232373097, 0.305828562623, 0.996351693414, 0.0591715349069, - 0.707500851021, 0.432673729562, 0.136068901144, 0.0415951772217}, - {0.347612758702, 0.57771395975, 0.646838373413, 0.645487535322, - 0.0539037228515, 0.325542745714, 0.310953478985, 0.22701792536, - 0.303301142325, 0.0134839164604, 0.520435317392, 0.485256643666, - 0.847724186076, 0.0799925389789, 0.184167850225, 0.544814134463, - 0.742670021709, 0.880623268108, 0.420641632088, 0.344716773058, - 0.0174887937582, 0.591719769717, 0.425013005748, 0.770430192566, - 0.954200981621, 0.305468135606, 0.0488942163804, 0.0780689840578, - 0.079020571259, 0.49086381117, 0.0710563737243, 0.476541137119, - 0.140299177486, 0.226309657782, 0.999856364117, 0.172727630401, - 0.359291064416, 0.475899452178, 0.670633717154, 0.291502934466, - 0.0672604625142, 0.729292207632, 0.245009639737, 0.164451121563, - 0.757026234872, 0.611026316007, 0.25664162884, 0.923064281759, - 0.107356637811, 0.242795870644, 0.181571272859, 0.0668781855024, - 0.325598350864, 0.913042620958, 0.34822625409, 0.769590378101, - 0.576692908303, 0.453187406107, 0.121337005452, 0.386327475916, - 0.823873664063, 0.919659725318, 0.339814164485, 0.689032466669}, - {0.385218065231, 0.283117988428, 0.00733357115853, 0.598198585238, - 0.480243422974, 0.272973667817, 0.526579712966, 0.253251350978, - 0.748035777071, 0.751311994574, 0.187826488917, 0.983125312004, - 0.453694061294, 0.906828731593, 0.489989116522, 0.446693940553, - 0.0117532927129, 0.982662817662, 0.872684212141, 0.368398010961, - 0.00224302652512, 0.067534088776, 0.302036416631, 0.36502370779, - 0.0507296064451, 0.0646551795017, 0.44630508067, 0.986701467969, - 0.739476322403, 0.182963508419, 0.368306274209, 0.56418419455, - 0.471506406186, 0.216036049114, 0.132376884165, 0.60454198414, - 0.046437183895, 0.825186049551, 0.54655794207, 0.9296029839, - 0.308926764339, 0.556565887759, 0.102529252343, 0.840269163259, - 0.696823967934, 0.130649698638, 0.744152780606, 0.552231482184, - 0.615763055692, 0.224692700803, 0.296611760294, 0.103604783169, - 0.677257798215, 0.464635916442, 0.916008639541, 0.405342825529, - 0.922216909224, 0.11604408099, 0.507342568009, 0.754605797592, - 0.557154845431, 0.503980650308, 0.4954330001, 0.640252080968}, - {0.156852613503, 0.563334241056, 0.405201413534, 0.607050413891, - 0.367883582931, 0.731576238265, 0.779422396923, 0.829078820845, - 0.980957554184, 0.709941278098, 0.232315661636, 0.201381943562, - 0.605818629987, 0.576296012769, 0.398771949621, 0.999603202772, - 0.391367213204, 0.3999880802, 0.0630379477782, 0.60000911894, - 0.459684660442, 0.663440063, 0.297724368158, 0.0158791401474, - 0.56300031202, 0.334151597304, 0.181997626107, 0.0912221851066, - 0.876578320405, 0.449034120959, 0.287406106502, 0.841405036182, - 0.158412263635, 0.591232955102, 0.242468733866, 0.479030837728, - 0.0784949349681, 0.0712713438516, 0.286360499558, 0.699935225784, - 0.161368318321, 0.981868716582, 0.295662511079, 0.277986593563, - 0.494978884386, 0.279318111612, 0.925540455702, 0.415328395401, - 0.569366874208, 0.725792205295, 0.826687422387, 0.963098629683, - 0.523071018166, 0.845399212763, 0.162256683865, 0.536389959195, - 0.353506812518, 0.159291520657, 0.0968753126046, 0.958259244938, - 0.511514147983, 0.745407756467, 0.802283277195, 0.584263746025}, - {0.108297126501, 0.71066701925, 0.709873154612, 0.751586999379, - 0.0200623503455, 0.180166759862, 0.146579357643, 0.79576047102, - 0.807936327365, 0.811068158307, 0.723851738398, 0.848883917216, - 0.166644887005, 0.40400249599, 0.0332294168762, 0.852768538096, - 0.887468958008, 0.126439438744, 0.441368282541, 0.490150384667, - 0.456363949835, 0.267200927226, 0.694687973656, 0.0914845719153, - 0.592881823853, 0.427353255036, 0.0601827060613, 0.00795760443212, - 0.373377510753, 0.539744933535, 0.0451154815084, 0.0676266282207, - 0.748690033831, 0.56028035228, 0.411062107876, 0.8621388755, - 0.553122296052, 0.39618894369, 0.751526988145, 0.862623122317, - 0.864648039395, 0.332524819939, 0.122374169434, 0.567370489108, - 0.596196893783, 0.51688693307, 0.429035958581, 0.82267106099, - 0.912537175772, 0.545668298158, 0.417704029656, 0.904553324023, - 0.756147902533, 0.70875412353, 0.385001217003, 0.888658222127, - 0.54909857458, 0.467534822595, 0.222022724438, 0.645357011845, - 0.954401342383, 0.926932622571, 0.916094911783, 0.661777599945}, - {0.822624648296, 0.182394061332, 0.9137738532, 0.792656287313, - 0.109690966145, 0.254816390411, 0.89851966962, 0.901980321328, - 0.228651302698, 0.0321772945911, 0.316591039555, 0.974696548548, - 0.956658564205, 0.287550659418, 0.0966113117229, 0.283644762116, - 0.229642040537, 0.239110447019, 0.755310766388, 0.0880171749327, - 0.0302971247537, 0.251398971038, 0.132167364276, 0.86270451909, - 0.132583443584, 0.125510028688, 0.638399127718, 0.199476379304, - 0.914153397978, 0.766002022218, 0.567807093917, 0.61063777981, - 0.785320983865, 0.370167381362, 0.34927128798, 0.748977974971, - 0.847003356893, 0.762943418809, 0.485965689172, 0.0970373446727, - 0.971069481565, 0.672843661076, 0.241706397712, 0.0281362683386, - 0.83729390753, 0.844712689303, 0.0398020112012, 0.352433139297, - 0.576843202139, 0.92891458591, 0.24165252101, 0.206518586986, - 0.566023929472, 0.213885168636, 0.926423387981, 0.847788822682, - 0.965620096788, 0.489886586942, 0.168723824906, 0.42610450459, - 0.571467396274, 0.951440887127, 0.996536190771, 0.234721946158}, - {0.812292152684, 0.595280542944, 0.557675472352, 0.428907539521, - 0.869937348239, 0.383724372118, 0.4423836296, 0.494738593926, - 0.35563115471, 0.300239953973, 0.892977202779, 0.637413528713, - 0.669884066954, 0.486250389719, 0.353663413399, 0.696392778027, - 0.471105345075, 0.236954204246, 0.182306814021, 0.660629928616, - 0.0910808325244, 0.0589352084095, 0.315076861154, 0.896166228622, - 0.830083582722, 0.0202736633184, 0.155291234288, 0.295511652853, - 0.575813686723, 0.188930220875, 0.459746195869, 0.814878229806, - 0.922434230594, 0.828346067542, 0.788446304707, 0.455937660589, - 0.388277199749, 0.57128070832, 0.512701856198, 0.628434536108, - 0.811186645409, 0.891224989095, 0.206947245939, 0.867085879761, - 0.902743276569, 0.911282151116, 0.109248481945, 0.156607778139, - 0.896067788204, 0.183211055483, 0.938280960525, 0.356391754924, - 0.546178085239, 0.201316497155, 0.15581001558, 0.462524433735, - 0.650725048178, 0.410454515264, 0.297304501021, 0.117358426874, - 0.262638359421, 0.449057537625, 0.0828687181717, 0.301642862733}, - {0.199811565562, 0.372176296759, 0.81279763868, 0.820742174011, - 0.729529518738, 0.00174575119633, 0.432978157515, 0.239232248613, - 0.875805209131, 0.652792291119, 0.747767911326, 0.307145839221, - 0.130239054762, 0.298554849881, 0.30135687008, 0.790236563711, - 0.377223641601, 0.512502723277, 0.410020006112, 0.648987439656, - 0.439343645786, 0.791494956255, 0.886629661884, 0.900254440862, - 0.681938184136, 0.31210645739, 0.642119024611, 0.977297028768, - 0.122433390133, 0.946669660834, 0.929716136215, 0.0208677940153, - 0.982872360928, 0.583870007034, 0.358830299254, 0.539228805729, - 0.104583532206, 0.66813299146, 0.557362622698, 0.77188900257, - 0.665574538832, 0.794363665217, 0.72819552351, 0.891989578106, - 0.139859243889, 0.693699733842, 0.866856231774, 0.680634095843, - 0.11312733559, 0.747966332935, 0.714394158606, 0.154344797997, - 0.923424810483, 0.437931992217, 0.807483726045, 0.626468412361, - 0.398858058886, 0.191800555465, 0.708951297786, 0.944095570176, - 0.24109324579, 0.10701430171, 0.414234076023, 0.513306341551}, - {0.667491836507, 0.00196469627008, 0.941758039557, 0.505105602872, - 0.0561697328188, 0.78269752356, 0.0161708922614, 0.921324107658, - 0.997493946838, 0.276300702957, 0.0582426457068, 0.677911808251, - 0.0574045058831, 0.633287961559, 0.177821830878, 0.524539522052, - 0.294025993092, 0.581295229452, 0.773630705212, 0.160034205722, - 0.417688614545, 0.832612079553, 0.174974303283, 0.0647561886391, - 0.142924693058, 0.595557362157, 0.73147930836, 0.702957273523, - 0.443605290721, 0.342604985435, 0.0124491642303, 0.528666448374, - 0.908511972659, 0.0200955670817, 0.93975669776, 0.751105944352, - 0.0187389167988, 0.983667359104, 0.106139612441, 0.504328164086, - 0.659667072164, 0.856740295014, 0.293724077504, 0.512225656249, - 0.0133708868858, 0.941270407247, 0.115880081834, 0.244346209968, - 0.992444834673, 0.854460855753, 0.169124161655, 0.681201093203, - 0.0806672109213, 0.0312840096903, 0.29502937653, 0.829082674192, - 0.363777261128, 0.609177765965, 0.709266359248, 0.0150886534351, - 0.835069267945, 0.330699461389, 0.691759354978, 0.268580654078}, - {0.517298024985, 0.124992881854, 0.35080661976, 0.366902131122, - 0.00646650487264, 0.327942212223, 0.516544545746, 0.726940274356, - 0.855534710249, 0.688747147951, 0.808760611769, 0.201306218921, - 0.416750037581, 0.47964094638, 0.0690051697424, 0.15320743779, - 0.571295086717, 0.163301772178, 0.608855020589, 0.000453316455408, - 0.0475023932959, 0.605509094618, 0.893979243562, 0.0890331837805, - 0.765303182166, 0.0608093997584, 0.835322505016, 0.855660410769, - 0.546664650073, 0.143211961077, 0.168125301534, 0.932542015744, - 0.268981453615, 0.216352644287, 0.96779624099, 0.127721040559, - 0.677181412282, 0.870373626529, 0.806420678465, 0.823498029886, - 0.901847373245, 0.310576290286, 0.240348990771, 0.471806234847, - 0.264748451204, 0.459518020469, 0.894840186717, 0.970055623853, - 0.43907377144, 0.387409449599, 0.598172150268, 0.586773068261, - 0.907124383472, 0.0692900666216, 0.524011291013, 0.343031005189, - 0.994974339303, 0.468148162825, 0.587166559721, 0.2558078651, - 0.667341744704, 0.165145700367, 0.725256423407, 0.835576987187}, - {0.907183006237, 0.158793403878, 0.15290603998, 0.742187769607, - 0.818588230096, 0.0138213726297, 0.333641741434, 0.421825115487, - 0.768531579333, 0.81958018312, 0.516645373306, 0.959662677732, - 0.563566677858, 0.299928171692, 0.870408866934, 0.111336877897, - 0.163760546092, 0.36765166602, 0.959987324304, 0.847607246435, - 0.297783182421, 0.784238457755, 0.965591284416, 0.616422171273, - 0.934298199479, 0.645327642281, 0.795489623057, 0.0758248268119, - 0.167190888156, 0.982931348766, 0.938271498173, 0.189416450643, - 0.960970263587, 0.893777060939, 0.284389400476, 0.865345538776, - 0.595155696675, 0.679164000085, 0.570610888871, 0.984643210252, - 0.939856431185, 0.489296827825, 0.541943583322, 0.655455542282, - 0.106322690981, 0.709017577152, 0.436714021883, 0.285351691714, - 0.380821967016, 0.800206369422, 0.00951650831836, 0.250851888865, - 0.342169551826, 0.0102946569057, 0.107529794608, 0.710433647191, - 0.0840711219413, 0.301887751456, 0.359838357721, 0.520223170957, - 0.81008551587, 0.252355810449, 0.0812512546807, 0.915214715585}, - {0.0986022939847, 0.0600487557556, 0.713758851185, 0.0627283601581, - 0.967173482545, 0.341670023786, 0.00173814892812, 0.174099490463, - 0.809636560687, 0.628243719878, 0.446623237675, 0.115307801852, - 0.689868632067, 0.483914534312, 0.200324042587, 0.0760525523847, - 0.598885124655, 0.664808860948, 0.183251439363, 0.144758597498, - 0.9471938947, 0.524206850633, 0.100475409512, 0.543486932914, - 0.974041319823, 0.765010685412, 0.739812904363, 0.970870429449, - 0.460854942213, 0.0780053558762, 0.809960896046, 0.043325814328, - 0.955787994202, 0.327341988136, 0.19787333943, 0.75572781306, - 0.280690709477, 0.1719281949, 0.704654277852, 0.773743222027, - 0.958904820178, 0.979957976929, 0.516910123083, 0.477858813114, - 0.434415557809, 0.372594953271, 0.992541542229, 0.664253522551, - 0.148743533159, 0.426441990882, 0.469169000677, 0.853004364487, - 0.02990829042, 0.815624805929, 0.578310186153, 0.319038199211, - 0.0945858634836, 0.995054874102, 0.565477371369, 0.526516256799, - 0.935170684975, 0.25889904757, 0.433976982045, 0.519519047234}}; - -inline float rotate(float x, const float dx) +inline float getRandomValue() { - x += dx; - if (x >= 1.f) - x -= 1.f; - return x; + float r; +#ifdef HIGH_QUALITY_RANDOM + while (rdrand(&r) == false) + { + } +#else + rdrand(&r); +#endif + return r; } -inline float getRandomValue(varying ScreenSample& sample, - const int randomNumber) +inline vec3f getRandomVector(const vec3f& normal) { - const int x = sample.sampleID.x % RANDOM_SET_SIZE; - const int y = sample.sampleID.y % RANDOM_SET_SIZE; - return rotate(randomDistribution[x][y], sample.sampleID.z % 8); -} - -inline vec3f getRandomVector(varying ScreenSample& sample, const vec3f& normal, - const int randomNumber) -{ - vec3f tangent, biTangent; - getTangentVectors(normal, tangent, biTangent); - const int accumID = sample.sampleID.z + randomNumber; - const float rot_x = 1.f - precomputedHalton3(accumID); - const float rot_y = 1.f - precomputedHalton5(accumID); - - const int x = sample.sampleID.x % RANDOM_SET_SIZE; - const int y = sample.sampleID.y % RANDOM_SET_SIZE; + if (!seedInitialized) + { + seed_rng(&rngState, programIndex); + seedInitialized = true; + } - const float rx = - rotate(randomDistribution[y][RANDOM_SET_SIZE - 1 - x], rot_x); - const float ry = - rotate(randomDistribution[RANDOM_SET_SIZE - 1 - x][y], rot_y); - const float w = sqrt(1.f - ry); - const float cx = cos((2.f * M_PI) * rx) * w; - const float cy = sin((2.f * M_PI) * rx) * w; - const float cz = sqrt(ry); - return normalize(cx * tangent + cy * biTangent + cz * normal); + const float rx = getRandomValue() - 0.5f; + const float ry = getRandomValue() - 0.5f; + const float rz = getRandomValue() - 0.5f; + return normalize(normal + make_vec3f(rx, ry, rz)); } void getTangentVectors(const vec3f& normal, vec3f& tangent, vec3f& biTangent) diff --git a/plugins/extensions/plugins/ZeroEQPlugin.cpp b/plugins/extensions/plugins/ZeroEQPlugin.cpp index ed4417fa3..59d07f428 100644 --- a/plugins/extensions/plugins/ZeroEQPlugin.cpp +++ b/plugins/extensions/plugins/ZeroEQPlugin.cpp @@ -665,6 +665,8 @@ void ZeroEQPlugin::_initializeDataSource() geometryParameters.getMetaballsThreshold()); _remoteDataSource.setMetaballsSamplesFromSoma( geometryParameters.getMetaballsSamplesFromSoma()); + _remoteDataSource.setUseSimulationModel( + geometryParameters.getUseSimulationModel()); } void ZeroEQPlugin::_dataSourceUpdated() @@ -730,6 +732,9 @@ void ZeroEQPlugin::_dataSourceUpdated() _remoteDataSource.getSimulationCacheFileString()); _parametersManager.set("nest-cache-file", _remoteDataSource.getNestCacheFileString()); + _parametersManager.set("use-simulation-model", + _remoteDataSource.getUseSimulationModel() ? "1" + : "0"); uint morphologySectionTypes = MST_UNDEFINED; const auto& sectionTypes = _remoteDataSource.getMorphologySectionTypes(); From fc4c46de404ec67656f788836b999e8a64fdf6f1 Mon Sep 17 00:00:00 2001 From: Cyrille Favreau Date: Tue, 4 Apr 2017 12:13:32 +0200 Subject: [PATCH 2/2] Added color scheme for layers, e-types and m-types --- brayns/common/types.h | 11 ++- brayns/common/vocabulary/parameters.fbs | 11 ++- brayns/io/MorphologyLoader.cpp | 114 ++++++++++++++++++----- brayns/io/MorphologyLoader.h | 11 ++- brayns/parameters/GeometryParameters.cpp | 16 +++- 5 files changed, 125 insertions(+), 38 deletions(-) diff --git a/brayns/common/types.h b/brayns/common/types.h index af50da92b..faba86b41 100644 --- a/brayns/common/types.h +++ b/brayns/common/types.h @@ -215,10 +215,13 @@ enum class ColorScheme neuron_by_id = 1, neuron_by_type = 2, neuron_by_segment_type = 3, - protein_by_id = 4, - protein_atoms = 5, - protein_chains = 6, - protein_residues = 7 + neuron_by_layer = 4, + neuron_by_mtype = 5, + neuron_by_etype = 6, + protein_by_id = 7, + protein_atoms = 8, + protein_chains = 9, + protein_residues = 10 }; /** Define the environment that is added to the default scene */ diff --git a/brayns/common/vocabulary/parameters.fbs b/brayns/common/vocabulary/parameters.fbs index 5b9ef05d4..0ced355b2 100644 --- a/brayns/common/vocabulary/parameters.fbs +++ b/brayns/common/vocabulary/parameters.fbs @@ -39,10 +39,13 @@ enum ColorScheme: uint { neuron_by_id = 1, neuron_by_type = 2, neuron_by_segment_type = 3, - protein_by_id = 4, - protein_atoms = 5, - protein_chain = 6, - protein_residue = 7 + neuron_by_layer = 4, + neuron_by_mtype = 5, + neuron_by_etype = 6, + protein_by_id = 7, + protein_atoms = 8, + protein_chain = 9, + protein_residue = 10 } enum SceneEnvironment: uint { diff --git a/brayns/io/MorphologyLoader.cpp b/brayns/io/MorphologyLoader.cpp index aa9bf7fa0..a95366fa8 100644 --- a/brayns/io/MorphologyLoader.cpp +++ b/brayns/io/MorphologyLoader.cpp @@ -34,6 +34,7 @@ #ifdef BRAYNS_USE_BRION #include #include +typedef std::shared_ptr BrionCircuitPtr; #endif namespace brayns @@ -59,12 +60,10 @@ brain::neuron::SectionTypes _getSectionTypes( return sectionTypes; } -bool MorphologyLoader::_importMorphologyAsMesh(const servus::URI& source, - const size_t morphologyIndex, - const MaterialsMap& materials, - const Matrix4f& transformation, - TrianglesMeshMap& meshes, - Boxf& bounds) +bool MorphologyLoader::_importMorphologyAsMesh( + const servus::URI& source, const size_t morphologyIndex, + const MaterialsMap& materials, const Matrix4f& transformation, + TrianglesMeshMap& meshes, Boxf& bounds, const size_t forcedMaterial) { try { @@ -85,7 +84,8 @@ bool MorphologyLoader::_importMorphologyAsMesh(const servus::URI& source, // Soma const brain::neuron::Soma& soma = morphology.getSoma(); const size_t material = _getMaterialFromSectionType( - morphologyIndex, size_t(brain::neuron::SectionType::soma)); + morphologyIndex, forcedMaterial, + size_t(brain::neuron::SectionType::soma)); const Vector3f center = soma.getCentroid(); const float radius = @@ -112,7 +112,7 @@ bool MorphologyLoader::_importMorphologyAsMesh(const servus::URI& source, } const auto material = - _getMaterialFromSectionType(morphologyIndex, + _getMaterialFromSectionType(morphologyIndex, forcedMaterial, size_t(section.getType())); const auto& samples = section.getSamples(); if (samples.empty()) @@ -144,8 +144,10 @@ bool MorphologyLoader::_importMorphologyAsMesh(const servus::URI& source, const size_t gridSize = _geometryParameters.getMetaballsGridSize(); const float threshold = _geometryParameters.getMetaballsThreshold(); MetaballsGenerator metaballsGenerator; - const size_t material = _getMaterialFromSectionType( - morphologyIndex, size_t(brain::neuron::SectionType::soma)); + const size_t material = + _getMaterialFromSectionType(morphologyIndex, forcedMaterial, + size_t( + brain::neuron::SectionType::soma)); metaballsGenerator.generateMesh(metaballs, gridSize, threshold, materials, material, meshes); } @@ -182,7 +184,8 @@ bool MorphologyLoader::_importMorphology( const Matrix4f& transformation, const SimulationInformation* simulationInformation, SpheresMap& spheres, CylindersMap& cylinders, ConesMap& cones, Boxf& bounds, - const size_t simulationOffset, float& maxDistanceToSoma) + const size_t simulationOffset, float& maxDistanceToSoma, + const size_t forcedMaterial) { maxDistanceToSoma = 0.f; try @@ -233,7 +236,8 @@ bool MorphologyLoader::_importMorphology( // Soma const brain::neuron::Soma& soma = morphology.getSoma(); const size_t material = _getMaterialFromSectionType( - morphologyIndex, size_t(brain::neuron::SectionType::soma)); + morphologyIndex, forcedMaterial, + size_t(brain::neuron::SectionType::soma)); const Vector3f somaPosition = soma.getCentroid() + translation; float radius = @@ -272,7 +276,7 @@ bool MorphologyLoader::_importMorphology( for (const auto& section : sections) { const size_t material = - _getMaterialFromSectionType(morphologyIndex, + _getMaterialFromSectionType(morphologyIndex, forcedMaterial, size_t(section.getType())); const Vector4fs& samples = section.getSamples(); if (samples.empty()) @@ -374,6 +378,50 @@ bool MorphologyLoader::_importMorphology( return true; } +brion::NeuronAttributes getNeuronAttributes(const ColorScheme& colorScheme) +{ + brion::NeuronAttributes neuronAttributes; + switch (colorScheme) + { + case ColorScheme::neuron_by_layer: + neuronAttributes = brion::NEURON_LAYER; + break; + case ColorScheme::neuron_by_mtype: + neuronAttributes = brion::NEURON_MTYPE; + break; + case ColorScheme::neuron_by_etype: + neuronAttributes = brion::NEURON_ETYPE; + break; + default: + neuronAttributes = brion::NEURON_ALL; + break; + } + return neuronAttributes; +} + +bool getNeuronMatrix(const brion::BlueConfig& bc, const brain::GIDSet& gids, + const ColorScheme colorScheme, strings& neuronMatrix) +{ + brion::NeuronAttributes neuronAttributes = getNeuronAttributes(colorScheme); + if (neuronAttributes == brion::NEURON_ALL) + return false; + try + { + brion::Circuit brionCircuit(bc.getCircuitSource()); + for (const auto& a : brionCircuit.get(gids, neuronAttributes)) + neuronMatrix.push_back(a[0]); + return true; + } + catch (...) + { + BRAYNS_WARN << "Only MVD2 format is currently supported by Brion " + "circuits. Color scheme by layer, e-type or m-type is " + "not available for this circuit" + << std::endl; + } + return false; +} + bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, const std::string& target, Scene& scene) { @@ -388,13 +436,17 @@ bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, return false; } const Matrix4fs& transforms = circuit.getTransforms(gids); - const brain::URIs& uris = circuit.getMorphologyURIs(gids); BRAYNS_INFO << "Loading " << uris.size() << " cells" << std::endl; - std::map morphologyOffsets; + // Read Brion circuit + strings neuronMatrix; + bool mvd3Support = + getNeuronMatrix(bc, gids, _geometryParameters.getColorScheme(), + neuronMatrix); + std::map morphologyOffsets; size_t simulationOffset = 1; size_t simulatedCells = 0; size_t progress = 0; @@ -409,19 +461,22 @@ bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, { const auto& uri = uris[i]; float maxDistanceToSoma = 0.f; + const size_t material = + mvd3Support ? boost::lexical_cast(neuronMatrix[i]) + : NO_MATERIAL; if (_geometryParameters.useMetaballs()) { _importMorphologyAsMesh(uri, i, scene.getMaterials(), transforms[i], scene.getTriangleMeshes(), - scene.getWorldBounds()); + scene.getWorldBounds(), material); } if (_importMorphology(uri, i, transforms[i], 0, private_spheres, private_cylinders, private_cones, private_bounds, simulationOffset, - maxDistanceToSoma)) + maxDistanceToSoma, material)) { morphologyOffsets[simulatedCells] = maxDistanceToSoma; simulationOffset += maxDistanceToSoma; @@ -499,6 +554,12 @@ bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, brain::URIs cr_uris; const brain::GIDSet& cr_gids = compartmentReport.getGIDs(); + // Read Brion circuit + strings neuronMatrix; + bool mvd3Support = + getNeuronMatrix(bc, gids, _geometryParameters.getColorScheme(), + neuronMatrix); + BRAYNS_INFO << "Loading " << cr_gids.size() << " simulated cells" << std::endl; for (const auto cr_gid : cr_gids) @@ -521,19 +582,22 @@ bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, const auto& uri = cr_uris[i]; const SimulationInformation simulationInformation = { &compartmentCounts[i], &compartmentOffsets[i]}; + const size_t material = + mvd3Support ? boost::lexical_cast(neuronMatrix[i]) + : NO_MATERIAL; if (_geometryParameters.useMetaballs()) { _importMorphologyAsMesh(uri, i, scene.getMaterials(), transforms[i], scene.getTriangleMeshes(), - scene.getWorldBounds()); + scene.getWorldBounds(), material); } float maxDistanceToSoma; _importMorphology(uri, i, transforms[i], &simulationInformation, private_spheres, private_cylinders, private_cones, - private_bounds, 0, maxDistanceToSoma); + private_bounds, 0, maxDistanceToSoma, material); BRAYNS_PROGRESS(progress, cr_uris.size()); #pragma omp atomic @@ -608,10 +672,15 @@ bool MorphologyLoader::importCircuit(const servus::URI& circuitConfig, { float maxDistanceToSoma; const auto& uri = allUris[i]; + const size_t material = + mvd3Support + ? boost::lexical_cast(neuronMatrix[i][0]) + : NO_MATERIAL; _importMorphology(uri, i, allTransforms[i], 0, private_spheres, private_cylinders, private_cones, - private_bounds, 0, maxDistanceToSoma); + private_bounds, 0, maxDistanceToSoma, + material); BRAYNS_PROGRESS(progress, allUris.size()); #pragma omp atomic @@ -767,8 +836,11 @@ bool MorphologyLoader::importSimulationData(const servus::URI&, #endif size_t MorphologyLoader::_getMaterialFromSectionType( - const size_t morphologyIndex, const size_t sectionType) + const size_t morphologyIndex, const size_t forcedMaterial, + const size_t sectionType) { + if (forcedMaterial != NO_MATERIAL) + return forcedMaterial; size_t material; switch (_geometryParameters.getColorScheme()) { diff --git a/brayns/io/MorphologyLoader.h b/brayns/io/MorphologyLoader.h index 73cf1d471..00ca91d74 100644 --- a/brayns/io/MorphologyLoader.h +++ b/brayns/io/MorphologyLoader.h @@ -114,16 +114,19 @@ class MorphologyLoader SpheresMap& spheres, CylindersMap& cylinders, ConesMap& cones, Boxf& bounds, const size_t simulationOffset, - float& maxDistanceToSoma); + float& maxDistanceToSoma, + const size_t forcedMaterial = NO_MATERIAL); bool _importMorphologyAsMesh(const servus::URI& source, const size_t morphologyIndex, const MaterialsMap& materials, const Matrix4f& transformation, - TrianglesMeshMap& meshes, Boxf& bounds); + TrianglesMeshMap& meshes, Boxf& bounds, + const size_t forcedMaterial = NO_MATERIAL); - size_t _getMaterialFromSectionType(size_t morphologyIndex, - size_t sectionType); + size_t _getMaterialFromSectionType(const size_t morphologyIndex, + const size_t forcedMaterial, + const size_t sectionType); const GeometryParameters& _geometryParameters; }; diff --git a/brayns/parameters/GeometryParameters.cpp b/brayns/parameters/GeometryParameters.cpp index fd1ae4721..3dde0c1f8 100644 --- a/brayns/parameters/GeometryParameters.cpp +++ b/brayns/parameters/GeometryParameters.cpp @@ -62,11 +62,17 @@ const std::string PARAM_METABALLS_SAMPLES_FROM_SOMA = "metaballs-samples-from-soma"; const std::string PARAM_USE_SIMULATION_MODEL = "use-simulation-model"; -const std::string COLOR_SCHEMES[8] = { - "none", "neuron-by-id", - "neuron-by-type", "neuron-by-segment-type", - "protein-by-id", "protein-atoms", - "protein-chains", "protein-residues"}; +const std::string COLOR_SCHEMES[11] = {"none", + "neuron-by-id", + "neuron-by-type", + "neuron-by-segment-type", + "neuron-by-layer", + "neuron-by-mtype", + "neuron-by-etype", + "protein-by-id", + "protein-atoms", + "protein-chains", + "protein-residues"}; const std::string SCENE_ENVIRONMENTS[4] = {"none", "ground", "wall", "bounding-box"};