52 std::string iPassword,
int iImagingSessionID,
53 std::string iFilename,
int iCurrentTimePoint)
60 this->
m_InFile.open(iFilename.c_str(), std::ifstream::in);
78 std::string LineContent;
81 MapSubCellTypeIDs, MapCoordIDs);
100 std::string LineContent;
103 MapSubCellTypeIDs, MapCoordIDs);
105 MapSubCellTypeIDs,
true);
126 std::string LineContent;
128 getline(this->
m_InFile, LineContent);
131 getline (this->
m_InFile, LineContent);
133 while ( this->
FindFieldName(LineContent) !=
"NumberOflineage" )
136 getline(this->
m_InFile, LineContent);
139 if ( EntitiesNumber != 0 )
143 std::cout <<
"There was supposed to be only the name of the entity to save,the entity will not be saved";
144 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
145 std::cout << std::endl;
149 if ( NameEntity ==
"color" )
151 LineContent = this->SaveImportedEntitiesInDatabase< GoDBColorRow >(
152 EntitiesNumber, ioMapColorIDs);
154 if ( NameEntity ==
"celltype" )
156 LineContent = this->SaveImportedEntitiesInDatabase< GoDBCellTypeRow >(
157 EntitiesNumber, ioMapCellTypeIDs);
159 if ( NameEntity ==
"subcellulartype" )
161 LineContent = this->SaveImportedEntitiesInDatabase< GoDBSubCellTypeRow >(
162 EntitiesNumber, ioMapSubCellTypeIDs);
164 if ( NameEntity ==
"coordinate" )
166 LineContent = this->SaveImportedEntitiesInDatabase< GoDBCoordinateRow >(
167 EntitiesNumber, ioMapCoordIDs);
169 if ( NameEntity !=
"color" && NameEntity !=
"celltype"
170 && NameEntity !=
"subcellulartype" && NameEntity !=
"coordinate" )
172 std::cout <<
"The name of the entity doesn't correspond to any of the no traces entity";
173 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
174 std::cout << std::endl;
186 const std::string & iLineContent,
189 bool SaveIntensities)
196 std::string LineContent = iLineContent;
202 this->SaveTraces< GoDBLineageRow >(iMapColorIDs, iMapCoordIDs,
203 MapLineageIDs, LineContent,
205 MapIDsSpecificOne, MapIDsSpecificTwo );
212 this->SaveTraces< GoDBTrackRow >(iMapColorIDs, iMapCoordIDs, MapLineageIDs,
214 MapIDsSpecificOne, MapIDsSpecificTwo );
219 this->SaveTraces< GoDBMeshRow >(iMapColorIDs, iMapCoordIDs, MapTrackIDs,
220 LineContent, this->
m_NewMeshIDs, MapMeshIDs, iMapCellTypeIDs,
224 if ( SaveIntensities )
233 this->SaveTraces< GoDBContourRow >(iMapColorIDs, iMapCoordIDs, MapMeshIDs,
235 MapIDsSpecificOne, MapIDsSpecificTwo );
244 size_t BegName = iLine.find(
"<", 0) + 1;
245 size_t EndName = iLine.find(
">", 0);
246 size_t NameLength = EndName - BegName;
247 std::string oName = iLine.substr(BegName, NameLength);
249 if ( oName.find(
"/", 0) == 0 )
251 oName = oName.substr(1);
261 size_t BegValue = iLine.find(
">", 0) + 1;
262 size_t EndValue = iLine.find(
"<", BegValue);
264 if ( EndValue != iLine.npos )
266 size_t ValueLength = EndValue - BegValue;
267 return iLine.substr(BegValue, ValueLength);
269 return "NoValueOnTheLine";
277 size_t BegValue = iLine.find(
"NumberOf", 0);
279 if ( BegValue != iLine.npos )
311 while ( this->
FindFieldName(ioLineContent) !=
"NumberOfchannel" )
313 getline (this->
m_InFile, ioLineContent);
317 getline(this->
m_InFile, ioLineContent);
318 if ( EntitiesNumber != 0 )
320 while ( this->
FindFieldName(ioLineContent) !=
"NumberOfintensity" )
324 std::cout <<
"There was supposed to be only the name of the entity to save,the entity will not be saved";
325 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
326 std::cout << std::endl;
329 if ( NameEntity !=
"channel" )
331 std::cout <<
"The name of the entity should be channel but is actually different";
332 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
333 std::cout << std::endl;
338 ioLineContent = this->GetValuesFromInfile< GoDBChannelRow >(NewChannel);
339 this->ReplaceTheFieldWithNewIDs< GoDBChannelRow >(
340 iMapColorIDs,
"ColorID", NewChannel);
341 int OldID = NewChannel.
GetMapValue<
int>(
"ChannelID");
342 NewChannel.
SetField(
"ChannelID",
"0");
349 getline(this->
m_InFile, ioLineContent);
350 if ( EntitiesNumber != 0 )
352 while ( this->
FindFieldName(ioLineContent) !=
"ExportTraces" )
356 std::cout <<
"There was supposed to be only the name of the entity to save,the entity will not be saved";
357 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
358 std::cout << std::endl;
361 if ( NameEntity !=
"intensity" )
363 std::cout <<
"The name of the entity should be channel but is actually different";
364 std::cout <<
"Debug: In " << __FILE__ <<
", line " << __LINE__;
365 std::cout << std::endl;
370 ioLineContent = this->GetValuesFromInfile< GoDBIntensityRow >(NewIntensity);
371 this->ReplaceTheFieldWithNewIDs< GoDBIntensityRow >(
372 iMapMeshIDs,
"meshID", NewIntensity);
373 this->ReplaceTheFieldWithNewIDs< GoDBIntensityRow >(
374 MapChannelIDs,
"ChannelID", NewIntensity);
375 NewIntensity.
SetField(
"IntensityID",
"0");