GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GoDBExport Class Reference

export the data from the database into a textfile More...

#include <Code/IO/GoDBExport.h>

Public Member Functions

void ExportContours ()
 get all the imagingsession info,the info for the contours, the meshes they belong to and the tracks the previous meshes belong to from the database and put them in a text file More...
 
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 More...
 
 GoDBExport (const std::string &iServerName, const std::string &iLogin, const std::string &iPassword, int iImagingSessionID, const std::string &iFilename)
 
virtual ~GoDBExport ()
 

Private Member Functions

void AddTabulation ()
 add 2 spaces to the output file for xml tabulation More...
 
void CloseDBConnection ()
 close and delete the connection to the database. More...
 
std::vector< std::pair
< std::string, std::string > > 
GetImagingSessionInfoFromDB ()
 get the info for imagingsession from the database More...
 
std::string GetNameWithBrackets (const std::string &iName)
 put iName within brackets More...
 
std::string GetNameWithSlashBrackets (const std::string &iName)
 put iName into slash brackets More...
 
template<typename T >
std::vector< std::pair
< std::string, std::string > > 
GetOneEntityInfoFromDB (const std::string &iEntityID, T iTableRow)
 get the info with their names for an entity from the database and put them in a vector of pair of string (name of the info + value of the info) More...
 
std::pair< std::string,
std::string > 
GetOneInfoFromDBForImgSession (const std::string &iNameInfo)
 get one info for the current imagingsession from the database corresponding to the iNameInfo More...
 
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: get the tables names, the key for the table and the tracesIDs More...
 
void OpenDBConnection ()
 open a connection to the database. More...
 
void UpdateAllVectorTracesIDsToExportContours ()
 fill the different vectors of traces IDs corresponding to the contours to export More...
 
void UpdateAllVectorTracesIDsToExportMeshes ()
 fill the different vectors of traces IDs corresponding to the meshes to export More...
 
void UpdateVectorChannelIDsForExportMeshes ()
 when exporting meshes, the total intensity per channel has to be calculated, and the info for the channels need to be stored More...
 
void UpdateVectorContourIDsForExportContours ()
 get the IDs of the contour belonging to the current imagingsession and fill the m_VectorContourIDs with them More...
 
void UpdateVectorContourIDsForExportMeshes ()
 when exporting meshes, we don't export the potential contours associated to the meshes, so we clear m_VectorContourIDs More...
 
void UpdateVectorLineageIDsToExportInfo ()
 check if for the tracks IDs found in the m_VectorTrackIDs, the corresponding tracks belongs to lineages, if so these lineages IDs are put in the m_VectorLineageIDs More...
 
void UpdateVectorMeshIDsForExportContours ()
 when exporting contours, if the contours belong to meshes, the info regarding these meshes are needed also, so fill m_VectorMeshIDs with these meshes IDs More...
 
void UpdateVectorMeshIDsForExportMeshes ()
 when exporting meshes, we export only the meshes with a 3D surface so we fill the m_VectorMeshIDs with the meshes with a non empty "Points" column from the database More...
 
void UpdateVectorTrackFamilyIDsToExportInfo ()
 
void UpdateVectorTrackIDsToExportInfo ()
 check if for the meshes IDs found in the m_VectorMeshIDs, the corresponding meshes belongs to tracks, if so these tracks IDs are put in the m_VectorTrackIDs More...
 
void WriteCellTypeAndSubCellTypeInfoFromDatabase ()
 Get the celltype and subcelltype for the needed meshes from the database and write them on the output file. More...
 
void WriteChannelsInfoFromDatabase ()
 get the channels info which IDs are in the m_VectorChannelIDs from the database and write them on the output file More...
 
void WriteContoursInfoFromDatabase ()
 get the contours info which IDs are in the m_VectorContourIDs from the database and write them on the output file More...
 
void WriteCoordinatesInfoFromDatabase ()
 get the coordinates without doublon corresponding to the coordidmax and min of the traces to export from the database and write them in the output file More...
 
void WriteGeneraleInfo ()
 Write the generale info about the textfile. More...
 
void WriteIntensityInfoFromDatabase ()
 get the info for the intensities corresponding to the m_VectorMeshIDs and the m_VectorChannelIDs and write them on the output file More...
 
