Skip to content

Commit 5fe7063

Browse files
committed
Updating documentation
1 parent e4b4113 commit 5fe7063

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ It will generate an `edf.jar` file on the `target` folder. This Jarfile can be i
2424

2525
## Development ##
2626

27-
The current workings of JEDF are destined to a `v0.3`, which must save the EDF file to the CSV format, mimicking [the analogous Golang implementation of this package](https://github.com/ishiikurisu/edf). `v0.4` must be able to convert the EDF both to CSV and back to the EDF format, so the programmer can make changes on the EDF file and save it back to later concerns.
27+
The current workings of JEDF are destined to a `v0.4`, which must enable the programmer to convert the EDF both to CSV and back to the EDF format, so they can make changes on the EDF file and save it back to later concerns.
2828

2929
Future ideas include the implementation of a on-time access to the data: the `EDF` class would know where to find certain parts of the file and load them whenever needed instead of storing the whole file's contents on RAM memory.
3030

@@ -36,67 +36,79 @@ Those are the currently available methods for this class.
3636

3737
### Methods ###
3838

39-
#### `public EDF(String filePath)` ####
39+
#### `EDF(String filePath)` ####
4040

41-
This is the constructor. It requires a string that describes the path to the
41+
This is the constructor. It requires a string that describes the path to the EDF file.
4242

43-
#### `public String getFile()` ####
43+
#### `String getFile()` ####
4444

4545
- Gets the file path.
4646
- Return: the file path;
4747

48-
#### `public HashMap getHeader()` ####
48+
#### `HashMap getHeader()` ####
4949

5050
- Gets raw EDF header.
5151

52-
#### `public HashMap getRecords()` ####
52+
#### `HashMap getRecords()` ####
5353

5454
- Gets raw EDF records
5555

56-
#### `public String[] getLabels()` ####
56+
#### `String[] getLabels()` ####
5757

5858
- Get the labels contained in this EDF file.
5959

60-
#### `public int getSamplingRate()` ####
60+
#### `int getSamplingRate()` ####
6161

6262
- Gets the sampling rate of the recording.
6363

6464

65-
#### `public void toAscii(String filePath) throws IOException` ####
65+
#### `void toAscii(String filePath) throws IOException` ####
6666

6767
- Formats the read records into the ASCII format and saves it into memory.
6868
- Paramter `filePath`: the path to the file to be written.
6969

70-
#### `public void toSingleChannelAscii(String filePath, String channel) throws IOException` ####
70+
#### `void toSingleChannelAscii(String filePath, String channel) throws IOException` ####
7171

7272
* Writes a determined record to a file.
7373
* Parameter `filePath`: the path to the file to be written
7474
* Parameter `channel`: the label of the record to be saved on memory
7575

7676

77-
#### `public String[] getAnnotations() throws NoSuchFieldException` ####
77+
#### `String[] getAnnotations() throws NoSuchFieldException` ####
7878

7979
* Gets a list of the annotations on the EDF file, lest there are annotations.
8080
* Returns an array containing one annotation for each entry.
8181

82-
#### `public double getConvertionFactor(String label)` ####
82+
#### `double getConvertionFactor(String label)` ####
8383

8484
* Gets the convertion factor related to the given label
85-
* Paramter `label`: the channel's label whose convertion factor we want
85+
* Parameter `label`: the channel's label whose convertion factor we want
8686
* Returns the convertion factor.
8787

88-
#### `public double[] getSignal(String label)` ####
88+
#### `double[] getSignal(String label)` ####
8989

9090
* Get a signal based on its label.
9191
* Parameter `label`: the signal label.
9292
* Returns the translated record.
9393

94+
#### `void toCsv(String filePath) throws IOException` ####
95+
96+
* Translates the loaded EDF file into a CSV table.
97+
* Parameter `filePath`: the file name on which the data must be saved
98+
9499
## The `EDFUtil` class
95100

96101
Mostly holds some utility functions to help with EDF processing.
97102

98103
### Methods
99104

100-
#### `public static String[] separateString(String inlet, int numChops)`
105+
#### `static String[] separateString(String inlet, int numChops)`
101106

102107
* Separates a string into equal length chops.
108+
109+
#### `static String joinStrings(String[] inlet, String sep)` ####
110+
111+
* Creates a new string uniting strings with a separator in the middle.
112+
* Parameter `inlet`: the String array to be united.
113+
* Parameter `sep`: the String that will appear in the middle of the other strings.
114+
* Returns the united string.

java/br/unb/biologiaanimal/edf/EDF.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import java.util.HashMap;
44
import java.util.Set;
5-
import java.text.MessageFormat;
65
import java.io.IOException;
76

87
/**
98
* The class to hold the EDF file information.
109
* @author Cristiano Silva Jr. cristianoalvesjr@gmail.com
11-
* @version 0.2.0
10+
* @version 0.3.0
1211
*/
1312
public class EDF
1413
{
@@ -150,7 +149,7 @@ public void toAscii(String filePath)
150149
* Writes a determined record to a file.
151150
* @param filePath the path to the file to be written
152151
* @param channel the label of the record to be saved on memory
153-
* @throws java.util.IOException
152+
* @throws java.io.IOException
154153
*/
155154
public void toSingleChannelAscii(String filePath, String channel)
156155
throws IOException
@@ -166,9 +165,10 @@ public void toSingleChannelAscii(String filePath, String channel)
166165
writer.close();
167166
}
168167

169-
// TODO Translate data to CSV table
170168
/**
171169
* Translated the loaded EDF file into a CSV table
170+
* @param filePath the file name on which the data must be saved
171+
* @throws java.io.IOException
172172
*/
173173
public void toCsv(String filePath)
174174
throws IOException
@@ -184,7 +184,6 @@ public void toCsv(String filePath)
184184
(String) header.get("starttime") + ";");
185185
writer.write("sampling:" + Integer.toString(getSamplingRate()) + ";");
186186
writer.write("subject:" + (String) header.get("patient") + ";");
187-
// TODO Get labels
188187
writer.write("labels:" + EDFUtil.joinStrings(getLabels(), "\t") + ";");
189188
writer.write("chan:" + (String) header.get("numbersignals") + ";");
190189
// TODO Get units

manifest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Specification-Title: "EDF+ format implementation"
44
Specification-Version: "1.1"
55
Specification-Vendor: "European Data Format"
66
Implementation-Title: "br.unb.biologiaanimal.edf"
7-
Implementation-Version: "0.3"
7+
Implementation-Version: "0.3.0"
88
Implementation-Vendor: "Laboratory of Neuroscience and Behavior"

target/edf.jar

-3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)