69 if(hemi == 0 || hemi == 1)
90 if(hemi == 0 || hemi == 1)
110 if(p_LHSurface.
hemi() == 0)
111 m_qMapSurfs.insert(0, p_LHSurface);
113 qWarning(
"Left hemisphere id is not 0. LH surface not assigned!");
115 if(p_RHSurface.
hemi() == 1)
116 m_qMapSurfs.insert(1, p_RHSurface);
118 qWarning(
"Right hemisphere id is not 1. RH surface not assigned!");
129 *
this = t_SurfaceSet;
152 qint32 hemi = p_Surface.
hemi();
153 m_qMapSurfs.remove(hemi);
155 m_qMapSurfs.insert(hemi, p_Surface);
162 p_SurfaceSet.
clear();
164 QStringList t_qListFileName;
165 t_qListFileName << p_sLHFileName << p_sRHFileName;
167 for(qint32 i = 0; i < t_qListFileName.size(); ++i)
172 if(t_qListFileName[i].contains(
"lh."))
173 p_SurfaceSet.m_qMapSurfs.insert(0, t_Surface);
174 else if(t_qListFileName[i].contains(
"rh."))
175 p_SurfaceSet.m_qMapSurfs.insert(1, t_Surface);
181 if(p_SurfaceSet.m_qMapSurfs.isEmpty())
184 p_SurfaceSet.calcOffset();
194 return m_qMapSurfs.find(idx).value();
196 return m_qMapSurfs.find(idx).value();
199 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
200 return m_qMapSurfs.find(0).value();
209 return m_qMapSurfs.find(idx).value();
211 return m_qMapSurfs.find(idx).value();
214 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
215 return m_qMapSurfs.find(0).value();
223 if(idt.compare(
"lh") == 0)
224 return m_qMapSurfs.find(0).value();
225 else if(idt.compare(
"rh") == 0)
226 return m_qMapSurfs.find(1).value();
229 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
230 return m_qMapSurfs.find(0).value();
238 if(idt.compare(
"lh") == 0)
239 return m_qMapSurfs.find(0).value();
240 else if(idt.compare(
"rh") == 0)
241 return m_qMapSurfs.find(1).value();
244 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
245 return m_qMapSurfs.find(0).value();
251void SurfaceSet::calcOffset()
256 if(m_qMapSurfs.size() == 2 && QString::compare(m_qMapSurfs.begin().value().surf(),
"inflated") == 0)
258 float xOffset = m_qMapSurfs.find(0).value().rr().col(0).maxCoeff() - m_qMapSurfs.find(1).value().rr().col(0).minCoeff();
259 Vector3f vecLhOffset, vecRhOffset;
260 vecLhOffset << (xOffset/2.0f), 0, 0;
261 vecRhOffset << (-xOffset/2.0f), 0, 0;
262 m_qMapSurfs.find(0).value().offset() = vecLhOffset;
263 m_qMapSurfs.find(1).value().offset() = vecRhOffset;
SurfaceSet class declaration.
FreeSurfer surface and annotation I/O.
static bool read(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir, Surface &p_Surface, bool p_bLoadCurvature=true)
void insert(const Surface &p_Surface)
const Surface & operator[](qint32 idx) const
static bool read(const QString &p_sLHFileName, const QString &p_sRHFileName, SurfaceSet &p_SurfaceSet)