52 std::string iPassword,
int iImagingSessionID, std::string iFilename)
58 this->
m_outfile.open (iFilename.c_str(), std::ios::out);
114 int VersionNumber = 1;
115 this->
m_outfile <<
"<?xml version=\"1.0\" ?>" << std::endl;
126 std::vector< std::pair< std::string, std::string > >
129 std::vector< std::pair< std::string, std::string > > infoImgSession;
134 return infoImgSession;
141 std::string iNameInfo)
143 std::pair< std::string, std::string > OneInfo;
144 OneInfo.first = iNameInfo;
187 std::vector< FieldWithValue > Conditions(2);
191 Conditions[0] = ImgSession;
192 Conditions[1] = Points;
194 "mesh",
"meshID", Conditions);
263 std::vector< std::string > TablesNames;
264 std::vector< std::string > FieldNames;
265 std::vector< std::vector< std::string > > VectorTracesIDs;
267 TablesNames, VectorTracesIDs, FieldNames,
true);
268 std::vector< std::string > ListColorIDs = std::vector< std::string >();
269 if ( !VectorTracesIDs.empty() )
271 std::vector< std::string > ColumnNames(1);
272 ColumnNames[0] =
"ColorID";
276 this->WriteTableInfoFromDB< GoDBColorRow >(ListColorIDs);
284 std::vector< std::string > ListCellTypeIDs = std::vector< std::string >();
285 std::vector< std::string > ListSubCellTypeIDs = std::vector< std::string >();
296 this->WriteTableInfoFromDB< GoDBCellTypeRow >(ListCellTypeIDs);
297 this->WriteTableInfoFromDB< GoDBSubCellTypeRow >(ListSubCellTypeIDs);
305 std::vector< std::string > TablesNames;
306 std::vector< std::string > FieldNames;
307 std::vector< std::vector< std::string > > VectorTracesIDs;
309 VectorTracesIDs, FieldNames);
310 std::vector< std::string > ColumnNames(2);
311 ColumnNames[0] =
"CoordIDMax";
312 ColumnNames[1] =
"CoordIDMin";
313 std::vector< std::string > ListCoordIDs = std::vector< std::string >();
314 if ( !VectorTracesIDs.empty() )
320 this->WriteTableInfoFromDB< GoDBCoordinateRow >(ListCoordIDs);
360 std::vector< std::string > VectorIntensityIDs = std::vector< std::string >();
368 this->WriteTableInfoFromDB< GoDBIntensityRow >(VectorIntensityIDs);
383 std::vector< std::pair< std::string, std::string > > iInfoToWrite)
387 std::vector< std::pair< std::string, std::string > >::iterator iter =
388 iInfoToWrite.begin();
389 while ( iter != iInfoToWrite.end() )
408 std::string NameToWrite =
"NumberOf";
409 NameToWrite += iNameOfEntity;
420 std::stringstream NameWithBrackets;
422 NameWithBrackets <<
"<";
423 NameWithBrackets << iName;
424 NameWithBrackets <<
">";
425 return NameWithBrackets.str();
433 std::stringstream NameWithBrackets;
435 NameWithBrackets <<
"</";
436 NameWithBrackets << iName;
437 NameWithBrackets <<
">";
438 return NameWithBrackets.str();
470 std::vector< std::string > & ioVectorTableNames,
471 std::vector< std::vector< std::string > > & ioVectorTracesIDs,
472 std::vector< std::string > & ioVectorFields,
bool IncludeChannelIDs)
476 ioVectorTableNames.push_back(
"contour");
477 ioVectorFields.push_back(
"contourID");
482 ioVectorTableNames.push_back(
"mesh");
483 ioVectorFields.push_back(
"meshID");
488 ioVectorTableNames.push_back(
"track");
489 ioVectorFields.push_back(
"trackID");
494 ioVectorTableNames.push_back(
"lineage");
495 ioVectorFields.push_back(
"lineageID");
498 if ( IncludeChannelIDs )
502 ioVectorTableNames.push_back(
"channel");
503 ioVectorFields.push_back(
"ChannelID");
void WriteOnTheOutputFile(std::string iNameOfEntity, std::vector< std::pair< std::string, std::string > > iInfoToWrite)
write on the output file the info contained in the vector with the name of the entity they describe ...
std::string GetNameWithBrackets(std::string iName)
put iName within brackets
std::vector< std::string > m_VectorLineageIDs
void UpdateVectorTrackIDsToExportInfo()
check if for the meshes IDs found in the m_VectorMeshIDs, the corresponding meshes belongs to tracks...
void UpdateVectorContourIDsForExportContours()
get the IDs of the contour belonging to the current imagingsession and fill the m_VectorContourIDs wi...
void UpdateAllVectorTracesIDsToExportContours()
fill the different vectors of traces IDs corresponding to the contours to export
void GetVectorsTableNamesTracesIDsAndFields(std::vector< std::string > &ioVectorTableNames, std::vector< std::vector< std::string > > &ioVectorTracesIDs, std::vector< std::string > &ioVectorFields, bool IncludeChannelIDs=false)
fill the different vectors needed for the queries depending if the vectors of IDs are empty or not: g...
void WriteIntensityInfoFromDatabase()
get the info for the intensities corresponding to the m_VectorMeshIDs and the m_VectorChannelIDs and ...
void WriteContoursInfoFromDatabase()
get the contours info which IDs are in the m_VectorContourIDs from the database and write them on the...
bool CloseDatabaseConnection(vtkMySQLDatabase *DatabaseConnector)
return true if the connection has been closed, false if the connection was already closed ...
std::vector< std::pair< std::string, std::string > > GetImagingSessionInfoFromDB()
get the info for imagingsession from the database
void UpdateVectorChannelIDsForExportMeshes()
when exporting meshes, the total intensity per channel has to be calculated, and the info for the cha...
void OpenDBConnection()
open a connection to the database.
vtkMySQLDatabase * OpenDatabaseConnection(std::string ServerName, std::string login, std::string Password, std::string DBName)
void WriteChannelsInfoFromDatabase()
get the channels info which IDs are in the m_VectorChannelIDs from the database and write them on the...
void WriteCellTypeAndSubCellTypeInfoFromDatabase()
Get the celltype and subcelltype for the needed meshes from the database and write them on the output...
std::string GetNameWithSlashBrackets(std::string iName)
put iName into slash brackets
void UpdateVectorLineageIDsToExportInfo()
check if for the tracks IDs found in the m_VectorTrackIDs, the corresponding tracks belongs to lineag...
void UpdateVectorContourIDsForExportMeshes()
when exporting meshes, we don't export the potential contours associated to the meshes, so we clear m_VectorContourIDs
std::vector< std::string > m_VectorMeshIDs
void WriteCoordinatesInfoFromDatabase()
get the coordinates without doublon corresponding to the coordidmax and min of the traces to export f...
void ExportMeshes()
get all the imagingsession info,the info for the meshes with points(that can be visualized), the tracks they belong to and the lineages the previous tracks belong to from the database and put them in a text file
std::vector< std::string > m_VectorContourIDs
void CloseDBConnection()
close and delete the connection to the database.
std::vector< std::string > ListSpecificValuesForOneColumn(vtkMySQLDatabase *iDatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::string &field, const std::string &value, bool ExcludeZero)
SELECT ColumnName FROM TableName WHERE field = value and ColumnName <> 0 (if excludezero) ...
void AddTabulation()
add 2 spaces to the output file for xml tabulation
std::vector< std::string > GetSameFieldsFromSeveralTables(vtkMySQLDatabase *DatabaseConnector, const std::vector< std::string > &iColumnNames, const std::vector< std::string > &iVectorTablesNames, const std::vector< std::string > &iVectorConditionFieldNames, const std::vector< std::vector< std::string > > &iVectorConditionsValues)
std::vector< std::string > FindSeveralIDs(vtkMySQLDatabase *iDatabaseConnector, const std::string &TableName, const std::string &ColumnName, const std::vector< FieldWithValue > &iConditions)
"SELECT ColumnName FROM TableName WHERE (field1 = value1 AND field2 = value2...); ...
void ExportContours()
get all the imagingsession info,the info for the contours, the meshes they belong to and the tracks t...
void WriteGeneraleInfo()
Write the generale info about the textfile.
void WriteLineagesInfoFromDatabase()
get the lineages info which IDs are in the m_VectorLineageIDs from the database and write them on the...
vtkMySQLDatabase * m_DatabaseConnector
void UpdateAllVectorTracesIDsToExportMeshes()
fill the different vectors of traces IDs corresponding to the meshes to export
std::vector< std::string > m_VectorTrackIDs
std::vector< std::string > GetSpecificValueFromOneTableWithConditionsOnTwoColumns(vtkMySQLDatabase *DatabaseConnector, const std::string &iColumnName, const std::string &iTableName, const std::string &iFieldOne, const std::vector< std::string > &iVectorConditionFieldOne, const std::string &iFieldTwo, const std::vector< std::string > &iVectorConditionFieldTwo)
std::vector< std::string > m_VectorChannelIDs
void UpdateVectorMeshIDsForExportContours()
when exporting contours, if the contours belong to meshes, the info regarding these meshes are needed...
void WriteNumberOfEntities(std::string iNameOfEntity, size_t iNumber)
write on the output file the number of entities that are exported
std::pair< std::string, std::string > GetOneInfoFromDBForImgSession(std::string iNameInfo)
get one info for the current imagingsession from the database corresponding to the iNameInfo ...
void UpdateVectorMeshIDsForExportMeshes()
when exporting meshes, we export only the meshes with a 3D surface so we fill the m_VectorMeshIDs wit...
void WriteTheColorsInfoFromDatabase()
get the colors info from the database for the corresponding traces to export and write them in the ou...
void WriteMeshesInfoFromDatabase()
get the meshes info which IDs are in the m_VectorMeshIDs from the database and write them on the outp...
GoDBExport(std::string iServerName, std::string iLogin, std::string iPassword, int iImagingSessionID, std::string iFilename)
void WriteTracksInfoFromDatabase()
get the tracks info which IDs are in the m_VectorTrackIDs from the database and write them on the out...