cartoMesh2VTK
CARTOMESH2VTK Converts a Carto mesh file to VTK file
Usage
tr = cartoMesh2VTK('openfile')
Parameters
tr,
a TriRep object
Description
CARTOMESH2VTK Converts a Carto3 mesh to a VTK file and returns a TriRep object
Author Steven Williams (2015) (Copyright)
cemrg2carto
CEMRG2CARTO Converts a VTK for loading into Carto
Usage
op = cemrg2carto(infile, outfile)
Parameters
infile
a VTK file created by CEMRG
outfile
a VTK file formatted for Carto
Description
Where: infile - a VTK file created by CEMRG outfile - a VTK file formatted for Carto
Author Steven Williams (2016)
cvHistogram
CVHISTOGRAM Draws a conduction velocity histogram
Usage
cvHistogram( userdata )
Parameters
userdata
see importcarto_mem
Parameter Value Pairs
‘limits’ {[0 5]} | array
‘binwidth’ {0.1} | double
Description
CVHISTOGRAM displays a histogram of conduction velocities. Limits are set to exclude non-physiological conduction velocities
Author Steven Williams (2020) (Copyright)
distanceBetweenPoints
DISTANCEBETWEENPOINTS Returns the distance from A to B.
Usage
distance = distanceBetweenPoints(userdata, A, B)
Parameters
userdata
see importcarto_mem
P1
is the first point
P2
is the second point
Parameter Value Pairs
‘method’ {‘linear’} | ‘geodesic’
- Specifies whether to calcualte linear or geodesic distances
‘plot’ {false} | true
- Specifies whether to draw a figure
Description
DISTBETWEENPOINTS returns the distance from A to B. A and B are specified as row vectors [x, y, z] or matrices, with rows representing different points. If npoints in A and B are different A must specify one and only one point.
Author Steven Williams (2020) (Copyright)
drawMap
DRAWMAP plots an OpenEP map
Usage
hSurf = drawMap(userdata)
hSurf = drawMap(userdata, varargin);
Parameters
hSurf
is a handle to the surface
userdata
is a Carto data structure
Parameter Value Pairs
‘data’ {[]} | [d]
- Where d is a vector of data values and size(d) equals numel(userdata.surface.triRep.X)
‘type’ {‘act’} | ‘bip’ | ‘force’ | ‘uni’ | ‘none’ | ‘cv’
- Specifies type of map - activation, bipolar or unipolar voltage
‘coloraxis’ {[]} | [a b]
- Where a and b are real numbers. See help colorShell
‘noLight’ {false} | true
- If set to true no additional light will be drawn. Useful if
overlaying maps.
‘usrColorMap’ {[]}|cMap
- If set, this colormap will be used instead of the defaults
colorbarlocation ‘north’ | ‘south’ | ‘east’ | ‘west’ | ‘northoutside’ |
‘southoutside’ | ‘eastoutside’ | {‘westoutside’}
‘orientation’ {‘AP’} | ‘PA’
- Specifies the view as AP or PA. LAO, RAO, LL, RL yet to be
defined
‘colorfillthreshold’ {10} | c
- Where c is a scalar value; defaulting to 10mm
Description
DRAWMAP is a wrapper function for colorShell.m which allows OpenEP data to be plotted.
Author Steven Williams (2016) (Copyright)
editUserdata
EDITUSERDATA Graphically remove regions from a Carto dataset
Usage
userdata2 = editUserdata(userdata)
Parameters
userdata
is the original Carto dataset
userdata2
is the new Carto dataset with elements removed
Description
EDITUSERDATA uses EDITTRIANGULATION to remove triangles from a TriRep object. Controls: Left click - select triangles to remove Shift-Left click - select triangles to keep Ctrl-Left click - select area up to the boundary d - done
Author Steven Williams (2016) (Copyright)
fixVoltageAnnotations
FIXVOLTAGEANNOTATIONS Fixes the uni/bip reversal identified in userdata.electric.voltages in August 2014. This function is not required for any userdata .mat files created after 27th August 2014.
Usage
userdata = fixVoltageAnnotations(userdata)
Parameters
userdata
is the output
userdata
is the input, or ‘openfile’
Description
FIXVOLTAGEANNOTATIONS detailed description goes here.
Author Steven Williams (2014) (Copyright)
generateInterpData
GENERATEINTERPDATA Performs spatial interpolation of scalar data
Usage
interpData = generateInterpData(userdata, datatype)
Parameters
userdata
see, importcarto_mem
datatype
the desired data type to return
interpData
is the interpolated data
Parameter Value Pairs
‘interMethod’ ‘nearest’|‘linear’|{‘natural’}
- The interpolation method, default to natural
‘exterMethod’ {nearest}|linear|none
- The extrapolation method, defaults to linear
‘distanceThresh’ {10}|double
- The distance threshold, d, default 10mm
Description
GENERATEINTERPDDATA performs spatial interpolation of scalar data. Userdata and datatype are mandatory arguments. Datatype may be one of: ‘bip-map’ - bipolar voltage; from the exported voltage values ‘uni-map’ - unipolar voltage; from the exported voltage values ‘lat-map’ - local activation time; from the annotated electrograms ‘bip-egm’ - bipolar voltage; measured by OpenEP on the egms (NOT IMPLEMENTED) ‘uni-egm’ - unipolar voltage; measured by OpenEP on the egms (NOT IMPLEMENTED) ‘lat-egm’ - local activation time; measured by OpenEP on the egms (NOT IMPLEMENTED) ‘cv’ - conduction velocity ‘egmduration’ - electrogram duration GENERATEINTERPDATA removes any NaN values in data (and their corresponding location(s) in coords) before calling scatteredInterpolant with the interpolation/extrapolation methods specified. Any values greater than distancethresh are removed.
Author Steven Williams (2018) (Copyright)
getAblationArea
GETABLATIONAREA Calculates the area of a chamber which has been ablated
Usage
[ablArea, isAblated, trAbl] = getAblationArea( userdata )
Parameters
userdata
see importcarto_mem.m
ablArea
the total area of the chamber that has been ablated
isAblated
indexes into userdata.surface.triRep.Triangulation and
indicates whether a particular triangle is considered
ablated (1) or not (0).
trAbl
a Triangulation of the ablated tissue
Parameter Value Pairs
‘method’ {‘tags’}|‘grid’
- specifies whether to calculate area based on the ablation tags or
the ablation grid
‘radius’ {5}|double
- specifies the radius around each ablation tag to consider ablated
‘thresholdmethod’ {‘on’}|‘off’
- NOT YET IMPLEMENTED
‘thresholdvalue’
- NOT YET INMPLEMENTED
Description
GETABLATIONAREA Requires a userdata structure which contains .rfindex as its input, which can be created using importvisitag.m
Author Steven Williams (2020) (Copyright)
getAnatomicalStructures
GETANATOMICALSTRUCTURES Returns the free boundaries (anatomical structures) described in userdata
Usage
[FF, l, a, tr] = getAnatomicalStructures( userdata, varargin )
Parameters
userdata
see importcarto_mem
FF
see TriRep/freeBoundary, cell array
l
array of lengths (perimeters) of each anatomical structure
a
an array of areas of each anatomical structure
tr
cell array of triangulations of each anatomical structure
Parameter Value Pairs
‘plot’ {false}|true
Description
GETANATOMICALSTRUCTURES identifies all the anatomical structures of a given data set. Anatomical structures are boundary regions that have been added to an anatomical model in the clinical mapping system. For example, with respect of left atrial ablation, anatomical structures may represent the pulmonary vein ostia, mitral valve annulus or left atrial appendage ostium.
Author Steven Williams (2020) (Copyright)
getArea
GETAREA Returns the surface area of an anatomical model
Usage
area = getArea( userdata )
Parameters
userdata
see importcarto_mem
area
the surface area (cm^2)
Parameter Value Pairs
‘method’ {‘nofill’}|‘fill’
Description
GETAREA Returns the surface area of an anatomical model. The anatomical model can first be closed (filling any holes) by specifying the ‘method’, ‘fill’ (‘nofill’ by default).
Author Steven Williams (2020) (Copyright)
getCentreOfMass
GETCENTREOFMASS Returns the centre of mass of the anatomical model defined in userdata
Usage
C = getCentreOfMass( userdata, varargin )
Parameters
userdata
see importcarto_mem
C
the Cartesian co-ordinates of the centre of mass
Parameter Value Pairs
‘plot’ {false}|true
Description
GETCENTREOFMASS calculates the centre of mass of the userdata by accessing a closed surface via the OpenEP function getClosedSurface.m before using centroidOfPolyhedron.m to calculate the centre of mass. The function centroidOfPolyhedron.m was written by Isfandiyar RASHIDZADE, available through the Mathworks FileExchange: https://www.mathworks.com/matlabcentral/fileexchange/63614-centroid-of-triangulated-polyhedron
Author Steven Williams (2020) (Copyright)
getClosedSurface
GETCLOSEDSURFACE Fills all the holes in the userdata surface
Usage
tr = getClosedSurface( userdata )
Parameters
userdata
see importcarto_mem
tr
a triRep object
Description
GETCLOSEDSURFACE Returns a new surface representation of the anatomical model with all the holes in the mesh filed. Closes the surface by the following algorithm. First, every complete free boundary is identified. Second, the barycentre of the free boundary is identified. Third, a triangulation is created covering this hole. Finally, the additional triangles are added to the TriRep.
Author Steven Williams (2020) (Copyright)
getConductionVelocity
GETCONDUCTIONVELOCITY Returns the conduction velocity map of the chamber
Usage
cvdata = getConductionVelocity( userdata )
Parameters
userdata
see importcarto_mem
cvdata
the conduction velocities, in m/s
Description
GETCONDUCTIONVELOCITY Calculate conduction velocities by calculating gradients of interpolated local activation times. GETCONDUCTIONVELOCITY makes use of a modified version of “Scattered Data Interpolation and Approximation using Radial Base Functions” available from the Matlab FileExchange: Alex Chirokov (2020). Scattered Data Interpolation and Approximation using Radial Base Functions (https://www.mathworks.com/matlabcentral/fileexchange/10056-scattered-data-interpolation-and-approximation-using-radial-base-functions), MATLAB Central File Exchange. Retrieved November 24, 2020.
Author Steven Williams (2020) (Copyright)
getEarliestActivationSite
GETEARLIESTACTIVATIONSITE Returns the earliest activation site
Usage
[X] = getEarliestActivationSite( userdata )
[X, surfX] = getEarliestActivationSite( userdata )
[X, surfX, iPoint] = getEarliestActivationSite( userdata )
[X, surfX, iPoint, t] = getEarliestActivationSite( userdata )
Parameters
userdata
see importcarto_mem
X
the earliest activation site, in x,y,z format. For
map-based methods (i.e. clinmap
, clinmapprct
,
openepmap
and openepmapprct
), X is identical to
surfX.
surfX
the surface projection of the eariest activation site
iPoint
the closest mapping point to the earliest activation
site. For point-based methods (i.e. ptbased
or
ptbasedprct
), iPoint indexes into userdata.electric.
For map-based methods (i.e. clinmap
, clinmapprct
,
openepmap
, openepmapprct
), iPoint indexes into
userdata.surface.triRep.X. For percentile methods (i.e.
ptbasedprct
, cinmapprct
or openepmapprct
) iPoint
returns all the points that were identified within the
relevant percentile.
t
the calculated earliest activation time, relative to the
reference annotation
Parameter Value Pairs
‘method’ {‘ptbased’} | ‘ptbasedprct’ | ‘clinmap’ | ‘clinmapprct’ | ‘openepmap’ | ‘openmapprct’
- Specifies the method by which the earliest activation is
calculated.
‘prct’ {2.5} | double
- The percentile to use for percentile mapping; only applicable if
'method'
is 'ptbasedprct'
, 'clinmapprct'
or 'openmapprct'
Description
GETEARLIESTACTIVATIONSITE By identifying the earliest activatin site,
this function can be used, for example, to identify the site in the
chamber closest to the pacing site. Several alternative methods are provided for caluclating the latest
activation site, specified by setting the ‘method’ parameter-value pair
to one of the following options:
ptbased
- Calculates the earliest activation time using
mapping points exported by the clinical system.
ptbasedprct
- Calculates the 0-2.5th percentile mapping
times on the exported electrogram annotations, then
calculates the mean of this sets of activation times.
clinmap
- Calculates the earliest activation time on the
local activation time map created by the clinical
mapping system
clinmapprct
- First calculates the 0-2.5th percentile
mapping times on the clinical local activation time
map, then calculates the mean of these sets of
activation times.
openepmap
- Calculates the earliest activation time on the local
activation time map created by OpenEP from the
exported electrogram annotations.
openepmapprct
- First calculates the 0-2.5th percentile
mapping times on the local activation time map
created by OpenEP from the exported electrogram
annotations. Then calculates the mean of this set of
activation times.
Author Steven Williams (2019) (Copyright)
getEgmsAtPoints
GETEGMSATPOINTS Access eletrograms from stored in the OpenEP data format
Usage
[egmTraces, acttime, egmNames] = getEgmsAtPoints( userdata, varargin )
Parameters
userdata
see importcarto_mem
egmTraces
cell array of the requested electrograms
acttime
cell array of activation times
egmNames
names of the electrograms
Parameter Value Pairs
‘iEgm’ {:}|[a:b]
an array indexing into userdata.electric.egm such that
userdata.electric.egm(iEgmArray,:) are selected for plotting
To convert from Carto point numbers to iEgmArray use
getIndexFromCartoPointNumber.
‘egmtype’ ‘bip’|‘uni’|{‘bip-uni’}
Whether to plot only the bipolar electrograms, only the
unipolar electrograms or both
‘reference’ ‘off’|{‘on’}
Whether to plot the reference channel, off by default userdata.electric.egm(iEgmArray,:) are selected for plotting
To convert from Carto point numbers to iEgmArray use
getIndexFromCartoPointNumber.
Description
GETEGMSATPOINTS by default returns all the electrograms of ‘egmtype’. Use getIndexFromCartoPointNumber to convert from point numbers to index numbers.
Author Steven Williams (2020) (Copyright)
getElectrogramDuration
GETELECTROGRAMDURATION Returns the electrogram durations
Usage
egmDuration = getElectrogramDuration( userdata )
Parameters
userdata
see importcarto_mem
egmDuration
the duration of activation for each electrogram
Description
GETELECTROGRAMDURATION Calculates electrogram durations for each bipolar electrogram in userdata. The method is as follows. First, we iterate through all the bipolar mapping points in userdata.electric. For each mapping point we get the electrogram within the window of interest. We apply the non-linear energy operator to this electrogram. We identify the earliest and latest activation of the energy operator. We calculate the difference and assign that to egmDuration. We also remove any values that are not within +/- 2 standard deviations of the mean. This is an arbritary cut off but some filtering is necessary to avoid identifying noise as continuous activation, for example.
Author Steven Williams (2020) (Copyright)
getElectrogramX
GETELECTROGRAMX Returns the the electrode recording positions
Usage
C = getCentreOfMass( userdata, varargin )
Parameters
userdata
see importcarto_mem
X
the 3D Cartesian co-ordinates
surfX
the surface-projected 3D Cartesian co-ordinates
Parameter Value Pairs
‘type’ {‘bip’}|‘uni’
Description
GETELECTROGRAMX can be used to access the Cartesian co-ordinates of the electrodes used to record the electrograms.
Author Steven Williams (2021) (Copyright)
getFaces
GETFACES Returns the faces referenced by userdata
Usage
faces = getFaces( userdata )
Parameters
userdata
see importcarto_mem
faces
all the faces
Description
GETFACES Returns the faces referenced by userdata
Author Steven Williams (2020) (Copyright)
getImpedanceValues
GETIMPEDANCEVALUE Returns the impedance value of given point(s)
Usage
imp = getImpedanceValue( userdata, varargin )
Parameters
userdata
see importcarto_mem
imp
the impedance values (Ohms)
Parameter Value Pairs
‘method’ {‘map’} | ‘egm’
‘points’ {‘:’} | int array
‘vertices’ {‘:’} | int array
Description
GETIMPEDANCEVALUES Returns the impedance values. By default, impedance
values are returned for all the points in the map. If method
is
specified to be egm
then impedance transients are returned for each
individual mapping point, along with time intervals for the impedances.
If one or more vertices
are specified then impedance values are only
returned for those vertices (only valid if method
is map
).
If one or more points
is specified then impedance values are only
returned for those mapping points (only valid if method
is egm
).
Author Steven Williams (2020) (Copyright)
getIndexFromCartoPointNumber
GETINDEXFROMCARTOPOINTNUMBER Finds the index of the mapping point at the point number displayed on the Carto mapping system.
Usage
[index] = getIndexFromCartoPointNumber(pointNumber)
Parameters
userdata
a userdata structure
pointNumber
a point number (or array of point numbers) as displayed
on the Carto mapping system
index
an index (or array of indices) for referencing into the
data fields within userdata.electric
Description
GETINDEXFROMCARTOPOINTNUMBER Finds the index of the mapping point at the point number displayed on the Carto mapping system.
Author Steven Williams (2020) (Copyright)
getLatestActivationSite
GETLATESTACTIVATIONSITE Returns the latest activation site
Usage
[X] = getLatestActivationSite( userdata )
[X, surfX] = getLatestActivationSite( userdata )
[X, surfX, iPoint] = getLatestActivationSite( userdata )
[X, surfX, iPoint, t] = getLatestActivationSite( userdata )
Parameters
userdata
see importcarto_mem
X
Cartesian co-ordinates of the latest activation site. For
map-based methods (i.e. clinmap
, clinmapprct
,
openepmap
and openepmapprct
), X is identical to
surfX.
surfX
The surface projection of the latest activation site
iPoint
The closest mapping point to the latest activation
site. For point-based methods (i.e. ptbased
or
ptbasedprct
), iPoint indexes into userdata.electric.
For map-based methods (i.e. clinmap
, clinmapprct
,
openepmap
, openepmapprct
), iPoint indexes into
userdata.surface.triRep.X. For percentile methods (i.e.
ptbasedprct
, clinmapprct
or openepmapprct
) iPoint
returns all the points that were identified within the
relevant percentile.
t
The calculated latest activation time, relative to the
reference annotation
Parameter Value Pairs
‘method’ {‘ptbased’}|‘ptbasedprct’|‘clinmap’|‘clinmapprct’|‘openepmap’|‘openmapprct’
- Specifies the method by which the latest activation is
calculated.
‘prct’ {2.5} | double
- The percentile to use for percentile mapping; only applicable if
'method'
is 'ptbasedprct'
, 'clinmapprct'
or 'openmapprct'
Description
GETLATESTACTIVATOINSITE By identifying the latest activating site,
this function can be used, for example, to calculate the total activation
time. Several alternative methods are provided for caluclating the latest
activation site, specified by setting the ‘method’ parameter-value pair
to one of the following options:
ptbased
- Calculates the latest activation time using the
mapping points exported by the clinical system.
ptbasedprct
- Calculates the 97.5-100th percentile mapping
times on the exported electrogram annotations, then
calculates the mean of this sets of activation times.
clinmap
- Calculates the latest activation time on the
local activation time map created by the clinical
mapping system
clinmapprct
- First calculates the 97.5-100th percentile
mapping times on the clinical local activation time
map, then calculates the mean of this set of
activation times.
openepmap
- Calculates the latest activation time on the local
activation time map created by OpenEP from the
exported electrogram annotations.
openepmapprct
- First calculates the 97.5-100th percentile
mapping times on the local activation time map
created by OpenEP from the exported electrogram
annotations. Then calculates the mean of this set of
activation times.
Author Steven Williams (2019) (Copyright)
getLowVoltageArea
GETLOWVOLTAGEAREA Returns the low voltage area
Usage
[lowVArea, voltages, iTri, tr2] = getLowVoltageArea( userdata, varargin )
Parameters
userdata
see importcarto_mem
lowVArea
the low voltage area (cm^2)
voltages
the voltages point values used to calculate areas
iTri
indexes into userdata.surface.triRep.Triangulation and refers
to the triangles that have voltage values within the range,
threshld
tr2
a triangulation of all the triangles referenced in iTri.
Parameter Value Pairs
‘method’ {‘map’} | ‘egm’
‘type’ {‘bip’} | ‘uni’
‘threshold’ {[0.0 0.5]} | array
Description
GETLOWVOLTAGEAREA Returns the surface area of the chamber with voltage
less than the specified threshold, 0.5mV by default. By default low
voltage area is calculated using the surface data (stored in
userdata.surface
). If method
is set to egm
then the bipolar voltage is
first interpolated from the bipolar electrogram data (stored in
userdata.electric
). If type
is set to uni
then unipolar voltages are
used for surface area calculation.
Author Steven Williams (2020) (Copyright)
getMappingPointsWithinMesh
GETMAPPINGPOINTSWITHINMESH Returns the indices of the mapping points which are located internal to the mesh
Usage
iPoint = getMappingPointsWithinMesh( userdata )
Parameters
userdata
see importcarto_mem
iPoint
logical array list of valid points; indexes into userdata.electric
Parameter Value Pairs
‘tol’ 0.1 | double
- The distance threshold within which points are considered to be
internal or external to the triangulation
‘plot’ {false}|true
- Specify whether to plot the results
Description
GETMAPPINGPOINTSWITHINMESH Returns the indices of the mapping points which are located internal to the mesh. The OpenEP function pointStatus.m is used to identify these points. The parameter value pairs are passed directly onto pointStatus.m
Author Steven Williams (2020) (Copyright)
getMappingPointsWithinWoI
GETMAPPINGPOINTSWITHINWOI Returns the indices of the mapping points with annotated local activation time within the window of interest
Usage
iPoint = getMappingPointsWithinWoI( userdata )
Parameters
userdata
see importcarto_mem
iPoint
logicla array list of valid points; indexes into userdata.electric
Description
GETMAPPINGPOINTSWITHINWOI Returns the indices of the mapping points with annotated local activation time within the window of interest
Author Steven Williams (2020) (Copyright)
getMeanVoltage
GETMEANVOLTAGE Returns the mean voltage
Usage
meanVoltage = getMeanVoltage( userdata, varargin )
Parameters
userdata
see importcarto_mem
meanVoltage
the mean chamber voltage (mV)
Parameter Value Pairs
‘method’ {‘map’} | ‘egm’
‘type’ {‘bip’} | ‘uni’
Description
GETMEANVOLTAGE Returns the mean voltage of a chamber. By default, the mean bipolar voltage is calculated using the interpolated mapping data from the clinical mapping system (stored in userdata.surface.act_bip). If ‘method’ is set to ‘egm’ then the bipolar voltage is first interpolated from the bipolar electrogram data (stored in userdata.electric). If ‘type’ is set to ‘uni’ then unipolar voltages are returned.
Author Steven Williams (2020) (Copyright)
getMesh
GETMESH Returns the triangulation-based mesh from userdata
Usage
tr = getMesh(userdata)
Parameters
tr
a TriRep, or Triangulation, object
Parameter Value Pairs
‘type’ {‘trirep’}|‘triangulation’
- Specifies whether to return the mesh as a TriRep object or as a
Triangulation object
Description
GETMESH Returns a face/vertex representation of the anatomical model. Supported data types include istances of the Matlab objects Trirep and Triangulation.
Author Steven Williams (2020) (Copyright)
getNumPts
GETNUMPTS Returns the number of mapping points in the OpenEP dataset
Usage
numpts = getNumPts( userdata )
Parameters
userdata
see importcarto_mem
numpts
the number of mapping points
Description
GETNUMPTS Returns the number of mapping points in the OpenEP datasest
Author Steven Williams (2020) (Copyright)
getPointImpedanceValue
GETPOINTIMPEDANCEVALUE Provides an algorithm for giving point impedance values
Usage
h = myfunction(b)
Parameters
a
is the output
imp
impedance values at times tim
Description
Impedance values are streaming every 100ms to Carto 3 system from the
RF Generator. A time range of -7.5s to +2.5s is output for each point and
saved in userdata.electric.impedances
(.time
and .value
) in the mat
files.
Author Steven Williams (2014) (Copyright)
getReferenceAnnotation
GETREFERENCEANNOTATION Returns the value of the reference annotation
Usage
ref = getReferenceAnnotation( userdata )
Parameters
userdata
see importcarto_mem
ref
the value of the reference annotation
Parameter Value Pairs
‘iegm’ {:} | integer | array
- The electrogram point(s) for which the reference annotation is
required
Description
GETREFERENCEANNOTATION Returns the value fo the reference annotation.
Author Steven Williams (2020) (Copyright)
getSurfaceData
GETSURFACEDATA Returns surface mapping data from userdata
Usage
data = getSurfaceData( userdata, datatype )
Parameters
userdata
see importcarto_mem
datatype
the required data. Must be one of:
‘act’, ‘bip’, ‘uni’, ‘imp’, ‘frc’
data
The returned surface mapping data
Description
GETSURFACEDATA Returns surface mapping data from userdata. Data type is
specified by the datatype
argument:
act
- activation time
bip
- bipolar voltage
uni
- unipolar voltage
imp
- impedance
frc
- contact force
Author Steven Williams (2020) (Copyright)
getTotalActivationTime
GETTOTALACTIVATIONTIME Returns the total activation time of the chamber
Usage
tat = getTotalActivationTime( userdata )
Parameters
userdata
see importcarto_mem
tat
the total activation time, in ms
Parameter Value Pairs
‘method’ {‘ptbased’} | ‘ptbasedprct’ | ‘clinmap’ | ‘clinmapprct’ | ‘openepmap’ | ‘openmapprct’
- Specifies the method by which total activation time is calculated
‘prct’ {2.5} | double
- The percentile to use for percentile mapping; only applicable if
method
is one of ptbasedprct
, clinmapprct
or openepmapprct
.
Description
GETTOTALACTIVATIONTIME Returns the total activatoin time of the chamber.
Several alternative methods are provided, and specified by setting the
‘method’ parameter-value pair to one of the following options:
ptbased
- Calculates the difference in activation time between
the earliest and latest activation time mapping
points exported by the clinical system.
ptbasedprct
- First calculates the 0-2.5th percentile and
the 97.5-100th percentile mapping times on the
exported electrogram annotations, then calculates
the difference between the means of these sets of
activation times.
clinmap
- Calculates the difference between the earliest and
latest activation times on the local activation
time map created by the clinical mapping system
clinmapprct
- First calculates the 0-2.5th percentile and
the 97.5-100th percentile mapping times on the
clinical local activation time map, then calculates
the difference between the means of these sets of
activation times.
openepmap
- Calculates the difference between the earliest and
latest activation times on the local activation
time map created by OpenEP from the exported
electrogram annotations.
openepmapprct
- First calculates the 0-2.5th percentile and
the 97.5-100th percentile mapping times on the local
activation time map created by OpenEP from the
exported electrogram annotations. Then calculates
the difference between the means of these sets of
activation times.
Author Steven Williams (2020) (Copyright)
getVertices
GETVERTICES Returns the vertices referenced by userdata
Usage
[vertices, vertsref] = getVertices( userdata )
Parameters
userdata
see importcarto_mem
vertices
all the vertices
isVertUsed
whether the vertex is referenced by the triangulation
Description
GETVERTICES Returns the vertices referenced by userdata
Author Steven Williams (2020) (Copyright)
getVolume
GETVOLUME Calculates the volume of the chamber described in userdata
Usage
volume = getVolume(userdata)
Parameters
userdata
see importcarto_mem
volume
the volume, in cm^3
Description
GETVOLUME For details of the calculation see: https://stackoverflow.com/questions/1406029/how-to-calculate-the-volume-of-a-3d-mesh-object-the-surface-of-which-is-made-up http://chenlab.ece.cornell.edu/Publication/Cha/icip01_Cha.pdf EFFICIENT FEATURE EXTRACTION FOR 2D/3D OBJECTS IN MESH REPRESENTATION
Author Steven Williams (2017) (Copyright)
getWindowOfInterest
GETWINDOWOFINTERST Returns the window of interest
Usage
woi = getWindowOfInterest( userdata )
Parameters
userdata
see importcarto_mem
woi
two-element array specifying the window of interest relative to
the reference annotation
Parameter Value Pairs
‘iEgm’ {:} | integer | array
- The electrogram point(s) for which the window of interst is required
Description
Author Steven Williams (2020) (Copyright)
getpointelectrogramname
GETPOINTELECTROGRAMNAME finds the electrode at xyz.
Usage
[ electrogramname_bip, electrogramname_uni ] = getpointelectrogramname( point_xyz, pointFileName )
Parameters
point_xyz
co-ordinates
pointFileName
filename
electrogramname_bip
the electrode name for the bipolar electrogram at point_xyz
electrogramname_uni
cell array of the electrode names for the
unipolar electrogram at point_xyz and it’s associated second electrode
that makes up electrogramname_bip
point_xyz_2
the electrode position corresponding to the second electrode
that makes up the bipole at point_xyz (needed for locating unipolar
electrograms)
Description
GETPOINTELECTROGRAMNAME Detailed description
Author Nick Linton (2012) (Copyright)
getpointelectrogramname
GETELCTRODENAME finds the electrode at xyz.
Usage
[ electrogramname_bip, electrogramname_uni ] = getelectrogramname( point_xyz, pointFileName )
Parameters
point_xyz
co-ordinates
pointFileName
filename
electrogramname_bip
the electrode name for the bipolar electrogram at point_xyz
electrogramname_uni
cell array of the electrode names for the
unipolar electrogram at point_xyz and it’s associated second electrode
that makes up electrogramname_bip
point_xyz_2
the electrode position corresponding to the second electrode
that makes up the bipole at point_xyz (needed for locating unipolar
electrograms)
Description
GETELCTRODENAME Detailed description
Author Nick Linton (2012) (Copyright)
importcarto_mem
IMPORTCARTO provides a data structure from multiple carto files (from zip).
Usage
userdata = importcarto_mem(userinput)
userdata = importcarto_mem()
[userdata, matFileFullPath] = ...
Parameters
dirName is the directory with all of the files corresponding to a map
userdata is a single data structure
matFileFullPath is the path to the .mat file, if opened or saved
Description
IMPORTCARTO can load data in 3 ways: 1) USERINPUT is a .zip file - the zip file will be unzipped into a temporary file (deleted at the end). The data is packed into userdata and the user is incouraged to save this for the future (long time take to unzip). 2) USERINPUT is a .mat file containing userdata 3) USERINPUT is a .xml file - this must be the xml file in a folder containing all the other Carto3 files.
Author Nick Linton (2011) (Copyright)
importcarto_mem
IMPORTCARTO provides a data structure from multiple carto files (from zip).
Usage
userdata = importcarto_mem(userinput)
userdata = importcarto_mem()
[userdata, matFileFullPath] = ...
Parameters
dirName is the directory with all of the files corresponding to a map
userdata is a single data structure
matFileFullPath is the path to the .mat file, if opened or saved
Parameter Value Pairs
‘maptoread’ {‘’} | string | double
Specifies which map to read. Can be a string referring
to the map name or a double referring to the number of points in the
map. If there are multiple maps with the same number of points an error
will be thrown.
‘refchannel’ {‘’} | string
The name of the channel to pick as the refence channel. Typically
this is the pacing channel for the map. Specify a string such as
‘CS9-CS10’.
‘ecgchannel’ {‘’} | string
The name of the channel to pick as the ECG channel. Typically
this is an informative ECG such as V1. Specify a string such as ‘V1’.
‘savefilename’ {‘’} | string
The full path to the location in which to save the output.
‘verbose’ {true} | false
Not yet implemented
userdata structure …
.surface
.triRep - TriRep object for the surface
.isVertexAtRim - logical array indicating vertices at a ‘rim’
.act_bip - nVertices2 array of activation and voltage data
.uni_imp_frc - nVertices3 array of uni voltage, impedance and contact force
.electric
.isPointLocationOnly - logical array
.tags
.names
.egmX - location of point
.egmSurfX - location of surface nearest point
.barDirection - normal to surface at egmSurfX
.egm - bipolar electrogram
.egmUni - matrix of unipolar electrograms
.egmUniX - location of unipolar points
.egmRefNames - names of egmRef
.egmRef - electrogram of reference
.ecgNames - ecg names (or other channel names)
.ecg - ecg
.force
.force - instantaneous force recording
.axialAngle - axial angle
.lateralAngle - lateral angle
.time_force - time course of force [(:,:,1)=time, (:,:,2)=force]
.time_axial - time course of axial angle [(:,:,1)=time, (:,:,2)=axial angle]
.time_lateral - time course of lateral angle [(:,:,1)=time, (:,:,2)=lateral angle]
Description
Author Nick Linton (2011) (Copyright)
importvisitag
IMPORTVISITAG provides a data structure from Carto visitag files.
Usage
visitag = importvisitag(userdata, dirName)
visitag = imporvisitag()
Parameters
dirName
the directory with all of the files corresponding to WiseTag
visitag
a single data structure
IMPORTVISITAG parses the data contained in a Visitag export from the
Carto3 mapping system. The data is stored in a field .rfindex
and the
new userdata data structure with the appended ablation data is returned.
Description
Author Steven Williams (2020) (Copyright)
importvisitag
IMPORTVISITAG provides a data structure from carto visitag files. Usage visitag = importvisitag(dirName) visitag = imporvisitag() Where: dirName is the directory with all of the files corresponding to WiseTag visitag is a single data structure
IMPORTVISITAG detailed description goes here.
visitag structure … .originaldata .tag .X .surfX .FTI .grid .X .surfX .FTI
Usage
Parameters
Description
Author Steven Williams (2014) (Copyright)
openEP2VTK
OPENEP2VTK Converts an OpenEP data structure to a VTK file
Usage
tr = openEP2VTK('openfile')
Parameters
tr
a TriRep object
path2VTKfile
the path to the file that was written
Parameter Value Pairs
‘datatype’ {‘bip’} | ‘uni’ | ‘lat’
- the required data, bipolar voltage, unipolar voltage or local
activation time
‘method’ {‘map’} | ‘egm’
- the method of accessing the data; clinical-system map based
(‘map’) or re-inteprolated by OpenEP from the raw egms (‘egm’);
‘outputfile’
- absolute path to the output file.
If empty then openEP2VTK outputs the VTK file to the current
directory using the current date/time as the filename
If strcmpi(‘outputfile’,’openfile’) a GUI is used to place the
file
Description
OPENEP2VTK Converts between OpenEP format and VTK format. This function takes map data and writes it to the VTK file, or if ‘method’ is set to ‘egm’ it first uses generateInterpData.m to create interpolated data.
Author Steven Williams (2020) (Copyright)
plotAblationArea
PLOTABLATIONAREA Adds the ablation area to the current figure
Usage
plotAblationArea(userdata)
Parameters
userdata
see importcarto_mem.m
Description
PLOTABLATIONAREA Requires a userdata structure which contains .rfindex
as
its input, which can be created using importvisitag.m
Author Steven Williams (2020) (Copyright)
plotElectrograms
PLOTELECTROGRAMS Draws any number of electrograms in line.
Usage
hFig = PLOTELECTROGRAMS(egmTraces)
hFig = PLOTELECTROGRAMS(egmTraces, varargin)
Parameters
egmTraces
the electrograms to plot
hFig
a handle to the plotted figure
Parameter Value Pairs
‘egmNames’
- cell array of electrogram names
‘range’
- two value vector [xmin xmax]
‘sampleRate’
- the sample rate in Hz
‘paperSpeed’
- the paper speed for plotting
‘separation’
- the separation between electrograms, default is 5mV
‘clipping’
- two value vector [clipmin clipmax] in mV
‘gain’
- the gain, default is 2
‘autogain’
- if true the electrograms are automatically scaled, default false
‘acttime’
- a vector of activation times to be plotted as red crosses
‘egmColors’
- cell array of colors. Same size as egmNames
‘linewidth’
- the width of the lines drawing the electrograms
Description
PLOTELECTROGRAMS is used to plot electrograms. To plot an A4 electrogram page: 1. Save figure as an .EPS file; 2. Open in Corel draw (or similar) and export as a .PDF file. INSTRUCTIONS FOR TIMING SINGLE BEAT TRACES The default position gives a width of 300pixels, which corresponds to an x axis width of 68.44mm. The number of samples to plot in this width (ie width of ‘range’ parameter) is given by: n = (sampleRate / paperSpeed) * 68.44 For example, at 1000Hz range should be specified as having width: 25mm/s - 2738 [-1119 1619] 100mm/s - 684 200mm/s - 342
Author Steven Williams (2012) (Copyright)
plotOpenEPEgms
PLOTOPENEPEGMS Plot eletrograms from OpenEP data
Usage
[ hFig ] = plotOpenEPEgms( userdata, varargin )
Parameters
userdata
see importcarto_mem
hFig
a handle to the plotted figure
Parameter Value Pairs
‘iEgm’ {:} | [a:b]
an array indexing into userdata.electric.egm such that
userdata.electric.egm(iEgmArray,:) are selected for plotting
To convert from Carto point numbers to iEgmArray use
getIndexFromCartoPointNumber.
‘range’ {‘window’} | ‘all’
By default (‘window’) only the electrogram within the window of
interest is drawn (+/-buffer). By specifying ‘all’ the entire point
electrogram is drawn.
‘buffer’ {50} | double
The time before and after the window of interest to draw. By
default, 20ms, but can be changed by setting ‘buffer’ to an
alternative value.
‘egmtype’ ‘bip’ | ‘uni’ | {‘bip-uni’}
Whether to plot only the bipolar electrograms, only the
unipolar electrograms or both
‘reference’ ‘off’ | {‘on’}
Whether to plot the reference channel, off by default
userdata.electric.egm(iEgmArray,:) are selected for plotting.
To convert from Carto point numbers to iEgmArray use
getIndexFromCartoPointNumber.m
‘linewidth’, {1} | integer
The width of the lines drawing the electrograms
Description
PLOTOPENEPEGMS is a wrapper function for plotElectrograms.
Author Steven Williams (2017) (Copyright)
plotTag
PLOTTAG Plots tag(s) on the current map
Usage
h = plotTag( userdata, varargin )
Parameters
userdata
see importcarto_mem
h(i)
is an array of handles referencing the plotted surfaces
Parameter Value Pairs
‘coord’ {[x y x]}
- A set of x,y,z coords where size(coords) = nx3 where n is the
number of tags to plot
‘pointnum’ [p1, p2, … pn]
- An array of size nx1 where n is the number of tags to plot
‘color’ {‘r’}|‘g’|‘b’|‘p’|‘o’|‘y’
- The color of the tag to draw
‘size’
- The size of the tag to draw
Description
PLOTTAG Plots tag(s) on the current map
Author Steven Williams (2020) (Copyright)
plotVisitags
PLOTVISITAGS Displays ablation data for a case
Usage
plotVisitags(userdata)
Parameters
userdata
see importcarto_mem.m
Parameter Value Pairs
‘plot’ {‘tags’} | ‘grid’ | ‘both’
- specifies whether to show the tags, the grid, or both
‘shell’ {‘on’} | ‘off’
- specifies whether to show the chamber shell
‘colour’ {‘r’} | colorspec | array
- can be a string or colorspec specifying the color of all the
spheres
- can be an array of double values which is rendered as a
colorscale
‘orientation’
- see drawMap.m
Description
PLOTVISITAG Requires a userdata structure which contains .rfindex as its input, which can be created using importvisitag.m
Author Steven Williams (2020) (Copyright)
pointStatus
POINTSTATUS Returns the status of points relevant to userdata
Usage
[inoutpts, meshpts] = pointStatus( userdata )
Parameters
userdata
see importcarto_mem
inoutpts
whether points are internal (logical(1)) or external
(logical(0)) to the triangulation in userdata
meshpts
whether points in the triangulation in userdata are
referenced in the triangulation (logical(1)) or not
(logical(0))
Parameter Value Pairs
‘tol’ 0.1 | double
- The distance threshold within which points are considered to be
internal or external to the triangulation
‘plot’ {false}|true
- Specify whether to plot the results
Description
POINTSTATUS depends on the package INPOLYHEDRON. See: https://uk.mathworks.com/matlabcentral/fileexchange/37856-inpolyhedron-are-points-inside-a-triangulated-volume
Author Steven Williams (2020) (Copyright)
processSmartTouchForceData
PROCESSSMARTTOUCHFORCEDATA Gets a shell with force data
Usage
[tr f] = processSmartTouchForceData(userdata)
Parameters
userdata
is a Carto dataset
f
are the 1000ms window forces
loc
are the coordinates of the data in f (size: length(f) * 3)
Description
PROCESSSMARTTOUCHFORCEDATA parses the force data at ablation points from userdata.
Author Steven Williams (2013) (Copyright)
read_ecgfile_v4
READ_ECGFILE loads this Carto3 ecg file.
Usage
channelNames = read_ecgfile(filename);
[channelNames channelVoltages] = read_ecgfile(filename)
channelVoltages = read_ecgfile(filename, names)
Parameters
channelVoltages
voltages
channelNames
names
filename
the Carto3 .txt file
names
is optional and is the desired channel names which helps speed
Description
Author Nick Linton (2013) (Copyright)
read_ecgfile_v4_header
READ_ECGFILE_V4_HEADER loads the header from an ECG file.
Usage
[electrodename_bip] = read_ecgfile_v4_header(varargin)
[electrodename_bip electrodename_uni] = read_ecgfile_v4_header(varargin)
[electrodename_bip electrodename_uni electrodename_ref] = read_ecgfile_v4_header(varargin)
Parameters
electrodename_bip is the name of the electrode pair collecting the bipolar mapping point
electrodename_uni is the name of the electrode collecting the unipolar mapping point
electrodename_ref is the name of the reference electrode for the mapping point
Description
Author Steven Williams (2020) (Copyright)
read_forcefile_v2
READ_FORCEFILE loads this Carto3 force file.
Usage
force = read_forcefile(filename);
[force axialAngle lateralAngle] = read_forcefile(filename)
[force axialAngle lateralAngle t_time t_force t_axialAngle t_lateralAngle] = read_forcefile(filename)
Parameters
force
is the fixed time point force for this point
axialAngle
is the fixed time point axial angle for this point
lateralAngle
is the fixed time point lateral angle for this point
t_time
is the time array (e.g. -7000ms->5000ms) for the time data
t_force
is the time course of force
t_axialAngle
is the time course of the axial angle
t_lateralAngle
is the time course of the lateral angle
Description
filename is the Carto3.txt file
Author Steven Williams (2013) (Copyright)
read_meshfile
READ_MESHFILE loads this Carto3 mesh file.
Usage
t = read_meshfile(filename)
[t isVertexAtEdge] = read_meshfile(filename)
[t isVertexAtEdge act_bip normals] = read_meshfile(filename)
Parameters
filename is the filename
t is a TriRep object
isVertexAtEdge is a logical array indicating vertices at an edge
act_bip is a matrix of activation times and bipolar voltage by vertex
Description
READ_MESHFILE reads the triangulation from a TriangulatedMeshVersion 2.0 file.
Author Nick Linton (2011) (Copyright)
read_positions_on_annotation_v2
READ_POSITIONS_ON_ANNOTATION_V2 loads this Carto3 position file.
Usage
[iElectrode xyz] = read_positions_on_annotation_v2(filename)
Parameters
iElectrode is a vector of electrode numbers
xyz is an array of xyz positions
Description
Author Nick Linton (2013) (Copyright)
read_visitag_file_v1
READ_VISITAG_FILE_V1 Reads a data file stored in a WiseTag or VisiTag directory
Usage
[ data, header ] = read_visitag_file_v1( filepath )
Parameters
filepath
path to the file to be read
data
the the file data
header
the file header
Description
READ_VISITAG_FILE_V1 Reads numeric data from data files stored in WiseTag or VisiTag directories. These files all have a standard format - header line followed by data lines; tab delimited. The headers are returned in a cell array to allow search/indexing.
Author Steven Williams (2020) (Copyright)
read_visitag_sites
READ_VISITAG_SITES loads Carto3 visitag sites.txt file.
Usage
[sites] = read_visitag_sites(filename)
Parameters
data is a matrix of all the data from the file
labels is a cell array of the header lines from the file
filename is the full file path
Description
READ_VISITAG_SITES detailed description goes here
Author Steven Williams (2015) (Copyright)
read_visitagsettings
READ_VISITAGSETTINGS loads Carto3 visitag settings file.
Usage
[visitagSettings] = read_visitagsettings(filename)
Parameters
visitagSettings is a structure of the visitag settings
filename is the full file path
Description
READ_VISITAGSETTINGS creates a structure with the parameters in VisiTagSettings.txt. Data is converted to double if it is numeric or remains as a string if it is a string. Beware of equals sign at the end of the parameter names - these are currently removed by the code but would be an obvious source of future errors.
Author Steven Williams (2015) (Copyright)
voltageHistogramAnalysis
VOLTAGEHISTOGRAMANALYSIS Performs voltage histogram analysis
Usage
areas = voltageHistogramAnalysis( userdata, varargin )
Parameters
userdata
see importcarto_mem
areas
he chamber areas within each of the voltage thresholds
Parameter Value Pairs
‘method’ {‘map’}|‘egm’
‘type’ {‘bip’}|‘uni’
‘threshold’ n x 2 matrix of threshold values, default:
[ 0.01 0.11; 0.11 0.21; 0.21 0.30; 0.30 0.40; 0.40 0.50 ]
‘plot’ {false} | true
‘colors’ {colorBrewer colors r, y, g, b, p}|
Description
VOLTAGEHISTOGRAMANALYSIS displays a histogram of voltages coloured according to voltages, threshold. If ‘method’ is set to ‘egm’ then the bipolar voltage is first interpolated from the bipolar electrogram data (stored in userdata.electric). If ‘type’ is set to ‘uni’ then unipolar voltages are used.
Author Steven Williams (2020) (Copyright)