fileformats:hdascii
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungLetzte ÜberarbeitungBeide Seiten der Revision | ||
fileformats:hdascii [2017/02/28 15:32] – [Details] oliver | fileformats:hdascii [2017/12/22 15:06] – [File extentions and mime types] oliver | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
======The HD-ASCII File Format====== | ======The HD-ASCII File Format====== | ||
+ | =====History===== | ||
This component implements the //HD-ASCII File format//, originally designed and implemented by Jan Simon in [[https:// | This component implements the //HD-ASCII File format//, originally designed and implemented by Jan Simon in [[https:// | ||
+ | =====General features===== | ||
The HD-ASCII file format is a container format for any data organized in matrices. The data types are orientated on the types available in the [[https:// | The HD-ASCII file format is a container format for any data organized in matrices. The data types are orientated on the types available in the [[https:// | ||
=====Disadvantages===== | =====Disadvantages===== | ||
- | The HD-ASCII file format is extensivly used in the [[http:// | + | The HD-ASCII file format is extensivly used in the [[http:// |
* The resolution of the numbers is insufficient defineable. This can result in ilusive bugs. | * The resolution of the numbers is insufficient defineable. This can result in ilusive bugs. | ||
Zeile 16: | Zeile 18: | ||
All of these limitations are overruled by the Nimues default open and flexible [[http:// | All of these limitations are overruled by the Nimues default open and flexible [[http:// | ||
- | =====File extentions===== | + | =====File extentions |
To distinguesh different sets of data in the [[http:// | To distinguesh different sets of data in the [[http:// | ||
- | ^ File Extension ^ Frames ^ Description ^ Fix set of variables | | + | ^ File Extension |
- | ^ .glk | single trial | Lower Body Kinetics (PiG) | X | | + | ^ .glk | | single trial | Lower Body Kinetics (PiG) | X | |
- | ^ .glkn | single trial | time normalized .glk | X | | + | ^ .glkn | | single trial | Time normalized .glk-files| X | |
- | ^ .glm | single trial | Lower/Upper Body Kinematics (PiG)| | + | ^ .glm | text/x-glm | single trial | Lower/Upper Body Kinematics (PiG)| X | |
- | ^ .glmn | single trial | time normalized .glm | X | | + | ^ .glmn | | single trial | Time normalized .glm-files |
- | ^ .gle | single trial | EMG data | X | | + | ^ .gle | text/x-gle | single trial | EMG data | X | |
- | ^ .glen | single trial | time normalized .gle | X | | + | ^ .glen | | single trial | Time normalized .gle-files| X | |
- | ^.gla | mean | * lower/ | + | ^.gla | text/x-gla | ean | * lower/ |
- | ^ .pkl | | Meta Data | X | | + | ^ .pkl | | | Meta Data | X | |
- | ^ .glx | single trial | experimentel | + | ^ .glx | text/ |
- | ^ .glxn | single trial | time normalized .glx | | | + | ^ .glxn | | single trial | time normalized .glx | | |
- | ^ .gxa | mean |* | experimentel | + | ^ .gxa or .gxa | text/ |
- | ^ .gaf | mean | Foot Kinematics | X | | + | ^ .gaf | text/x-gaf | mean | Foot Kinematics | X | |
- | ^ .glf | + | ^ .glf | | single trial | Foot Kinematics | X | |
- | ^ .glfn | mean | session mean; normalized to 101 frames time normalized .glf | X | | + | ^ .glfn |
+ | ^ .gnm | text/x-gnm | | | | | ||
If a single trial is splittet into strides and timenormalized for each stride a seperate file is created. These files are numbered as the following examples shows: | If a single trial is splittet into strides and timenormalized for each stride a seperate file is created. These files are numbered as the following examples shows: | ||
Zeile 61: | Zeile 63: | ||
The values start in the following line with different strategies for the data types: | The values start in the following line with different strategies for the data types: | ||
- | Character arrays (strings): The strings are the rows of a character array. Only [1 x N] or [M x N] character arrays are allowed in opposite to string lists and double arrays. The single strings are written as lines and separated by line breaks. Therefore character array must not contain line breaks (ASCII 10 and 13). The number of characters is equal for all strings of a character array, so strings are padded with trailing spaces (Matlab style). The length of the strings need not be specified, because it is implicitly determined by the number of charcters in the lines of the file. Therefore only the index N matters for [N x M] character arrays. In consequence the tag lines " | ||
- | String lists (Matlabs cell string) | ||
- | The strings | + | ====Character arrays (strings)==== |
- | columnwise order (see examples). | + | The strings are the rows of a character array. Only [1 x N] or [M x N] character arrays are allowed in opposite to string lists and double arrays. The single strings are written as lines and separated by line breaks. Therefore character array must not contain line breaks |
- | =====Double arrays===== | + | ====String lists (Matlabs cell string)==== |
+ | |||
+ | The strings of a string list can vary in the length and no trailing spaces are needed. The single strings of the list are written as lines separated by line breaks. Therefore strings must not contain line breaks (ASCII code 10 or 13). For string lists with more than 2 dimensions the first index is varied at first, then the second and so on, so-called columnwise order. | ||
+ | |||
+ | ====Double arrays==== | ||
For doubles with 2 dimensions the rows (varying 2nd index) are stored in lines separated by spaces. For more then 2 dimensions the 2nd index remains the number of elements per line, while the trailing dimensions are kept together (see examples and algorithm). This means, that row vectors (dimension [1 x N]) are written in a single line, while column vectors (dimension [M x 1]) fill M lines. It is not allowed to write column vectors in a line, because the number of lines must match the product of all but the 2nd dimension under all circumstances. Then the reading function can skip a value section by jumping over a well-defined number of lines to find the next tag line. | For doubles with 2 dimensions the rows (varying 2nd index) are stored in lines separated by spaces. For more then 2 dimensions the 2nd index remains the number of elements per line, while the trailing dimensions are kept together (see examples and algorithm). This means, that row vectors (dimension [1 x N]) are written in a single line, while column vectors (dimension [M x 1]) fill M lines. It is not allowed to write column vectors in a line, because the number of lines must match the product of all but the 2nd dimension under all circumstances. Then the reading function can skip a value section by jumping over a well-defined number of lines to find the next tag line. | ||
Zeile 109: | Zeile 113: | ||
4 5 6 | 4 5 6 | ||
- | =====Multi-dimensional doubles===== | + | ====Multi-dimensional doubles==== |
The approach to use the second dimension as lines and keeping the trailing dimensions together enforces a complex ordering of values. In consequence the array is split at the first dimension in parts. | The approach to use the second dimension as lines and keeping the trailing dimensions together enforces a complex ordering of values. In consequence the array is split at the first dimension in parts. | ||
Zeile 149: | Zeile 153: | ||
of all other dimensions 2*4 = 8. | of all other dimensions 2*4 = 8. | ||
- | =====Examples: | + | ====Examples: |
A single string is a row vector of characters like ' | A single string is a row vector of characters like ' | ||
- | [D]$ | + | |
- | abc | + | abc |
This is equivalent to: | This is equivalent to: | ||
- | [D]$1 | + | |
- | abc | + | abc |
A character array of size [2 x 6] named ' | A character array of size [2 x 6] named ' | ||
- | [E]$2 | + | |
- | Du.... | + | Du.... |
- | hier.. | + | hier.. |
Pay attention for the 2nd dimension: The length of each line determines the row dimension! Therefore $N, $1$N and $N$1 are treated identically in opposite to the other types. | Pay attention for the 2nd dimension: The length of each line determines the row dimension! Therefore $N, $1$N and $N$1 are treated identically in opposite to the other types. | ||
Zeile 206: | Zeile 210: | ||
' | ' | ||
- | [A]:0:2:3 | + | |
and no values appear. | and no values appear. | ||
Zeile 212: | Zeile 216: | ||
The tag line can be commented with the '#' | The tag line can be commented with the '#' | ||
- | [TagName]: | + | |
Empty lines can be inserted before a tag line: | Empty lines can be inserted before a tag line: | ||
Zeile 219: | Zeile 223: | ||
String1 | String1 | ||
- | [Tag2]& | + | |
- | StringListElement1 | + | StringListElement1 |
- | =====Header line===== | + | ====Header line==== |
Old style: In ASC-HD v2.0 the header line looks as following: | Old style: In ASC-HD v2.0 the header line looks as following: | ||
Zeile 248: | Zeile 252: | ||
If new variables are appended to an existing file, the number of digits must not be decreased to avoid a loss of data. Be aware that management of data precision is a critical drawback when using ASCII files. | If new variables are appended to an existing file, the number of digits must not be decreased to avoid a loss of data. Be aware that management of data precision is a critical drawback when using ASCII files. | ||
- | ======Comments====== | + | =====Comments===== |
Disk space is cheap today. Therefore it is recommended to use ' | Disk space is cheap today. Therefore it is recommended to use ' | ||
Zeile 256: | Zeile 260: | ||
Date and time of creation, host name, institution, | Date and time of creation, host name, institution, | ||
- | ======Guidelines for implementations of reading and writing routines====== | + | =====Guidelines for implementations of reading and writing routines===== |
+ | |||
+ | Line breaks deviating from the preferred DOS style should be accepted. | ||
+ | |||
+ | Before appending new variables to a file, check the trailing line break. It is a beloved feature to extract single variables from am ASC-HD file, but avoid dull searching for ' | ||
+ | |||
+ | Users will insert errors in ASCII files whenever possible. A fair reading function counts the found elements and displays the name of the variable and the line number of problems. | ||
- | Line breaks deviating from the preferred DOS style should be accepted. Before appending new variables to a file, check the trailing line break. It is a beloved feature to extract single variables from am ASC-HD file, but avoid dull searching for ' | + | There is no idea how to treat characters with more then 7 bits. Think of an additional unicode type, the TeX like ["a] for the german Umlaut-a, the ISO-Latin-1 [& |
fileformats/hdascii.txt · Zuletzt geändert: 2017/12/22 15:08 von oliver