Comparing version 0.1.0 to 0.1.1
@@ -264,2 +264,6 @@ "use strict"; | ||
buf8 = new Uint8Array(buffer); | ||
// A work-around for incompatibilities between Node's Buffer and ArrayBuffer. | ||
if (buf8.buffer !== buffer) buffer = buf8.buffer; | ||
// First find the separation between the header and the data (if there is one) | ||
@@ -266,0 +270,0 @@ // Note that we need to deal with with LF and CRLF as possible line endings. |
{ | ||
"name": "nrrd-js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Handling NRRD files in Javascript.", | ||
@@ -5,0 +5,0 @@ "main": "nrrd.js", |
@@ -11,3 +11,5 @@ NRRD support for Javascript | ||
var array = ndarray(nrrdfile.data, nrrdfile.sizes.slice().reverse()); | ||
var minimalNrrdfileArrayBuffer = nrrd.serialize({data: array.data, sizes: array.shape.slice().reverse()}); // If array.data is something other than a typed array, you should specify the 'type'. | ||
var arrayBuffer = nrrd.serialize({data: array.data, sizes: array.shape.slice().reverse()}); | ||
// If array.data is something other than a typed array, you should specify the 'type'. | ||
``` | ||
Note that the above serialization only works if the ndarray uses the default stride(s), if not, then you essentially need to copy the ndarray into a new one that does (or at least a new typed array). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
833312
1101
15