45 if(hemi == 0 || hemi == 1)
66 if(hemi == 0 || hemi == 1)
86 if(p_LHSurface.
hemi() == 0)
87 m_qMapSurfs.insert(0, p_LHSurface);
89 qWarning(
"Left hemisphere id is not 0. LH surface not assigned!");
91 if(p_RHSurface.
hemi() == 1)
92 m_qMapSurfs.insert(1, p_RHSurface);
94 qWarning(
"Right hemisphere id is not 1. RH surface not assigned!");
105 *
this = t_SurfaceSet;
128 qint32 hemi = p_Surface.
hemi();
129 m_qMapSurfs.remove(hemi);
131 m_qMapSurfs.insert(hemi, p_Surface);
138 p_SurfaceSet.
clear();
140 QStringList t_qListFileName;
141 t_qListFileName << p_sLHFileName << p_sRHFileName;
143 for(qint32 i = 0; i < t_qListFileName.size(); ++i)
148 if(t_qListFileName[i].contains(
"lh."))
149 p_SurfaceSet.m_qMapSurfs.insert(0, t_Surface);
150 else if(t_qListFileName[i].contains(
"rh."))
151 p_SurfaceSet.m_qMapSurfs.insert(1, t_Surface);
157 if(p_SurfaceSet.m_qMapSurfs.isEmpty())
160 p_SurfaceSet.calcOffset();
170 return m_qMapSurfs.find(idx).value();
172 return m_qMapSurfs.find(idx).value();
175 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
176 return m_qMapSurfs.find(0).value();
185 return m_qMapSurfs.find(idx).value();
187 return m_qMapSurfs.find(idx).value();
190 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
191 return m_qMapSurfs.find(0).value();
199 if(idt.compare(
"lh") == 0)
200 return m_qMapSurfs.find(0).value();
201 else if(idt.compare(
"rh") == 0)
202 return m_qMapSurfs.find(1).value();
205 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
206 return m_qMapSurfs.find(0).value();
214 if(idt.compare(
"lh") == 0)
215 return m_qMapSurfs.find(0).value();
216 else if(idt.compare(
"rh") == 0)
217 return m_qMapSurfs.find(1).value();
220 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
221 return m_qMapSurfs.find(0).value();
227void FsSurfaceSet::calcOffset()
232 if(m_qMapSurfs.size() == 2 && QString::compare(m_qMapSurfs.begin().value().surf(),
"inflated") == 0)
234 float xOffset = m_qMapSurfs.find(0).value().rr().col(0).maxCoeff() - m_qMapSurfs.find(1).value().rr().col(0).minCoeff();
235 Vector3f vecLhOffset, vecRhOffset;
236 vecLhOffset << (xOffset/2.0f), 0, 0;
237 vecRhOffset << (-xOffset/2.0f), 0, 0;
238 m_qMapSurfs.find(0).value().offset() = vecLhOffset;
239 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)