Darwin Open Data provides 3rd party programs like Matlab access to the Darwin2 recording data.

To install, run "DarwinOpenData_Install.bat" (can be found in the the Darwin2 program folder). Administrator permissions are required.

Connect to DarwinOpenData

To connect to DarwinOpenData in Matlab, type the following lines of code:

(Lines starting with "%" are comments, you don't need to enter them)

pkg load windows

% Create interface to Darwin database
server = actxserver('DarwinOpenData.DarwinDataBase')

% and connect the interface to the darwin database
server.ConnectToDataBase('')

Open a recording

ListRecordings prints a list of all recordings that are marked as uploaded, analyzed, released or reviewed.
Each entry of the list consists of a GUID (necessary to open a recording) the state of the recording and the
patient’s first and surname.

% print out newest 5 recordings in database (0 for all)
server.ListRecordings(5)

ans =
'GUID: {92C9C99B-9789-486B-A252-D0B26CC8942C}; State: Analyzed'
'Surname: Patient; First Name: Example'
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'

Now open a recording by calling OpenRecording with the GUID.

% open Example Patient
rec = server.OpenRecording('{72EB012E-1C1A-4D72-BC00-BBD74472EB76}')

rec.GetPatName
ans = "AV Block Atrial Fibrillation"

The variable rec is an interface to this specific Darwin recording.

chanlist=rec.GetChannelList

% display available channels
chanlist.ListChannels

ans =
'ECG Channel 1'
'ECG Channel 2'
'ECG Channel 3'
'Beat Channel'

% create an interface to ecg channel 1
ecgchan = chanlist.GetECGChannel(1)

ans =
Interface.DarwinOpenData.IDarwinECGChannel

% create an interface to the beat channel
beatchan = chanlist.GetBeatChannel

ans =
Interface.DarwinOpenData.IDarwinBeatChannel

% get number of beats
beatchan.BeatCount

ans =
55204

% get eventtime of beat number 100
beatchan.EventTime(100)

ans =
115.2568

% get original beat type (2 in this example)
% and then user specified beat type (also 2)
% the second return value (1) is the template number
beatchan.GetBeatType(100)

ans =
2 1

beatchan.GetUserBeatType(100)

ans =
2 1

ATT: Functions with multiple return values like 

[EventTimes,BeatTypes,TemplateNumbers] = beatchan.BeatArray

will NOT work in Octave.

Beat types:
2 Normal
3 Ventricular
4 Atrial Paced
5 Ventricular Paced
6 Dual Chamber Paced
7 Bundle branch Block
8 Junctional
9 Fusion
10 Artefact
11 Paced
12 Breaking Artefact

Closing ActiveX

release(server)