47 #include <QStringList>
53 using namespace FSLIB;
54 using namespace Eigen;
69 if(hemi == 0 || hemi == 1)
71 if(
Surface::read(subject_id, hemi, surf, subjects_dir, t_Surface))
76 if(
Surface::read(subject_id, 0, surf, subjects_dir, t_Surface))
78 if(
Surface::read(subject_id, 1, surf, subjects_dir, t_Surface))
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 p_SurfaceSet.calcOffset();
191 return m_qMapSurfs.find(idx).value();
193 return m_qMapSurfs.find(idx).value();
196 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
197 return m_qMapSurfs.find(0).value();
206 return m_qMapSurfs.find(idx).value();
208 return m_qMapSurfs.find(idx).value();
211 qWarning(
"Warning: Index is not '0' or '1'! Returning '0'.");
212 return m_qMapSurfs.find(0).value();
220 if(idt.compare(
"lh") == 0)
221 return m_qMapSurfs.find(0).value();
222 else if(idt.compare(
"rh") == 0)
223 return m_qMapSurfs.find(1).value();
226 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
227 return m_qMapSurfs.find(0).value();
235 if(idt.compare(
"lh") == 0)
236 return m_qMapSurfs.find(0).value();
237 else if(idt.compare(
"rh") == 0)
238 return m_qMapSurfs.find(1).value();
241 qWarning(
"Warning: Identifier is not 'lh' or 'rh'! Returning 'lh'.");
242 return m_qMapSurfs.find(0).value();
248 void SurfaceSet::calcOffset()
253 if(m_qMapSurfs.size() == 2 && QString::compare(m_qMapSurfs.begin().value().surf(),
"inflated") == 0)
255 float xOffset = m_qMapSurfs.find(0).value().rr().col(0).maxCoeff() - m_qMapSurfs.find(1).value().rr().col(0).minCoeff();
256 Vector3f vecLhOffset, vecRhOffset;
257 vecLhOffset << (xOffset/2.0f), 0, 0;
258 vecRhOffset << (-xOffset/2.0f), 0, 0;
259 m_qMapSurfs.find(0).value().offset() = vecLhOffset;
260 m_qMapSurfs.find(1).value().offset() = vecRhOffset;