Questions tagged [binary]
The binary tag has no usage guidance.
15 questions with no upvoted or accepted answers
12
votes
0
answers
488
views
Why does Mathematica consume so much memory when reading binary data?
There are somewhat similar questions on here, but I didn't find a satisfying answer for this case: I import a 1.7 GB binary data file using the following command:
...
6
votes
0
answers
143
views
Importing a 12 bit array
I have a binary file of 12 bits integers obtained from a camera software. It can produce FITS files from these but the processing time on the large data set I have is excessive. What I have is the ...
6
votes
0
answers
88
views
Does NumericArray always maintain data unmodified?
Suppose that we create a NumericArray using a LibraryLink function, then pass this to another one. Is NumericArray guaranteed to maintain the binary data as it was ...
5
votes
0
answers
80
views
How to force the writing of buffers onto disk?
Usually, buffering is good; except when you critically need to write data to disk. Is there a way to force the writing of buffers onto disk? (I'm using a binary file)
I believe a ...
3
votes
0
answers
188
views
How to recover plaintext from .MX files?
I need a function to deserialize the contents of an MX source file for reading. We can’t simply use Get because I don’t want to load or run the code, but rather to ...
2
votes
0
answers
467
views
Converting hex string to ByteArray
With blockchain support, it should finally become straightforward to convert string hashes to ByteArray, but I still can't figure out the canonical Wolfram way of ...
1
vote
0
answers
63
views
How to Parse Binary .STL File Created on Ancient 32-bit Architecture
Import[fileName,"STL"] returns $Failed
The file format is so simple that one can calculate the number of triangles in the file
by counting the number of BinaryReads to reach EndOfFile.
https:...
1
vote
0
answers
120
views
Implementing the Binary GCD algorithm in Mathematica
Well, I have $n\in\mathbb{N}$ and I want to transform $n$ to a binary number which can be done using FromDigits[IntegerDigits[n, 2]]. I want to compute the ...
1
vote
0
answers
47
views
Reading product of same ByteArrays
I am handling a huge set of data and I am trying to optimize my code. I have very large expressions to expand and simplify and I've seen that converting the expressions to ByteArrays improves a lot ...
1
vote
0
answers
72
views
Efficiently transform sequentially generated integer matrices into boolean matrices
Assume you have a list of 5 numbers, eg L = {14, 7, 11, 14, 0};.
Now, what you want to do with this list, is to transform each entry into eg a binary list, using <...
1
vote
0
answers
53
views
Binary Image Size after import
I have a lot of binary images I would like to import into mathematica.
Each of them is 132kB (1024x1024) big. Like the following:
As soon as I import it into Mathematica however and call ByteCount[...
1
vote
0
answers
84
views
Export 1bit Image
I have a binary image like the following one:
How can I export it as an 1bit image instead of an 8bit one?
If I export it in tiff it automatically becomes an 8bit one.
Best,
Max
0
votes
0
answers
99
views
Real to IEEE 754 not working for values -1<x<1
I have written a Module that takes a real number and returns the IEEE 754 floating point binary equivalent. It works fine for values above |1|, but I cannot get it to work for inputs less than |1|.
<...
0
votes
0
answers
40
views
FindClusters Hamming Distance giving error
I am trying to run FindClusters[hex, DistanceFunction -> HammingDistance[IntegerDigits[#, 2, 8], IntegerDigits[0, 2, 8]] &] over a list of data but I keep ...
0
votes
0
answers
50
views
Table Glitch / Error with binary data
I have a large group of binary files that I am loading with
binaryList = Table[ BinaryReadList[ paths[[i]], "Byte"], {i, Length@paths}];
specifically ...