{"_id":"gl-volume3d","_rev":"56-18e693b50f99efd7dd826a8beea6712d","name":"gl-volume3d","dist-tags":{"latest":"0.5.0"},"versions":{"0.5.0":{"name":"gl-volume3d","version":"0.5.0","keywords":["webgl","volume"],"author":{"name":"Mikola Lysenko, Ilmari Heikkinen"},"license":"MIT","_id":"gl-volume3d@0.5.0","maintainers":[{"name":"ilmarihei","email":"ilmari@fhtr.net"}],"homepage":"https://github.com/gl-vis/gl-volume3d#readme","bugs":{"url":"https://github.com/gl-vis/gl-volume3d/issues"},"dist":{"shasum":"1b6dbeeec04a64bef8b204ef696c1b9df792fa4a","tarball":"https://registry.npmjs.org/gl-volume3d/-/gl-volume3d-0.5.0.tgz","fileCount":12,"integrity":"sha512-7zTYlG8XcoA9HIDEkZoJu2Q7VG+9rtvDLpeS+ugb8Y3nC26WZNXAcmBxUecTR11MCtHiFFakWavapBhEs7YdRQ==","signatures":[{"sig":"MEUCIQCBsE2rE7Tpy73D2ZdTZNWScbsrpO+ZLTzk24Nd52E61AIgST83l3AHSyGL/jLHQXbTHg/x7Tf89jFGbln5nBEPZpo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1834032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbg7ZXCRA9TVsSAnZWagAAvV0P/RTyK+Z+dxk3nlSmsh1z\nSO6D7gsxHaFOgCL/U1eoqk0lAPv1FYxOBTc1j2+03eskzfE348UDAkp5hLPu\n+4DnQcOb1DrBg5dDK3V8AIquP/lSPhpi2PL4bCGwBHIuCweHJGidUaV7w8Q0\nBsk6GePznSspCiH3IWA024sa9jVEPuZpLnuUbAT5OQ3PhRxPUvOpo6RkPlSx\nz+Yq49V0KQLGvv0qFXk38gAJIAMKdLj2S4fDX6WBDLls34AfcTBLUtxMA6KL\nni7B7EgOypAWJY6Z5y3fLNCFh0Lr2B39vKE6PEW5DS2G8eEt2lWm5JGkWV3t\nS5G+D262wkxCq4RLHv8RF4orvix2weH1V/wZFLkg8Q8PH18yoDmlVW9VvS7O\n8i9MuEUhUaENR3EEUQhdho5IJjh7t7ri143YOJe/Utsw7EkELCFNybI2bgbb\nUJ70v7GvZjFl6tyyqJdofSKgQXHArU0A7XQ4xo5R8kXC/RAXlzLtHdWmZL8C\nbPxzU31xQPnuzoT+/uPR2qOaGOBlctC3d/bfJxtvbWwPAP69NkmX2mhDxOFp\n8Fyoc+x8KvBdHcmgZr0eIIhD7Q2jQNzcqwRcbRWHTu3coVJ6bj3f0DsO9S/X\nXRZ5xSdVQxT9kdmSOfiMGu299nV0FdgOWpa+0w7ldvKkUpNk+653ZKFbMikP\ntrkl\r\n=zVzZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"volume.js","gitHead":"be8b0026a4449580bda45fb6f3ecf1cead76e99d","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build-example":"browserify -o build/example.js example/volume.js"},"_npmUser":{"name":"ilmarihei","email":"ilmari@fhtr.net"},"browserify":{"transform":["glslify"]},"repository":{"url":"git://github.com/gl-vis/gl-volume3d.git","type":"git"},"_npmVersion":"6.4.0","description":"3D volume renderer","directories":{"example":"example"},"_nodeVersion":"8.11.3","dependencies":{"gl-vao":"^1.1.3","gl-mat4":"^1.0.0","glslify":"^6.1.1","ndarray":"^1.0.15","normals":"^1.0.1","colormap":"^2.1.0","gl-buffer":"^2.0.8","gl-shader":"^4.2.1","barycentric":"^1.0.1","gl-texture2d":"^2.0.8","typedarray-pool":"^1.1.0","polytope-closest-point":"^1.0.0","simplicial-complex-contour":"^1.0.0","glsl-specular-cook-torrance":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"gl-mat4":"^1.0.0","gl-axes3d":"^1.2.5","canvas-fit":"^1.5.0","gl-spikes3d":"^1.0.5","bound-points":"^1.0.0","3d-view-controls":"^2.2.0","gl-select-static":"^2.0.2"},"_npmOperationalInternal":{"tmp":"tmp/gl-volume3d_0.5.0_1535358550614_0.6272157593052565","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-08-27T08:29:10.613Z","modified":"2026-09-14T15:41:13.364Z","0.5.0":"2018-08-27T08:29:10.741Z"},"bugs":{"url":"https://github.com/gl-vis/gl-volume3d/issues"},"author":{"name":"Mikola Lysenko, Ilmari Heikkinen"},"license":"MIT","homepage":"https://github.com/gl-vis/gl-volume3d#readme","keywords":["webgl","volume"],"repository":{"url":"git://github.com/gl-vis/gl-volume3d.git","type":"git"},"description":"3D volume renderer","maintainers":[{"email":"chris@plot.ly","name":"chriddyp"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"antoine@plot.ly","name":"antrg"},{"email":"chuck@plot.ly","name":"bronsolo"},{"email":"t4rk@outlook.com","name":"t4rk"},{"email":"roman@plot.ly","name":"roman-nb"},{"email":"cameron.decoster@gmail.com","name":"camdecoster"},{"email":"alex@plot.ly","name":"alexcjohnson"},{"email":"adrian.borrmann@plot.ly","name":"aborrmann"},{"email":"emily@plot.ly","name":"emilykl-plotly"},{"email":"packages@plot.ly","name":"packages-team-plotly"},{"email":"ilmari@fhtr.net","name":"ilmarihei"},{"email":"code@etpinard.xyz","name":"etpinard"}],"readme":"gl-volume3d\n=====================\nVisualization module for volumetric data.\n\n# Example\n\n```javascript\nvar createScene      = require('gl-plot3d')\nvar createVolume     = require('gl-volume3d')\n\nvar scene = createScene()\n\nvar width = 64\nvar height = 64\nvar depth = 64\n\nvar data = new Uint16Array(width*height*depth)\nfor (var z=0; z<depth; z++)\nfor (var y=0; y<height; y++)\nfor (var x=0; x<width; x++) {\n\tvar value = 1500 + 500 * (\n\t\tMath.sin(3 * 2*Math.PI*(z/depth-0.5)) +\n\t\tMath.cos(4 * 2*Math.PI*(x/width-0.5)) +\n\t\tMath.sin(5 * 2*Math.PI*(h/height-0.5))\n\t);\n\tdata[z*height*width + y*width + x] = value\n}\n\nvar dims = [width, height, depth]\nvar bounds = [[0,0,0], [width, height, depth]]\n\nvar volumePlot = createVolume({\n\tgl: gl,\n\tvalues: data,\n\tdimensions: dims,\n\tisoBounds: [1600, 2000],\n\tintensityBounds: [1000, 2000],\n\tcolormap: 'portland'\n}, bounds)\n\nscene.add(gl)\n```\n\n[Try out the example in your browser](http://gl-vis.github.io/gl-volume3d/)\n\n# Install\n\n```\nnpm i gl-volume3d\n```\n\n# Basic interface\n\n## Constructor\n\n#### `var volume = require('gl-volume3d')(params, bounds)`\nCreates a volume visualization out of a 3D array.\n\n* `params` is an object that has the following properties:\n\n\t+ `gl` *(Required)* WebGL context to use\n    + `values` *(Required)* An flattened 3D array of values\n    + `meshgrid` *(Optional)* Meshgrid to use for the value coordinates\n    + `dimensions` *(Required)* The dimensions of the array. When used with meshgrid, sets the resolution of the 3D texture. When using meshgrid, the 3D texture values are sampled in an uniform fashion between the start and end coordinates of the meshgrid.\n    + `isoBounds` *(Recommended)* The range of values to envelop with the isosurface. Defaults to [1, Infinity], which creates an isosurface that has all values 1 and larger inside it.\n    + `intensityBounds` *(Optional)* The range of values to map to [0..1] intensities. Defaults to the minimum and maximum values of the values array.\n    + `colormap` *(Optional)* Name of the color map to use.\n    + `alphamap` *(Optional)* Opacity lookup table, a 256-element array that maps intensity to voxel opacity. The first element is intensity 0 (after intensityBounds mapping), the last element is intensity 1.\n    + `opacity` *(Optional)* Multiplier for the voxel opacities. Used for controlling the volume transparency.\n\n* `bounds` is a bounds object that tells what part of the 3D array to display. It defaults to [[0, 0, 0], [width, height, depth]].\n\n**Returns** A volume plot object that can be passed to gl-mesh3d.\n\n# Credits\n(c) 2013-2017 Mikola Lysenko, Ilmari Heikkinen. MIT License\n","readmeFilename":"README.md"}