45 if (hemi == 0 || hemi == 1) {
48 }
else if (hemi == 2) {
63 if (hemi == 0 || hemi == 1) {
66 }
else if (hemi == 2) {
80 if (p_LHSurface.
hemi() == 0)
81 m_qMapSurfs.insert(0, p_LHSurface);
83 qWarning(
"Left hemisphere id is not 0. LH surface not assigned!");
85 if (p_RHSurface.
hemi() == 1)
86 m_qMapSurfs.insert(1, p_RHSurface);
88 qWarning(
"Right hemisphere id is not 1. RH surface not assigned!");
122 qint32 hemi = p_Surface.
hemi();
123 m_qMapSurfs.remove(hemi);
125 m_qMapSurfs.insert(hemi, p_Surface);
132 p_SurfaceSet.
clear();
134 QStringList t_qListFileName;
135 t_qListFileName << p_sLHFileName << p_sRHFileName;
137 for (qint32 i = 0; i < t_qListFileName.size(); ++i) {
140 if (t_qListFileName[i].contains(
"lh."))
141 p_SurfaceSet.m_qMapSurfs.insert(0, t_Surface);
142 else if (t_qListFileName[i].contains(
"rh."))
143 p_SurfaceSet.m_qMapSurfs.insert(1, t_Surface);
149 if (p_SurfaceSet.m_qMapSurfs.isEmpty())
152 p_SurfaceSet.calcOffset();
162 return m_qMapSurfs.find(idx).value();
164 return m_qMapSurfs.find(idx).value();
166 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
167 return m_qMapSurfs.find(0).value();
176 return m_qMapSurfs.find(idx).value();
178 return m_qMapSurfs.find(idx).value();
180 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
181 return m_qMapSurfs.find(0).value();
189 if (idt.compare(
"lh") == 0)
190 return m_qMapSurfs.find(0).value();
191 else if (idt.compare(
"rh") == 0)
192 return m_qMapSurfs.find(1).value();
194 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
195 return m_qMapSurfs.find(0).value();
203 if (idt.compare(
"lh") == 0)
204 return m_qMapSurfs.find(0).value();
205 else if (idt.compare(
"rh") == 0)
206 return m_qMapSurfs.find(1).value();
208 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
209 return m_qMapSurfs.find(0).value();
215void FsSurfaceSet::calcOffset()
220 if (m_qMapSurfs.size() == 2 && QString::compare(m_qMapSurfs.begin().value().surf(),
"inflated") == 0) {
221 float xOffset = m_qMapSurfs.find(0).value().rr().col(0).maxCoeff() - m_qMapSurfs.find(1).value().rr().col(0).minCoeff();
222 Vector3f vecLhOffset, vecRhOffset;
223 vecLhOffset << (xOffset / 2.0f), 0, 0;
224 vecRhOffset << (-xOffset / 2.0f), 0, 0;
225 m_qMapSurfs.find(0).value().offset() = vecLhOffset;
226 m_qMapSurfs.find(1).value().offset() = vecRhOffset;
Bi-hemispheric grouping of FreeSurfer surfaces (lh + rh) loaded as a single object.
FreeSurfer surface, annotation and parcellation I/O for mne-cpp.
In-memory FreeSurfer triangular cortical surface for one hemisphere.
static bool read(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir, FsSurface &p_Surface, bool p_bLoadCurvature=true)
const FsSurface & operator[](qint32 idx) const
static bool read(const QString &p_sLHFileName, const QString &p_sRHFileName, FsSurfaceSet &p_SurfaceSet)
void insert(const FsSurface &p_Surface)