id
stringlengths
36
36
text
stringlengths
1
1.25M
8a00b741-b927-422e-b17c-d8c336157aca
public void detectQRS(DetectQRSOptions options) throws IOException, InterruptedException { ProcessBuilder pb = createProcessBuilder(options.getCommand()); pb.redirectErrorStream(true); File baseDirectory = options.getBaseDirectory(); if (baseDirectory != null && baseDirectory.exists()) { pb...
af31e606-3703-403d-8a1c-c2b165a78f31
public String edf2mit(Edf2MitOptions options) throws IOException, InterruptedException { List<String> command = options.getCommand(); ProcessBuilder pb = createProcessBuilder(command); File baseDirectory = options.getBaseDirectory(); if (baseDirectory != null && baseDirectory.exists()) { pb....
ab14e86e-1fed-413e-8931-5a75b75ed709
public HRV hrv(File edf, String annotator, LocalTime startTime, LocalTime endTime, String... params) throws Exception { List<String> cmd = new ArrayList<String>(); cmd.add("get_hrv"); if (params != null && params.length > 0) { cmd.addAll(Arrays.asList(params)); } cmd.add(edf.getName());...
ee94455b-ba69-4c60-8433-68a5e640aef0
public HRV hrv(File edf, String annotator, String... params) throws Exception { return hrv(edf, annotator, null, null, params); }
58eea4da-bc18-4703-a12c-59ec472e5eeb
public HRV hrv(HRVOptions options) throws Exception { ProcessBuilder pb = createProcessBuilder(options.getCommand()); pb.redirectErrorStream(true); File baseDirectory = options.getBaseDirectory(); if (baseDirectory != null && baseDirectory.exists()) { pb.directory(baseDirectory); } Process...
6f41f916-d6e6-41ad-bdca-db3ca1fa1510
public boolean isInstalled() throws IOException, InterruptedException { /** * Implementation: check if every needed command is available. This is done * by executing the hash command and looking at the exit code. The exit code * 0 indicates the command is installed correctly. Assuming every needed ...
583af35b-d3ca-4d9e-bed7-ff6b185d535d
public void rdsamp(File edf) throws IOException, InterruptedException { ProcessBuilder pb = createProcessBuilder("rdsamp", edf.getName()); pb.directory(edf.getParentFile()); Process process = pb.start(); process.waitFor(); }
f0577378-f2d3-4750-a644-98c9d57167f8
public File rdsamp(RdsampOptions options) throws IOException, InterruptedException { ProcessBuilder pb = createProcessBuilder(options.getCommand()); File baseDirectory = options.getBaseDirectory(); pb.directory(baseDirectory); File outputFile = new File(baseDirectory, options.getOutputName()); ...
6e4897c0-a590-4fdf-9f65-93f5ae49ccc5
public void sqrs(File testFile) throws IOException, InterruptedException { ProcessBuilder pb = createProcessBuilder("sqrs", "-r", testFile.getName()); pb.redirectErrorStream(true); pb.directory(testFile.getParentFile()); Process process = pb.start(); process.waitFor(); InputStream in = process.g...
392cc5a7-3f7d-41f0-ad18-d8555c558c04
public void testLocale() throws Exception { ProcessBuilder pb = createProcessBuilder("locale"); Process process = pb.start(); process.waitFor(); InputStream in = process.getInputStream(); System.out.println(IOUtils.toString(in)); }
124db10d-aef6-402c-88e0-ec5ebb4229dd
protected ProcessBuilder createProcessBuilder(List<String> command) { ProcessBuilder pb = new ProcessBuilder(command); setLocale(pb); return pb; }
580bbde8-d9e0-4352-aa8b-9a2922b5ba79
protected ProcessBuilder createProcessBuilder(String... command) { return createProcessBuilder(Arrays.asList(command)); }
9119f5d2-1d5c-49e7-bbfd-4ef4f7868bb5
protected int execute(String... command) throws IOException, InterruptedException { ProcessBuilder pb = createProcessBuilder(command); Process process = pb.start(); return process.waitFor(); }
a4d06c40-8843-434d-92bb-17cf8584b142
private void setLocale(Map<String, String> env) { String lang = "en_US.UTF-8"; env.put("LANG", lang); env.put("LC_COLLATE", lang); env.put("LC_CTYPE", lang); env.put("LC_MESSAGES", lang); env.put("LC_MONETARY", lang); env.put("LC_NUMERIC", lang); env.put("LC_TIME", lang); // env.put(...
49de656e-50ba-49eb-b94e-66eb8e95782a
private void setLocale(ProcessBuilder pb) { this.setLocale(pb.environment()); }
071a4550-124b-4158-b62c-19d3e99ca9eb
public DetectQRSOptions(File record) { super(); this.command = "sqrs"; this.record = record; if (record != null) { this.baseDirectory = record.getParentFile(); } }
041fc3a1-c17e-4492-a009-112d4e059946
public File getBaseDirectory() { return baseDirectory; }
8441f9d7-040c-46fa-8c17-5b0d08826bee
public List<String> getCommand() { List<String> cmd = new LinkedList<String>(); cmd.add(command); cmd.add("-r"); cmd.add(record.getName()); if (startTime != null) { cmd.add("-f"); cmd.add(startTime.toString("HH:mm:ss")); } if (endTime != null) { cmd.add("-t"); cmd.a...
a1a26f03-9300-4edf-9db7-a7de29fcb2c6
public LocalTime getEndTime() { return endTime; }
4001bf17-d22d-4706-a1e6-3cec74241559
public File getRecord() { return record; }
e35ee842-3ef5-40c7-8862-62106e8cf095
public int getSignal() { return signal; }
047e4c00-3004-475c-b44f-2dd6a16fb667
public LocalTime getStartTime() { return startTime; }
945269b4-4175-4138-9718-56f0282dc71c
public int getTreshold() { return treshold; }
1ba5f41a-0f1c-4084-b5bf-717f14034208
public boolean isHighResolutionMode() { return highResolutionMode; }
f0da0994-c839-4b14-9fa2-b1062bcefad2
public DetectQRSOptions setBaseDirectory(File baseDirectory) { this.baseDirectory = baseDirectory; return this; }
43affae7-4931-4b15-96d7-a79271ae2699
public DetectQRSOptions setCommand(String command) { this.command = command; return this; }
f6799333-2554-4430-acba-d49dc463101e
public DetectQRSOptions setEndTime(LocalTime endTime) { this.endTime = endTime; return this; }
72dfbe5f-db18-4554-8bd4-f43fb4665627
public DetectQRSOptions setHighResolutionMode(boolean highResolutionMode) { this.highResolutionMode = highResolutionMode; return this; }
7e609e08-618a-4e31-9a41-bc092494ef3d
public DetectQRSOptions setSignal(int signal) { this.signal = signal; return this; }
f43b0bf9-5cd3-473b-a295-9f8c8154ea53
public DetectQRSOptions setStartTime(LocalTime startTime) { this.startTime = startTime; return this; }
a189d4a4-7a44-4c7f-9d88-e99a23621301
public DetectQRSOptions setTreshold(int treshold) { this.treshold = treshold; return this; }
eb21557e-4673-4cb4-a3d9-13d45ee13b06
public HRVOptions(File rrFile) { super(); if (rrFile != null) { this.file = rrFile.getName(); this.baseDirectory = rrFile.getParentFile(); this.isRR = true; } }
162c639a-50ee-440a-a753-7e6f166befcb
public HRVOptions(File recordFile, String annotation) { super(); if (recordFile != null) { this.file = recordFile.getName(); this.baseDirectory = recordFile.getParentFile(); } this.annotation = annotation; }
50abaca8-b043-4632-8edb-004707dbbbe1
public HRVOptions(String file) { super(); this.file = file; this.isRR = true; }
77e2b01e-e731-46f5-9c43-f69cb454fb41
public HRVOptions(String file, String annotation) { super(); this.file = file; this.annotation = annotation; }
8a5c6608-ff36-4635-9a4c-c18311e8a47c
public String getAnnotation() { return annotation; }
20c3948d-e082-459e-80e0-ec69473e8eea
public File getBaseDirectory() { return baseDirectory; }
3a45d725-388a-4fd7-9e0e-c7022041317c
public List<String> getCommand() { List<String> cmd = new ArrayList<String>(); cmd.add("get_hrv"); if (outputMsec) { cmd.add("-M"); } if (shortTermStats) { cmd.add("-s"); } if (StringUtils.isNotBlank(filter)) { cmd.add("-f " + filter); } if (StringUtils.isNotBlank(n...
000c0531-e564-4437-9716-a0007ae37786
public LocalTime getEnd() { return end; }
a5eaa894-ffb9-48bb-9739-96a44b2bf687
public String getFile() { return file; }
87d9404e-3027-4508-8b01-a008ca8e3828
public double getFilt() { return filt; }
77fe1171-8d85-4e72-9275-f160ac7d35d4
public double getHi1() { return hi1; }
02fa5c77-dec3-49d8-a725-8c6fa33439c2
public double getHi2() { return hi2; }
83126a0e-511b-4e07-ac95-ade7ec491e86
public double getHi3() { return hi3; }
de504070-300a-49ea-b233-c649430e7a29
public double getHi4() { return hi4; }
14186ad2-a1cb-4308-869a-c500f5cd375a
public double getHwin() { return hwin; }
65781711-cd75-4e90-8fcb-a8d24a331780
public String getInputTimeFormat() { return inputTimeFormat; }
d5e7dc98-bff6-472a-8de3-6618027ad2d8
public double getLo1() { return lo1; }
6f074af3-2166-47e1-b852-0d42c5c8a168
public double getLo2() { return lo2; }
4def5d77-3009-4228-941a-5c855bbd1853
public double getLo3() { return lo3; }
b33e6bbc-21b7-4d2c-9e85-0646b57b2c43
public double getLo4() { return lo4; }
803b2743-47cd-40ff-a9df-1e87d2c6fa59
public String getNnDiff() { return nnDiff; }
cdb54ada-5777-4133-9b7d-b221d82c3f2b
public LocalTime getStart() { return start; }
296b7644-59b8-40de-8ba9-8a3c969ff032
public boolean isOutputMsec() { return outputMsec; }
9da60aba-6880-4fbd-935e-fa269a1f81a4
public boolean isRrInMSec() { return rrInMSec; }
288b3531-78bd-4ff0-8b46-f4abd7b3e48d
public boolean isShortTermStats() { return shortTermStats; }
97238d31-377b-4308-97d2-55b7ca916896
public HRVOptions setAnnotation(String annotation) { this.annotation = annotation; return this; }
f1f705af-8d17-4039-aa77-85e0be9fd8fa
public HRVOptions setBaseDirectory(File baseDirectory) { this.baseDirectory = baseDirectory; return this; }
3916140c-924e-470f-8c42-5467204a9fdf
public HRVOptions setEnd(int m, int s) { setEnd(new LocalTime(0, m, s)); return this; }
4e9aff3a-347b-40c4-a58b-0029a7427b9d
public HRVOptions setEnd(LocalTime end) { this.end = end; if (this.start == null) { this.start = new LocalTime(0, 0, 0); } return this; }
f60a6d12-bbc8-41d3-a63c-299a66090e23
public HRVOptions setFile(String file) { this.file = file; return this; }
12646e68-aaca-49f9-ac1d-145d4c8cfaa7
public HRVOptions setFilt(double filt) { this.filt = filt; return this; }
1e09d609-9997-4312-82eb-e4bfe05b9e47
public HRVOptions setFilter(String filter) { this.filter = filter; return this; }
3a3c99c2-e2fa-4393-b196-908449450f28
public HRVOptions setHi1(double hi1) { this.hi1 = hi1; return this; }
b47e30d2-aa64-43d1-84bd-0668a6dec7b6
public HRVOptions setHi2(double hi2) { this.hi2 = hi2; return this; }
8c84267c-a4a0-4c1e-b4ee-bfadd5ce6c18
public HRVOptions setHi3(double hi3) { this.hi3 = hi3; return this; }
b18aecaf-963a-4cdb-b6a9-b04e34360841
public HRVOptions setHi4(double hi4) { this.hi4 = hi4; return this; }
7da8b165-40ea-4b4b-8110-1c4b2f800276
public HRVOptions setHwin(double hwin) { this.hwin = hwin; return this; }
fcfbf975-025c-4e78-ac5c-1814fc2365ed
public HRVOptions setInputTimeFormat(String inputTimeFormat) { this.inputTimeFormat = inputTimeFormat; return this; }
ebe0708a-990a-4006-844e-d8dfe9dbad3b
public HRVOptions setLo1(double lo1) { this.lo1 = lo1; return this; }
f333c703-3ab8-47e6-8f06-2c72a0888bcd
public HRVOptions setLo2(double lo2) { this.lo2 = lo2; return this; }
293e1005-c9e7-40ce-ac51-1b7d6f414217
public HRVOptions setLo3(double lo3) { this.lo3 = lo3; return this; }
e046146c-8b6b-4ae1-be49-184b0c517462
public HRVOptions setLo4(double lo4) { this.lo4 = lo4; return this; }
3e115a18-6f47-4ef1-b735-83bf80f1305c
public HRVOptions setNnDiff(String nnDiff) { this.nnDiff = nnDiff; return this; }
8ba988cc-5953-4c72-90bd-baf36293c792
public HRVOptions setOutputMsec(boolean outputMsec) { this.outputMsec = outputMsec; return this; }
17c0c41f-1b99-4479-af6c-f3518bb668fc
public HRVOptions setRrInMSec(boolean rrInMSec) { this.rrInMSec = rrInMSec; return this; }
11f70aad-c9a6-4685-ba6d-685237417802
public HRVOptions setShortTermStats(boolean shortTermStats) { this.shortTermStats = shortTermStats; return this; }
e251a58b-0ea3-4d0b-b9e2-77ed1690016e
public HRVOptions setStart(int m, int s) { return setStart(new LocalTime(0, m, s)); }
8cac77df-e735-4bed-a5f9-20606a5a0f17
public HRVOptions setStart(LocalTime start) { this.start = start; return this; }
cfb48e87-fc7c-4df4-ae8c-492210ad04ee
public HRVOptions startTime(LocalTime start) { this.start = start; return this; }
b0dd0aaf-feb8-45ad-b2ae-7a4b93f26459
public WqrsOptions(File record) { super(record); setCommand("wqrs"); }
9d12932f-a460-41a4-91e0-baf83e889ffc
@Override public List<String> getCommand() { List<String> cmd = super.getCommand(); if (annotateJPoints) { cmd.add("-j"); } if (resample) { cmd.add("-R"); } if (powerLine != -1) { cmd.add("-p"); cmd.add(Integer.toString(powerLine)); } return cmd; }
dc30f8b5-bbfa-4fc0-a015-b8d1d18fd40b
public int getPowerLine() { return powerLine; }
2792f839-b37a-41cc-8357-212a092a1b71
public boolean isAnnotateJPoints() { return annotateJPoints; }
97978912-1b6a-4afe-9598-dfedf3201958
public boolean isResample() { return resample; }
4841a8ac-f088-40a0-9799-4baead123670
public WqrsOptions setAnnotateJPoints(boolean annotateJPoints) { this.annotateJPoints = annotateJPoints; return this; }
e763008f-43e7-49b8-8fb7-c33f0fff76d3
public WqrsOptions setPowerLine(int powerLine) { this.powerLine = powerLine; return this; }
598925b6-c187-4c61-8cf5-006ff37d1e61
public WqrsOptions setResample(boolean resample) { this.resample = resample; return this; }
74204255-7c68-4e5e-a566-60941ad8d9e3
public String getParameter() { return "-" + name(); }
61cc4199-9be6-4805-915b-719cbfd6fc80
public Edf2MitOptions(File edfFile) { super(); this.outputName = UUID.randomUUID().toString(); this.edfFile = edfFile; if (edfFile != null && edfFile.exists()) { this.baseDirectory = edfFile.getParentFile(); } }
1b8d43dc-6bcf-4ed7-9ff2-deffd49b642b
public File getBaseDirectory() { return baseDirectory; }
90201b3f-f952-44c4-8bbd-1514b448b337
public List<String> getCommand() { List<String> command = new ArrayList<String>(); command.add("edf2mit"); if (edfFile != null) { command.add("-i"); command.add(edfFile.getName()); } command.add("-r"); command.add(outputName); if (isBigEndian) { command.add("-b"); } ...
8ef8ad5d-d482-4237-8fb2-38e3a371211a
public String getOutputName() { return outputName; }
05968f3a-fca3-4bcb-a05c-9c5c2a9d547d
public boolean isBigEndian() { return isBigEndian; }
16d30677-db36-4cb2-8bbe-a062fdcb7c4c
public Edf2MitOptions setBaseDirectory(File baseDirectory) { this.baseDirectory = baseDirectory; return this; }
3833adfc-0872-4fec-8033-ad087827b60f
public Edf2MitOptions setBigEndian(boolean isBigEndian) { this.isBigEndian = isBigEndian; return this; }
fbf5faa4-28b9-4099-98dd-b668541aa46e
public Edf2MitOptions setSignals(int... signals) { this.signals = signals; return this; }
951ff8b8-e4f0-4223-b2aa-dfb39369a429
public RdsampOptions(File record) { super(); this.outputName = UUID.randomUUID().toString(); this.record = record; if (record != null) { this.baseDirectory = record.getParentFile(); } }
127383c2-cb57-4f93-a097-0dbbc3db74c8
public File getBaseDirectory() { return baseDirectory; }
db1e0ffa-1efc-47e2-bba7-5afada246e2e
public List<String> getCommand() { List<String> cmd = new LinkedList<String>(); cmd.add("rdsamp"); cmd.add("-r"); cmd.add(record.getName()); if (useCSV) { cmd.add("-c"); } if (printColumHeadings) { cmd.add("-v"); } if (ArrayUtils.isNotEmpty(signals)) { cmd.add("-s...