08-17-2024 03:31 AM
I would like to ask all the experts, I want to use LabVIEW to open these types of files ".atr .dat .hea .xws", It's ECG waveform record files and then connect them to the Waveform graph for viewing.
08-17-2024 09:07 AM - edited 08-17-2024 09:09 AM
A file is just a long string of bytes and in order to recover the information, you need to know the data structures. Do you have a document to describe all that?
Are they formatted text or binary? (e.g. if you open them in notepad, is it all text or not).
08-17-2024 01:17 PM
Thank you for your reply. These four pictures are the results after I opened them with Notepad. Please help me take a look.
How do I open it using LabVIEW?
Thank you.
08-17-2024 01:29 PM - edited 08-17-2024 01:31 PM
the first two look binary, but the last two can just be read as plain text into a string indicator.
"Opening" any of them is trivial. Interpreting the contents of the first two requires knowledge about the file structure. What kind of data do you expect?
(Attaching pictures instead of the actual files is not very useful.)
08-18-2024 09:40 AM
Thank you for your reply. This file is the patient's ECG waveform file. I want to display the waveform.
Thank you.
08-18-2024 10:03 AM - edited 08-18-2024 10:05 AM
You just need to do your research or even contact the company that makes the instrument.
Binary data requires extensive knowledge about the data structures (header size, datatype, byte order, and how the waveform is represented (direct, incremental, etc.).
Looks like you have sample files from here. It seems there is a MATLAB library that can read these files, maybe you can reverse engineer that code. Good luck!
08-18-2024 12:13 PM
A "file" is just a string of bytes that encode data according to some format. You can open any file as a "binary file" and read that collection of bytes. The trick comes in understanding how the data being stored in the file (as a series of bytes) has been "encoded". In the days of the Teletype, "messages" were encoded in an 8-bit format called ASCII, where "A" was 0x81 and "0" (zero) was 0x60. Now, most data are saved as numbers, possibly 4-byte integers, possibly 8-byte floating point, possibly with extra bytes saying "This is a 2-D array with this many rows and columns". Without knowing the format of the data, interpreting the string of bytes is very challenging. Note that looking at a binary file with a "Hex" editor that can represent the string of bytes in various formats makes it easy to find data saved as text (if written in a language that uses a Western alphabet -- you will be able to read it as something other than gibberish.
Why don't you attach a file you want to read, and also as much information as you have about what you think is the format of the file. We can take a peek at it ...
Bob Schor
08-18-2024 12:42 PM - edited 08-18-2024 12:43 PM
A quick inspection of the 100.dat file gives reasonable results if interpreted as 24bit little endian signed integer. No guarantees....
(we reverse 3 adjacent bytes for little endian, pad on the right to 4 bytes, cast to I32, and do an arithmetic shift to undo the padding).
YMMV!
08-19-2024 10:18 PM
@Bob Schor, Thanks for your reply, I will add more knowledge in this area. The file I'm using cannot be uploaded here. Thank you.
08-19-2024 10:21 PM
@altenbach, Thank you for your reply. You are awesome. I am just researching how to open this related file. Thank you very much.