void WriteLineagesInfoFromDatabase ()
 get the lineages info which IDs are in the m_VectorLineageIDs from the database and write them on the output file More...
 
void WriteMeshesInfoFromDatabase ()
 get the meshes info which IDs are in the m_VectorMeshIDs from the database and write them on the output file More...
 
void WriteNumberOfEntities (const std::string &iNameOfEntity, size_t iNumber)
 write on the output file the number of entities that are exported More...
 
void WriteOnTheOutputFile (const std::string &iNameOfEntity, const 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 More...
 
template<typename T >
void WriteTableInfoFromDB (const std::string &iField, const std::string &iValue)
 get the info from the database for all the entities from a table or with a limitation defined with field and value and write them in the output file after having written first the number of entities to be described More...
 
template<typename T >
void WriteTableInfoFromDB (const std::vector< std::string > &iListIDs)
 get the info from the database for all the entities from a table which IDs are in iListIDs and write them in the output file More...
 
void WriteTheColorsInfoFromDatabase ()
 get the colors info from the database for the corresponding traces to export and write them in the output file More...
 
void WriteTrackFamilyInfoFromDatabase ()
 
void WriteTracksInfoFromDatabase ()
 get the tracks info which IDs are in the m_VectorTrackIDs from the database and write them on the output file More...
 

Private Attributes

vtkMySQLDatabase * m_DatabaseConnector
 
int m_ImagingSessionID
 
std::string m_Login
 
std::string m_NameDocXml
 
std::fstream m_outfile
 
std::string m_Password
 
std::string m_ServerName
 
std::vector< std::string > m_VectorChannelIDs
 
std::vector< std::string > m_VectorContourIDs
 
std::vector< std::string > m_VectorLineageIDs
 
std::vector< std::string > m_VectorMeshIDs
 
std::vector< std::string > m_VectorTrackFamilyIDs
 
std::vector< std::string > m_VectorTrackIDs
 

Detailed Description

export the data from the database into a textfile

Definition at line 48 of file GoDBExport.h.

Constructor & Destructor Documentation

GoDBExport::GoDBExport ( const std::string &  iServerName,
const std::string &  iLogin,
const std::string &  iPassword,
int  iImagingSessionID,
const std::string &  iFilename 
)

Definition at line 52 of file GoDBExport.cxx.

GoDBExport::~GoDBExport ( )
virtual

Definition at line 64 of file GoDBExport.cxx.

Member Function Documentation

void GoDBExport::AddTabulation ( )
private

add 2 spaces to the output file for xml tabulation

Definition at line 470 of file GoDBExport.cxx.

void GoDBExport::CloseDBConnection ( )
private

close and delete the connection to the database.

Definition at line 487 of file GoDBExport.cxx.

void GoDBExport::ExportContours ( )

get all the imagingsession info,the info for the contours, the meshes they belong to and the tracks the previous meshes belong to from the database and put them in a text file

Definition at line 71 of file GoDBExport.cxx.

void GoDBExport::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

Definition at line 92 of file GoDBExport.cxx.

std::vector< std::pair< std::string, std::string > > GoDBExport::GetImagingSessionInfoFromDB ( )
private

get the info for imagingsession from the database

Returns
a vector of pair containing the name of the info as .first and the info as .second. for Imagingsession such as Name, creation date and microscope name

Definition at line 131 of file GoDBExport.cxx.

std::string GoDBExport::GetNameWithBrackets ( const std::string &  iName)
private

put iName within brackets

Parameters
[in]iName
Returns
iName within brackets

Definition at line 444 of file GoDBExport.cxx.

std::string GoDBExport::GetNameWithSlashBrackets ( const std::string &  iName)
private

put iName into slash brackets

Parameters
[in]iName
Returns
/iName within brackets

Definition at line 457 of file GoDBExport.cxx.

template<typename T >
std::vector< std::pair< std::string, std::string > > GoDBExport::GetOneEntityInfoFromDB ( const std::string &  iEntityID,
iTableRow 
)
inlineprivate

get the info with their names for an entity from the database and put them in a vector of pair of string (name of the info + value of the info)

Parameters
[in]iEntityIDID of the entity for which the info are needed
[in]iTableRow
Template Parameters
Tchildren of GoDBRow
Returns
vector of pair of string (name of the info + value of the info)

Definition at line 177 of file GoDBExport.h.

std::pair< std::string, std::string > GoDBExport::GetOneInfoFromDBForImgSession ( const std::string &  iNameInfo)
private

get one info for the current imagingsession from the database corresponding to the iNameInfo

Parameters
[in]iNameInfoname of the field in the database
Returns
a pair containing as .first the iNameInfo and as.second the corresponding info found in the Database for the table imagingsession

Definition at line 145 of file GoDBExport.cxx.

void GoDBExport::GetVectorsTableNamesTracesIDsAndFields ( std::vector< std::string > &  ioVectorTableNames,
std::vector< std::vector< std::string > > &  ioVectorTracesIDs,
std::vector< std::string > &  ioVectorFields,
bool  IncludeChannelIDs = false 
)
private

fill the different vectors needed for the queries depending if the vectors of IDs are empty or not: get the tables names, the key for the table and the tracesIDs

Parameters
[in,out]ioVectorTableNamesnames of the tables
[in,out]ioVectorTracesIDsIDs of the traces
[in,out]ioVectorFieldsnames of the database fields
[in]IncludeChannelIDs

Definition at line 495 of file GoDBExport.cxx.

void GoDBExport::OpenDBConnection ( )
private

open a connection to the database.

Definition at line 478 of file GoDBExport.cxx.

void GoDBExport::UpdateAllVectorTracesIDsToExportContours ( )
private

fill the different vectors of traces IDs corresponding to the contours to export

Definition at line 253 of file GoDBExport.cxx.

void GoDBExport::UpdateAllVectorTracesIDsToExportMeshes ( )
private

fill the different vectors of traces IDs corresponding to the meshes to export

Definition at line 267 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorChannelIDsForExportMeshes ( )
private

when exporting meshes, the total intensity per channel has to be calculated, and the info for the channels need to be stored

Definition at line 204 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorContourIDsForExportContours ( )
private

get the IDs of the contour belonging to the current imagingsession and fill the m_VectorContourIDs with them

Definition at line 158 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorContourIDsForExportMeshes ( )
private

when exporting meshes, we don't export the potential contours associated to the meshes, so we clear m_VectorContourIDs

Definition at line 168 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorLineageIDsToExportInfo ( )
private

check if for the tracks IDs found in the m_VectorTrackIDs, the corresponding tracks belongs to lineages, if so these lineages IDs are put in the m_VectorLineageIDs

Definition at line 240 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorMeshIDsForExportContours ( )
private

when exporting contours, if the contours belong to meshes, the info regarding these meshes are needed also, so fill m_VectorMeshIDs with these meshes IDs

Definition at line 176 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorMeshIDsForExportMeshes ( )
private

when exporting meshes, we export only the meshes with a 3D surface so we fill the m_VectorMeshIDs with the meshes with a non empty "Points" column from the database

Definition at line 189 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorTrackFamilyIDsToExportInfo ( )
private

Definition at line 227 of file GoDBExport.cxx.

void GoDBExport::UpdateVectorTrackIDsToExportInfo ( )
private

check if for the meshes IDs found in the m_VectorMeshIDs, the corresponding meshes belongs to tracks, if so these tracks IDs are put in the m_VectorTrackIDs

Definition at line 214 of file GoDBExport.cxx.

void GoDBExport::WriteCellTypeAndSubCellTypeInfoFromDatabase ( )
private

Get the celltype and subcelltype for the needed meshes from the database and write them on the output file.

Definition at line 301 of file GoDBExport.cxx.

void GoDBExport::WriteChannelsInfoFromDatabase ( )
private

get the channels info which IDs are in the m_VectorChannelIDs from the database and write them on the output file

Definition at line 375 of file GoDBExport.cxx.

void GoDBExport::WriteContoursInfoFromDatabase ( )
private

get the contours info which IDs are in the m_VectorContourIDs from the database and write them on the output file

Definition at line 399 of file GoDBExport.cxx.

void GoDBExport::WriteCoordinatesInfoFromDatabase ( )
private

get the coordinates without doublon corresponding to the coordidmax and min of the traces to export from the database and write them in the output file

Definition at line 322 of file GoDBExport.cxx.

void GoDBExport::WriteGeneraleInfo ( )
private

Write the generale info about the textfile.

Definition at line 115 of file GoDBExport.cxx.

void GoDBExport::WriteIntensityInfoFromDatabase ( )
private

get the info for the intensities corresponding to the m_VectorMeshIDs and the m_VectorChannelIDs and write them on the output file

Definition at line 383 of file GoDBExport.cxx.

void GoDBExport::WriteLineagesInfoFromDatabase ( )
private

get the lineages info which IDs are in the m_VectorLineageIDs from the database and write them on the output file

Definition at line 345 of file GoDBExport.cxx.

void GoDBExport::WriteMeshesInfoFromDatabase ( )
private

get the meshes info which IDs are in the m_VectorMeshIDs from the database and write them on the output file

Definition at line 367 of file GoDBExport.cxx.

void GoDBExport::WriteNumberOfEntities ( const std::string &  iNameOfEntity,
size_t  iNumber 
)
private

write on the output file the number of entities that are exported

Parameters
[in]iNameOfEntityentity name
[in]iNumbernumber of entities

Definition at line 431 of file GoDBExport.cxx.

void GoDBExport::WriteOnTheOutputFile ( const std::string &  iNameOfEntity,
const std::vector< std::pair< std::string, std::string > > &  iInfoToWrite 
)
private

write on the output file the info contained in the vector with the name of the entity they describe

Parameters
[in]iNameOfEntityname of the entity described
[in]iInfoToWriteinfo to be written in the output file

Definition at line 408 of file GoDBExport.cxx.

template<typename T >
void GoDBExport::WriteTableInfoFromDB ( const std::string &  iField,
const std::string &  iValue 
)
inlineprivate

get the info from the database for all the entities from a table or with a limitation defined with field and value and write them in the output file after having written first the number of entities to be described

Parameters
[in]iFieldfield defining the limitation
[in]iValuevalue defining the limitation
Template Parameters
Tchildren of GoDBRow

Definition at line 123 of file GoDBExport.h.

template<typename T >
void GoDBExport::WriteTableInfoFromDB ( const std::vector< std::string > &  iListIDs)
inlineprivate

get the info from the database for all the entities from a table which IDs are in iListIDs and write them in the output file

Parameters
[in]iListIDsList of the IDs for which the info need to be written
Template Parameters
childrenof GoDBRow

Definition at line 147 of file GoDBExport.h.

void GoDBExport::WriteTheColorsInfoFromDatabase ( )
private

get the colors info from the database for the corresponding traces to export and write them in the output file

Definition at line 280 of file GoDBExport.cxx.

void GoDBExport::WriteTrackFamilyInfoFromDatabase ( )
private

Definition at line 353 of file GoDBExport.cxx.

void GoDBExport::WriteTracksInfoFromDatabase ( )
private

get the tracks info which IDs are in the m_VectorTrackIDs from the database and write them on the output file

Definition at line 359 of file GoDBExport.cxx.

Member Data Documentation

vtkMySQLDatabase* GoDBExport::m_DatabaseConnector
private

Definition at line 76 of file GoDBExport.h.

int GoDBExport::m_ImagingSessionID
private

Definition at line 80 of file GoDBExport.h.

std::string GoDBExport::m_Login
private

Definition at line 79 of file GoDBExport.h.

std::string GoDBExport::m_NameDocXml
private

Definition at line 82 of file GoDBExport.h.

std::fstream GoDBExport::m_outfile
private

Definition at line 81 of file GoDBExport.h.

std::string GoDBExport::m_Password
private

Definition at line 78 of file GoDBExport.h.

std::string GoDBExport::m_ServerName
private

Definition at line 77 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorChannelIDs
private

Definition at line 89 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorContourIDs
private

Definition at line 84 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorLineageIDs
private

Definition at line 88 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorMeshIDs
private

Definition at line 85 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorTrackFamilyIDs
private

Definition at line 87 of file GoDBExport.h.

std::vector< std::string > GoDBExport::m_VectorTrackIDs
private

Definition at line 86 of file GoDBExport.h.


The documentation for this class was generated from the following files: