MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.db.image.Database Class Reference

The Database class manages the actual connection to the physical database using Entity Framworks from Microsoft. More...

Inheritance diagram for MyCaffe.db.image.Database:
MyCaffe.db.temporal.DatabaseTemporal

Public Types

enum  FORCE_LOAD { NONE , FROM_FILE , FROM_DB }
 Defines the force load type. More...
 

Public Member Functions

 Database ()
 The Database constructor. More...
 
void Dispose ()
 Release any resources used. More...
 
bool VerifyDataConnection (string strSrc, ConnectInfo ci)
 Verify the data connection information. More...
 
void SaveChanges ()
 Saves any changes on the open satabase. More...
 
virtual void Open (int nSrcId, FORCE_LOAD nForceLoad=FORCE_LOAD.NONE, ConnectInfo ci=null)
 Opens a data source. More...
 
void Open (string strSrc, bool bForceLoadImageFilePath=false)
 Opens a data source. More...
 
virtual void Close ()
 Close the previously opened data source. More...
 
void Refresh ()
 Close and re Open with the current data source. More...
 
string GetDatabaseFilePath (string strName)
 Query the physical database file path. More...
 
string GetDatabaseImagePath (string strName)
 Query the physical database file path for Images. More...
 
void UpdateLabelName (int nLabel, string strName, int nSrcId=0)
 Update the name of a label. More...
 
Label GetLabel (int nID)
 Return the Label with the given ID. More...
 
string GetLabelName (int nLabel, int nSrcId=0)
 Get the Label name of a label within a data source. More...
 
Label FindLabelInCache (int nLabel)
 Search for a Label in the label cache. More...
 
int GetLabelID (int nLabel)
 Returns the label ID associated with a label value. More...
 
int GetLabelCount (int nLabel)
 Returns the number of images under a given label. More...
 
void AddLabelToCache (int nLabel)
 Adds a label to the label cache. More...
 
void SaveLabelCache ()
 Saves the label cache to the database. More...
 
void UpdateLabelCounts (Dictionary< int, int > rgCounts, DNNEntities entities)
 Updates the label counts in the database for the open data source. More...
 
void LoadLabelCounts (Dictionary< int, int > rgCounts, int nSrcId=0)
 Load the label counts from the database for a data source. More...
 
string GetLabelCountsAsText (int nSrcId=0, ConnectInfo ci=null)
 Returns the label counts for a given data source. More...
 
void UpdateLabelCounts (Dictionary< int, int > rgCounts, int nSrcId=0)
 Update the label counts for a given data source. More...
 
void UpdateLabelCounts (int nSrcId=0, int nProjectId=0, ConnectInfo ci=null)
 Update the label counts for a given data source and project (optionally) by querying the database for the actual counts. More...
 
List< Label > GetLabels (bool bSort=true, bool bWithImagesOnly=false, int nSrcId=0, ConnectInfo ci=null)
 Returns a list of all labels used by a data source. More...
 
void DeleteLabels (int nSrcId=0)
 Delete the labels of a data source from the database. More...
 
int AddLabel (int nLabel, string strName="", int nSrcId=0, ConnectInfo ci=null)
 Add a label to the database for a data source. More...
 
void AddLabelBoost (int nProjectId, int nLabel, double dfBoost, int nSrcId=0)
 Add a label boost to the database for a given project. More...
 
void SetLabelMapping (LabelMapping map, int nSrcId=0)
 Saves a label mapping in the database for a data source. More...
 
void UpdateLabelMapping (int nNewLabel, List< int > rgOriginalLabels, int nSrcId=0)
 Update a label mapping in the database for a data source. More...
 
void ResetLabels (int nProjectId=0, int nSrcId=0)
 Resets all labels back to their original labels for a project. More...
 
void DeleteLabelBoosts (int nProjectId, int nSrcId=0)
 Delete all label boosts for a project. More...
 
void DeleteLabelBoosts (int nProjectId)
 Delete all label boosts for a project. More...
 
void ResetLabelBoosts (int nProjectId)
 Reset all label boosts to their orignal settings for a project. More...
 
List< LabelBoost > GetLabelBoosts (int nProjectId, bool bSort=true, int nSrcId=0)
 Returns a list of all label boosts set on a project. More...
 
string GetLabelBoostsAsText (int nProjectId, int nSrcId=0, bool bSort=true)
 Returns the Label boosts as a string. More...
 
void ActivateLabels (List< int > rgLabels, bool bActive, params int[] rgSrcId)
 Activate (or deactivate) the labels specified for each of the source ID's specified. More...
 
void UpdateLabelBoost (int? nTgtLbl, bool bTgtLblExact, int? nTgtBst, bool bTgtBstExact, int? nNewLbl, int? nNewBst, params int[] rgSrcId)
 Update the label and boost for a given search target criteria. More...
 
int GetImageCount ()
 Returns the number of raw images in the database for the open data source. More...
 
List< DbItemGetAllRawImageIndexes (bool bBoostedOnly, bool bIncludeActive=true, bool bIncludeInactive=false)
 Returns the list of the image indexes of all images. More...
 
List< RawImage > QueryRawImages (params int[] rgSrcId)
 Returns the list of raw images that have a source ID from a selected list. More...
 
List< RawImageParameter > QueryRawImageParameters (int nSrcId, string strName)
 Query a list of all raw image parameters of a give name stored with a given source ID. More...
 
List< RawImageParameter > QueryRawImageParameters (int nImageID)
 Query all image parameters for a given image. More...
 
List< RawImage > QueryRawImages (int nSrcId, bool? bActive=null, int nBoostVal=0, bool bExactBoostVal=false)
 Returns the list of raw images that have a source ID from a selected list. More...
 
List< RawImage > GetRawImagesAt (int nIdx, int nCount, int nSrcId=0, string strDescription=null)
 Returns a list of RawImages from the database for a data source. More...
 
List< RawImage > GetRawImagesAt (List< int > rgImageIdx, int nSrcId=0, string strDescription=null)
 Returns a list of RawImages from the database for a data source. More...
 
List< RawImage > GetRawImagesAtID (List< int > rgImageID, int nSrcId=0, string strDescription=null)
 Returns a list of RawImages from the database for a data source. More...
 
RawImage GetRawImageAt (int nIdx, int nSrcId=0)
 Returns the RawImage at a given image index. More...
 
int GetRawImageID (DateTime dt, int nSrcId=0)
 Returns the RawImage ID for the image with the given time-stamp. More...
 
byte[] GetRawImageData (RawImage img, bool bLoadDataCriteria, bool bLoadDebugData, out byte[] rgDataCriteria, out int? nDataCriteriaFmtId, out byte[] rgDebugData, out int? nDebugDataFmtId)
 Returns the raw data of the RawImage. More...
 
byte[] GetRawImageDataCriteria (RawImage img, out int? nDataCriteriaFmtId)
 Returns the raw data criteria data of the RawImage. More...
 
byte[] GetRawImageDebugData (RawImage img, out int? nDebugDataFormatId)
 Returns the raw debug data data of the RawImage. More...
 
byte[] GetRawImageDebugData (byte[] rgData, int? nOriginalSourceID=null)
 Converts the raw image debug data which may be stored as a path to the underlying data file, to the actual data. More...
 
byte[] GetRawImageDebugData (int nImgID, int? nOriginalSourceID=null)
 Queries the Debug Data for an image an Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data. More...
 
byte[] GetRawImageDataCriteria (byte[] rgData, int? nOriginalSourceID=null)
 Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data. More...
 
byte[] GetRawImageDataCriteria (int nImgID, int? nOriginalSourceID=null)
 Queries the Data Criteria for an image an Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data. More...
 
bool ChangeRawImageSourceID (int nID, int nNewSrcID, bool bSave=true)
 Change the data source ID on a raw image - currently only allowed on virtual raw images. More...
 
bool UpdateActiveLabel (int nID, int nLabel, bool bActivate=true, bool bSaveChanges=true)
 Update the label value of a label. More...
 
void UpdateActiveLabelByID (int nID, int nLabel)
 Update the label value of a label. More...
 
void UpdateActiveLabelByIndex (int nSrcId, int nIdx, int nLabel)
 Update the label value of a label. More...
 
void UpdateAllActiveLabels (int nSrcId, int nLabel, int? nOriginalLabel)
 Update the all items to a label value for the given nSrcId. More...
 
void ResetAllActiveLabels (int nSrcId)
 Reset the all active labels to their original label within a source. More...
 
void DisableLabel (int nSrcId, int nLabel, bool bOriginalLabel=false)
 Disable a set of labels within the source specified by the ID. More...
 
void DisableAllLabels (int nSrcId)
 Disable all labels within the source specified by the ID. More...
 
int DisableAllNonMatchingImages (int nSrcId, int nWidth, int nHeight)
 Disable all images that do not have a matching widxht size. More...
 
void ActivateRawImageByIndex (int nSrcId, int nIdx, bool bActive)
 Activate/deactivate a raw image based on its index. More...
 
void UpdateActiveLabelDirect (int nID, int nLabel)
 Directly update the active label and activate the image with the specified ID. More...
 
bool UpdateRawImageDescription (int nID, string strDescription)
 Update the description of a RawImage. More...
 
bool UpdateRawImageDescriptionFromParameter (int nID, string strParamName)
 Update the RawImage description from a RawImage parameter. More...
 
List< int > QueryAllRawImageIDs (int nSrcId=0, int nMax=int.MaxValue, int nLabel=-1, int nBoost=-1, bool bBoostIsExact=false, bool bAnnotatedOnly=false, bool bActiveOnly=true)
 Returns the ID's of all RawImages within a data source. More...
 
RawImage CreateRawImage (int nIdx, SimpleDatum d, int nBackgroundWritingThreadCount, string strDescription=null, int? nOriginalSourceID=null, bool bActive=true)
 Create a new RawImage but do not add it to the database. More...
 
bool WaitForFileWriter (int nWait=int.MaxValue)
 Wait for the file writer to complete writing all files. More...
 
bool ConvertRawImagesSaveToFile (int nIdx, int nCount, CancelEvent evtCancel=null)
 The ConvertRawImagesSaveToFile method saves the image in the database to the file system and replaces the database data with the path to the saved image, thus saving database space. More...
 
bool ConvertRawImagesSaveToDatabase (int nIdx, int nCount, CancelEvent evtCancel=null)
 The ConvertRawImagesSaveToDatabase method saves the image in the file system to the database and deletes the file from the file system. More...
 
void FixupRawImageCopy (int nImageID, int nSecondarySrcId)
 The FixupRawImageCopy method is used to fixup the OriginalSourceId by setting it to a secondary source ID in the event that the path created using the PrimarySourceID does not have the image data file. More...
 
void PutRawImageParameters (List< ParameterData > rgParam, ConnectInfo ci=null)
 Save a list of raw image parameters. More...
 
void PutRawImages (List< RawImage > rgImg, List< List< ParameterData > > rgrgParam=null, ConnectInfo ci=null)
 Saves a List of RawImages to the database. More...
 
int PutRawImage (int nIdx, SimpleDatum d, string strDescription=null)
 Save a SimpleDatum as a RawImage in the database. More...
 
RawImage GetRawImage (int nID)
 Returns the RawImage with a given ID. More...
 
int QueryRawImageCount (int nSrcId=0)
 Returns the number of RawImages in a data source. More...
 
void DeleteRawImages (int nSrcId=0)
 Delete all RawImages in a data source. More...
 
void DeleteRawImageResults (int nSrcId=0)
 Delete all RawImageResults for a data source. More...
 
RawImageMean GetRawImageMean (int nSrcId=0, ConnectInfo ci=null)
 Return the RawImageMean for the image mean from the open data source. More...
 
int PutRawImageMean (SimpleDatum sd, bool bUpdate, int nSrcId=0, ConnectInfo ci=null)
 Save the SimpleDatum as a RawImageMean in the database. More...
 
bool CopyImageMean (int nSrcIdSrc, int nSrcIdDst, ConnectInfo ci=null)
 Copy the raw image mean from one source to another. More...
 
void DeleteRawImageMeans (int nSrcId=0)
 Delete all RawImageMeans for a data source. More...
 
int GetBoostCount (int nSrcId=0, string strFilterVal=null, int? nBoostVal=null)
 Return the number of boosted images for a data source. More...
 
int ActivateFiltered (int nSrcId=0, string strFilterVal=null, int? nBoostVal=null)
 Activate the images that meet the filtering criteria in the Data Source. If no filtering criteria is set, all images are activated. More...
 
int GetImageCount (int nSrcId=0, bool bActive=true, bool bInactive=true, ConnectInfo ci=null)
 Get the number of images in the source. More...
 
void ResetAllBoosts (int nSrcId=0, int nMinBoost=0, bool bExactVal=false, int nDesiredBoostVal=-1)
 Reset all image boosts for a data set. More...
 
void UpdateBoost (long nImageID, int nBoost)
 Update the image boost of a given image. More...
 
void UpdateBoosts (int nSrcId, DateTime dtStart, DateTime dtEnd, int nBoost)
 Update the boost of all images between a date range. More...
 
List< RawImage > ReindexRawImages (Log log, CancelEvent evtCancel, int nSrcId=0)
 Reindex the RawImages of a data source. More...
 
bool UpdateRawImageSourceID (int nImageID, int nSrcID)
 Updates a given image's source ID. More...
 
bool ActivateRawImage (int nImageID, bool bActivate, bool bSave=true)
 Activate/Deactivate a given image. More...
 
void ActivateAllRawImages (bool bActive, bool bAnnotatedOnly, params int[] rgSrcId)
 Activate all raw images associated with a set of source ID's. More...
 
void ActivateAllRawImages (bool bActive, bool bAnnotatedOnly, int? nTgtLabel, bool bTargetLabelExact, int? nTgtBoost, bool bTargetBoostExact, params int[] rgSrcId)
 Activate all raw images associated with a set of source ID's. More...
 
void UpdateDatasetImageAnnotations (int nSrcId, int nImageId, AnnotationGroupCollection annotations, bool bSetLabelOnly)
 Update the annotations of a given raw image. More...
 
int PutRawImageResults (int nSrcId, int nIdx, int nLabel, DateTime dt, List< Result > rgResults, bool bInvert, List< Tuple< DateTime, int > > rgExtra=null)
 Save the results of a Run as a RawImageResult. More...
 
int PutRawImageResults (int nSrcId, int nIdx, int nLabel, DateTime dt, List< Tuple< SimpleDatum, List< Result > > > rgrgResults, List< Tuple< DateTime, int > > rgExtra=null)
 Save the results of a Run as a RawImageResult. More...
 
List< Tuple< SimpleDatum, List< Result > > > GetRawImageResultBatch (int nBatchCount, byte[] rgResults)
 Extracts the raw image result batch from the result binary data. More...
 
int PutRawImageResultExtraData (int nRawImageResultID, byte[] rgExtraData)
 Set the raw image result extra data field. More...
 
List< RawImageResult > GetRawImageResults (int nSrcId=0, bool bRequireExtraData=false, int nMax=-1)
 Returns the RawImageResults for a data source. More...
 
string GetRawImageParameter (int nRawImageID, string strName, string strDefault)
 Return the string value of a RawImage parameter. More...
 
int GetRawImageParameter (int nRawImageID, string strName, int nDefault)
 Return the int value of a RawImage parameter. More...
 
double GetRawImageParameter (int nRawImageID, string strName, double dfDefault)
 Return the double value of a RawImage parameter. More...
 
bool GetRawImageParameter (int nRawImageID, string strName, bool bDefault)
 Return the bool value of a RawImage parameter. More...
 
byte[] GetRawImageParameterData (int nRawImageID, string strName)
 Return the byte array data of a RawImage parameter. More...
 
RawImageParameter GetRawImageParameterEx (int nRawImageID, string strName)
 Returns the RawImageParameter entity given the image ID and parameter name.. More...
 
int SetRawImageParameter (int nRawImageID, string strName, string strValue, double? dfVal=null, byte[] rgData=null, bool bSave=true, bool bOnlyAddNew=false, DNNEntities entities=null)
 Add a new RawImage parameter (or update an existing if found). More...
 
int SetRawImageParameter (int nSrcId, int nRawImageID, string strName, string strValue, double? dfVal=null, byte[] rgData=null)
 Add a new RawImage parameter (or update an existing if found). More...
 
int SetRawImageParameterAt (DateTime dt, string strName, string strValue, double? dfVal, byte[] rgData)
 Set the RawImage parameter for all RawImages with the given time-stamp in the data source. More...
 
void DeleteRawImageParameters (int nSrcId)
 Delete all RawImage parameters within a data source. More...
 
int GetRawImageParameterCount (string strName, int nSrcId=0, string strType="TEXT")
 Returns the RawImage parameter count for a data source. More...
 
bool GetRawImageParameterExist (string strName, int nSrcId=0, string strType="TEXT")
 Returns whether or not a given RawImage parameter exists. More...
 
List< string > GetRawImageDistinctParameterDescriptions (int nSrcId=0)
 Returns a list of distinct RawImage parameter descriptions for a data source. More...
 
int AddRawImageGroup (Image img, int nIdx, DateTime dtStart, DateTime dtEnd, List< double > rgProperties)
 Adds a new RawImage group to the database. More...
 
int PutRawImageGroup (RawImageGroup g)
 Adds a RawImageGroup to the database. More...
 
RawImageGroup FindRawImageGroup (int nIdx, DateTime dtStart, DateTime dtEnd)
 Searches for a RawImageGroup by index, start time-stamp and end time-stamp. More...
 
int FindRawImageGroupID (int nIdx, DateTime dtStart, DateTime dtEnd)
 Searches fro the RawImageGroup ID. More...
 
void DeleteRawImageGroups ()
 Deletes all RawImage groups More...
 
void DeleteSourceData ()
 Deletes the data source data for the open data source. More...
 
void UpdateSaveImagesToFile (bool bSaveToFile, int nSrcId=0)
 Update the SaveImagesToFile flag in a given Data Source. More...
 
void UpdateSource (int nChannels, int nWidth, int nHeight, bool bDataIsReal, int nSrcId=0)
 Updates a data source. More...
 
void UpdateSourceCounts (int nImageCount, ConnectInfo ci=null)
 Updates the source counts for the open data source. More...
 
void UpdateSourceCounts (ConnectInfo ci=null)
 Updates the source counts for the open data source by querying the database for the counts. More...
 
int GetSourceID (string strName, ConnectInfo ci=null)
 Returns the ID of a data source given its name. More...
 
string GetSourceName (int nID, ConnectInfo ci=null)
 Returns the name of a data source given its ID. More...
 
Source GetSource (string strName, ConnectInfo ci=null)
 Returns the Source entity given a data source name. More...
 
Source GetSource (int nID, ConnectInfo ci=null)
 Returns the Source entity given a data source ID. More...
 
int PutSource (Source src, ConnectInfo ci=null)
 Adds or updates (if exists) a data source to the database. More...
 
int AddSource (string strName, int nChannels, int nWidth, int nHeight, bool bDataIsReal, int nCopyOfSourceID=0, bool bSaveImagesToFile=true, ConnectInfo ci=null)
 Adds a new data source to the database. More...
 
virtual bool DeleteSource (int nSrcId=0)
 Delete a data source from the database. More...
 
void DeleteSources (params string[] rgstrSrc)
 Delete the list of data sources, listed by name, from the database. More...
 
virtual bool DeleteSourceData (int nSrcId=0)
 Delete the data source data (images, means, results and parameters) from the database. More...
 
void DeleteSourceData (string strSrc)
 Delete the data source data (images, means, results and parameters) from the database. More...
 
Dictionary< string, string > GetSourceParameters (int nSrcId=0, ConnectInfo ci=null)
 Returns a dictionary of the data source parameters. More...
 
string GetSourceParameter (string strName, int nSrcId=0)
 Return the data source parameter as a string. More...
 
int GetSourceParameter (string strName, int nDefault, int nSrcId=0)
 Return the data source parameter as an int. More...
 
double GetSourceParameter (string strName, double dfDefault, int nSrcId=0)
 Return the data source parameter as a double. More...
 
bool GetSourceParameter (string strName, bool bDefault, int nSrcId=0)
 Return the data source parameter as a bool. More...
 
void SetSourceParameter (string strName, string strValue, int nSrcId=0)
 Set the value of a data source parameter. More...
 
DateTime GetFirstTimeStamp (int nSrcId=0, string strDesc=null)
 Returns the first time-stamp in the data source. More...
 
DateTime GetLastTimeStamp (int nSrcId=0, string strDesc=null)
 Returns the last time-stamp in the data source. More...
 
DateTime GetLastTimeStamp (DateTime dtStart, DateTime dtEnd, bool bEndInclusive, int nSrcId=0, string strDesc=null)
 Returns the last time-stamp in the data source. More...
 
DateTime GetLastTimeStamp (out int nIndex, int nSrcId=0, string strDesc=null)
 Returns the last time-stamp and index in the data source. More...
 
DateTime GetLastTimeStamp (DateTime dtStart, DateTime dtEnd, bool bEndInclusive, out int nIndex, int nSrcId=0, string strDesc=null)
 Returns the last time-stamp and index in the data source falling within a time range. More...
 
string FindDatasetNameFromSourceName (string strTrainSrc, string strTestSrc)
 Searches for the data set name based on the training and testing source names. More...
 
int FindDatasetFromSourceId (int nSourceId)
 Searches for the dataset containing the sourceId. More...
 
int GetDatasetID (string strName, ConnectInfo ci=null)
 Returns a datasets ID given its name. More...
 
string GetDatasetName (int nID, ConnectInfo ci=null)
 Returns the name of a dataset given its ID. More...
 
Dataset GetDataset (int nID, ConnectInfo ci=null)
 Returns the Dataset entity for a dataset ID. More...
 
Dataset GetDataset (string strName)
 Returns the Dataset entity for a dataset name. More...
 
Dataset GetDataset (string strTestingSrc, string strTrainingSrc)
 Returns the Dataset entity containing the training and testing source names. More...
 
int AddDataset (int nDsCreatorID, string strName, int nTestSrcId, int nTrainSrcId, int nDsGroupID=0, int nModelGroupID=0, ConnectInfo ci=null, bool bVerify=true)
 Add a new (or update an existing if exists) dataset to the database. More...
 
void UpdateDatasetDescription (int nDsId, string strDesc)
 Update the description of a given dataset. More...
 
void UpdateDatasetCounts (int nDsId, ConnectInfo ci=null)
 Update the dataset counts. More...
 
int PutDataset (Dataset ds)
 Save the Dataset entity to the database. More...
 
DatasetGroup GetDatasetGroup (int nGroupID, ConnectInfo ci=null)
 Returns the DatasetGroup entity given a group ID. More...
 
string GetDatasetGroupName (int nGroupID)
 Returns the name of a dataset group given its ID. More...
 
Dictionary< string, string > GetDatasetParameters (int nDsId, ConnectInfo ci=null)
 Returns all dataset parameters for a given dataset. More...
 
string GetDatasetParameter (int nDsId, string strName)
 Returns the value of a dataset parameter as a string. More...
 
int GetDatasetParameter (int nDsId, string strName, int nDefault)
 Returns the value of a dataset parameter as an int. More...
 
double GetDatasetParameter (int nDsId, string strName, double dfDefault)
 Returns the value of a dataset parameter as a double. More...
 
bool GetDatasetParameter (int nDsId, string strName, bool bDefault)
 Returns the value of a dataset parameter as a bool. More...
 
void SetDatasetParameter (int nDsId, string strName, string strValue)
 Adds a new parameter or Sets the value of an existing dataset parameter. More...
 
void SetDatasetParameters (int nDsId, Dictionary< string, string > rgP)
 Adds a batch of new parametes. More...
 
virtual void DeleteDataset (string strDsName, bool bDeleteRelatedProjects, Log log, CancelEvent evtCancel)
 Delete a dataset. More...
 
List< Dataset > GetAllDatasets (int nDatasetGroupID)
 Returns a list of all datasets within a group. More...
 
List< Dataset > GetAllDatasetsWithCreators (int nDatasetGroupID)
 Returns a list of all datasets within a group with dataset creators. More...
 
List< Dataset > GetAllDatasetsWithCreator (int nDsCreatorID, bool? bRelabeled=null)
 Returns a list of all datasets within a group with dataset creators. More...
 
int GetDatasetGroupID (string strName)
 Returns the ID of a dataset group given its name. More...
 
string GetDatasetCreatorName (int nDatasetCreatorID, ConnectInfo ci=null)
 Returns the name of a dataset creator given its ID. More...
 
int GetDatasetCreatorID (string strName)
 Returns the ID of a dataset creator given its name. More...
 
void ResetAllDatasetRelabelWithCreator (int nDsCreatorID)
 Reset all dataset relabel flags with a given creator. More...
 
void UpdateDatasetRelabel (int nDsID, bool bRelabel)
 Update the dataset relabel flag for a dataset. More...
 
DateTime GetDatasetMinimumTimestamp (int nDsID)
 Returns the minimum time-stamp for a dataset. More...
 
DateTime GetDatasetMaximumTimestamp (int nDsID)
 Returns the maximum time-stamp for a dataset. More...
 
void UpdateDatasetCounts (CancelEvent evtCancel, Log log, int nDatasetCreatorID, List< string > rgstrDs, string strParamNameForDescription)
 Updates the dataset counts for a set of datasets. More...
 
ModelGroup GetModelGroup (int nGroupID, ConnectInfo ci=null)
 Returns the ModelGroup entity given the ID of a model group. More...
 
string GetModelGroupName (int nGroupID)
 Returns the name of a model group given its ID. More...
 
int GetModelGroupID (string strGroup)
 Retruns the ID of a model group given its name. More...
 
List< Dataset > GetAllDatasetsInModelGroup (int nModelGroupId)
 Returns all Dataset entities within a given model group. More...
 
void DeleteModelGroup (string strGroup, Log log, CancelEvent evtCancel)
 Deletes a model group from the database. More...
 

Static Public Member Functions

static byte[] PackExtraData (List< Tuple< DateTime, int > > rg)
 Pack the extra data into a byte array. More...
 
static List< Tuple< DateTime, int > > UnpackExtraData (byte[] rg)
 Unpack the extra data from a byte array. More...
 

Protected Member Functions

virtual void setImagePath (FORCE_LOAD nForceLoad)
 Sets the image path member to the path used when saving binary data to the file system. More...
 
virtual string getImagePath (string strSrcName=null)
 Returns the base image path used when saving binary data to the file system. More...
 
byte[] getRawImage (byte[] rgData, int? nSecondarySrcId=null, ConnectInfo ci=null, DNNEntities entities=null, bool bTestConnection=false)
 Converts a set of bytes from a file path-name by loading its bytes and returning them, or if the original bytes do not contain a path, just returns the original bytes. More...
 
string getImagePath (byte[] rgData)
 Returns the file path contained within a byte array or null if no path is found. More...
 
byte[] setImageByteData (byte[] rgImg, string strType=null, string strGuid=null, int nBackgroundWritingThreadCount=0)
 When enabled, saves the bytes to file and returns the file name of the binary file saved as an array of bytes.. More...
 

Protected Attributes

Source m_src = null
 Specifies the default data source. More...
 
string m_strPrimaryImgPath = null
 Specifies the base path to the file based data. More...
 
string m_strSecondaryImgPath = null
 Specifies the secondary base path to the file based data (used when copying a data source) More...
 
bool m_bEnableFileBasedData = false
 Specifies whether or not file based data is enabled. More...
 
int m_nLastIndex = -1
 Specifies the last index added to the data source. More...
 

Properties

int LastIndex [get]
 Returns the last image index added to the database. More...
 
Source CurrentSource [get]
 Returns the current entity framwork Source object set during the previous call to Open(). More...
 

Detailed Description

The Database class manages the actual connection to the physical database using Entity Framworks from Microsoft.

Definition at line 22 of file Database.cs.

Member Enumeration Documentation

◆ FORCE_LOAD

Defines the force load type.

Enumerator
NONE 

Specifies that no force load is specified.

FROM_FILE 

Specifies to force load from file.

FROM_DB 

Specifies to force load from db.

Definition at line 56 of file Database.cs.

Constructor & Destructor Documentation

◆ Database()

MyCaffe.db.image.Database.Database ( )

The Database constructor.

Definition at line 75 of file Database.cs.

Member Function Documentation

◆ ActivateAllRawImages() [1/2]

void MyCaffe.db.image.Database.ActivateAllRawImages ( bool  bActive,
bool  bAnnotatedOnly,
int?  nTgtLabel,
bool  bTargetLabelExact,
int?  nTgtBoost,
bool  bTargetBoostExact,
params int[]  rgSrcId 
)

Activate all raw images associated with a set of source ID's.

Parameters
bActiveSpecifies whether or not to activate the images.
bAnnotatedOnlySpecifies to activate annotated images only.
nTgtLabelIf not null, specifies the target label.
bTargetLabelExactSpecifies that the exact nTgtLabel value should be used, otherwise the nTgtLabel value or greater is used.
nTgtBoostIf not null, specifies the target boost.
bTargetBoostExactSpecifies that the exact nTgtBoost value should be used, otherwise the nTgtBoost value or greater is used.
rgSrcIdSpecifies the source ID's.

Definition at line 3064 of file Database.cs.

◆ ActivateAllRawImages() [2/2]

void MyCaffe.db.image.Database.ActivateAllRawImages ( bool  bActive,
bool  bAnnotatedOnly,
params int[]  rgSrcId 
)

Activate all raw images associated with a set of source ID's.

Parameters
bActiveSpecifies whether or not to activate the images.
bAnnotatedOnlySpecifies to activate annotated images only.
rgSrcIdSpecifies the source ID's.

Definition at line 3024 of file Database.cs.

◆ ActivateFiltered()

int MyCaffe.db.image.Database.ActivateFiltered ( int  nSrcId = 0,
string  strFilterVal = null,
int?  nBoostVal = null 
)

Activate the images that meet the filtering criteria in the Data Source. If no filtering criteria is set, all images are activated.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strFilterValOptionally, specifies a parameter filtering value (default = null).
nBoostValOptionally, specifies a boost filtering value (default = null).
Returns
The number of activated images is returned.

Definition at line 2768 of file Database.cs.

◆ ActivateLabels()

void MyCaffe.db.image.Database.ActivateLabels ( List< int >  rgLabels,
bool  bActive,
params int[]  rgSrcId 
)

Activate (or deactivate) the labels specified for each of the source ID's specified.

Parameters
rgLabelsSpecifies the labels.
bActiveSpecifies whether to activate (true) or deactivate (false) the labels.
rgSrcIdSpecifies the source ID's who's labels are to be activated.

Definition at line 1013 of file Database.cs.

◆ ActivateRawImage()

bool MyCaffe.db.image.Database.ActivateRawImage ( int  nImageID,
bool  bActivate,
bool  bSave = true 
)

Activate/Deactivate a given image.

Parameters
nImageIDSpecifies the ID of the image to activate/deactivate.
bActivateSpecifies whether to activate (true) or deactivate (false) the image.
bSaveSpecifies whether or not to save the changes (when false, calling SaveChanges() is needed).
Returns
If the active state is changed, true is returned, otherwise false is returned.

Definition at line 2998 of file Database.cs.

◆ ActivateRawImageByIndex()

void MyCaffe.db.image.Database.ActivateRawImageByIndex ( int  nSrcId,
int  nIdx,
bool  bActive 
)

Activate/deactivate a raw image based on its index.

Parameters
nSrcIdSpecifies the source ID.
nIdxSpecifies the ID of the label.
bActiveSpecifies the new active state to set.

Definition at line 1866 of file Database.cs.

◆ AddDataset()

int MyCaffe.db.image.Database.AddDataset ( int  nDsCreatorID,
string  strName,
int  nTestSrcId,
int  nTrainSrcId,
int  nDsGroupID = 0,
int  nModelGroupID = 0,
ConnectInfo  ci = null,
bool  bVerify = true 
)

Add a new (or update an existing if exists) dataset to the database.

Parameters
nDsCreatorIDSpecifies the ID of the creator.
strNameSpecifies the name of the dataset.
nTestSrcIdSpecifies the ID of the testing data source.
nTrainSrcIdSpecifies the ID of the training data source.
nDsGroupIDOptionally, specifies the ID of the dataset group (default = 0).
nModelGroupIDOptionally, specifies the ID of the model group (default = 0).
ciOptionally, specifies a specific connection to use (default = null).
bVerifyOptionally, specifies to verify the image sizings CxHxW (default = true).
Returns

Definition at line 4719 of file Database.cs.

◆ AddLabel()

int MyCaffe.db.image.Database.AddLabel ( int  nLabel,
string  strName = "",
int  nSrcId = 0,
ConnectInfo  ci = null 
)

Add a label to the database for a data source.

Parameters
nLabelSpecifies the label.
strNameOptionally, specifies a label name (default = "").
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the added label is returned.

Definition at line 753 of file Database.cs.

◆ AddLabelBoost()

void MyCaffe.db.image.Database.AddLabelBoost ( int  nProjectId,
int  nLabel,
double  dfBoost,
int  nSrcId = 0 
)

Add a label boost to the database for a given project.

Parameters
nProjectIdSpecifies the ID of the project for which the label boost is to be added.
nLabelSpecifies the label.
dfBoostSpecifies the boost.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 794 of file Database.cs.

◆ AddLabelToCache()

void MyCaffe.db.image.Database.AddLabelToCache ( int  nLabel)

Adds a label to the label cache.

Parameters
nLabelSpecifies the label.

Definition at line 494 of file Database.cs.

◆ AddRawImageGroup()

int MyCaffe.db.image.Database.AddRawImageGroup ( Image  img,
int  nIdx,
DateTime  dtStart,
DateTime  dtEnd,
List< double >  rgProperties 
)

Adds a new RawImage group to the database.

Parameters
imgSpecifies an image associated with the group.
nIdxSpecifies an index associated with the group.
dtStartSpecifies the start time stamp for the group.
dtEndSpecifies the end time stamp for the group.
rgPropertiesSpecifies the properties of the group.
Returns
The ID of the RawImageGroup is returned.

Definition at line 3755 of file Database.cs.

◆ AddSource()

int MyCaffe.db.image.Database.AddSource ( string  strName,
int  nChannels,
int  nWidth,
int  nHeight,
bool  bDataIsReal,
int  nCopyOfSourceID = 0,
bool  bSaveImagesToFile = true,
ConnectInfo  ci = null 
)

Adds a new data source to the database.

Parameters
strNameSpecifies the data source name.
nChannelsSpecifies the number of channels per item.
nWidthSpecifies the width of each item.
nHeightSpecifies the height of each item.
bDataIsRealSpecifies whether or not the item uses real or byte data.
nCopyOfSourceIDOptionally, specifies the ID of the source from which this source was copied. If this is an original source, this parameter should be 0.
bSaveImagesToFileOptionally, specifies whether or not to save the images to the file system (true) or directly into the database (false) The default = true.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the data source added is returned.

Definition at line 4134 of file Database.cs.

◆ ChangeRawImageSourceID()

bool MyCaffe.db.image.Database.ChangeRawImageSourceID ( int  nID,
int  nNewSrcID,
bool  bSave = true 
)

Change the data source ID on a raw image - currently only allowed on virtual raw images.

Parameters
nIDSpecifies the raw image ID.
nNewSrcIDSpecifies the ID of the new source.
bSaveOptionally, specifies whether or not to save the changes (default = true).
Returns
If the source ID is replaced, true is returned, otherwise false.

Definition at line 1713 of file Database.cs.

◆ Close()

virtual void MyCaffe.db.image.Database.Close ( )
virtual

Close the previously opened data source.

Reimplemented in MyCaffe.db.temporal.DatabaseTemporal.

Definition at line 277 of file Database.cs.

◆ ConvertRawImagesSaveToDatabase()

bool MyCaffe.db.image.Database.ConvertRawImagesSaveToDatabase ( int  nIdx,
int  nCount,
CancelEvent  evtCancel = null 
)

The ConvertRawImagesSaveToDatabase method saves the image in the file system to the database and deletes the file from the file system.

Parameters
nIdxSpecifies the first index of a RawImage to convert.
nCountSpecifies the number of RawImages to convert including and following the RawImage at the index.
evtCancelOptionally, specifies a cancellation event.
Returns
Upon full completion, true is returned, otherwise false is returned when cancelled.

Definition at line 2226 of file Database.cs.

◆ ConvertRawImagesSaveToFile()

bool MyCaffe.db.image.Database.ConvertRawImagesSaveToFile ( int  nIdx,
int  nCount,
CancelEvent  evtCancel = null 
)

The ConvertRawImagesSaveToFile method saves the image in the database to the file system and replaces the database data with the path to the saved image, thus saving database space.

Parameters
nIdxSpecifies the first index of a RawImage to convert.
nCountSpecifies the number of RawImages to convert including and following the RawImage at the index.
evtCancelOptionally, specifies a cancellation event.
Returns
Upon full completion, true is returned, otherwise false is returned when cancelled.

Definition at line 2126 of file Database.cs.

◆ CopyImageMean()

bool MyCaffe.db.image.Database.CopyImageMean ( int  nSrcIdSrc,
int  nSrcIdDst,
ConnectInfo  ci = null 
)

Copy the raw image mean from one source to another.

Parameters
nSrcIdSrcSpecifies the Data Source ID with the source image mean to copy.
nSrcIdDstSpecifies the Data Source ID with the destination image mean where the source is copied to.
ciOptionally, specifies a specific connection to use (default = null).
Returns
On success, true is returned, otherwise false.

Definition at line 2662 of file Database.cs.

◆ CreateRawImage()

RawImage MyCaffe.db.image.Database.CreateRawImage ( int  nIdx,
SimpleDatum  d,
int  nBackgroundWritingThreadCount,
string  strDescription = null,
int?  nOriginalSourceID = null,
bool  bActive = true 
)

Create a new RawImage but do not add it to the database.

Parameters
nIdxSpecifies the image index.
dSpecifies the SimpleDatum containing the data.
nBackgroundWritingThreadCountOptionally, specifies the background writing thread count, or 0 for to disable background writing (default = 0).
strDescriptionOptionally, specifies the description (default = null).
nOriginalSourceIDOptionally, specifies the original source ID (default = null)
bActiveOptionally, specifies whether the image is active or not (default = true).
Returns
The RawImage is returned.

Definition at line 1998 of file Database.cs.

◆ DeleteDataset()

virtual void MyCaffe.db.image.Database.DeleteDataset ( string  strDsName,
bool  bDeleteRelatedProjects,
Log  log,
CancelEvent  evtCancel 
)
virtual

Delete a dataset.

Parameters
strDsNameSpecifies the dataset name.
bDeleteRelatedProjectsSpecifies whether or not to also delete all projects using the dataset. WARNING! Use this with caution for it will permenantly delete the projects and their results.
logSpecifies the Log object for status output.
evtCancelSpecifies the cancel event used to cancel the delete.

Reimplemented in MyCaffe.db.temporal.DatabaseTemporal.

Definition at line 5088 of file Database.cs.

◆ DeleteLabelBoosts() [1/2]

void MyCaffe.db.image.Database.DeleteLabelBoosts ( int  nProjectId)

Delete all label boosts for a project.

Parameters
nProjectIdSpecifies the ID of a project.

Definition at line 932 of file Database.cs.

◆ DeleteLabelBoosts() [2/2]

void MyCaffe.db.image.Database.DeleteLabelBoosts ( int  nProjectId,
int  nSrcId = 0 
)

Delete all label boosts for a project.

Parameters
nProjectIdSpecifies the ID of a project.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 916 of file Database.cs.

◆ DeleteLabels()

void MyCaffe.db.image.Database.DeleteLabels ( int  nSrcId = 0)

Delete the labels of a data source from the database.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 733 of file Database.cs.

◆ DeleteModelGroup()

void MyCaffe.db.image.Database.DeleteModelGroup ( string  strGroup,
Log  log,
CancelEvent  evtCancel 
)

Deletes a model group from the database.

Parameters
strGroupSpecifies the name of the group.
logSpecifies the Log object for status output.
evtCancelSpecifies the cancel event used to cancel the delete.

Definition at line 5554 of file Database.cs.

◆ DeleteRawImageGroups()

void MyCaffe.db.image.Database.DeleteRawImageGroups ( )

Deletes all RawImage groups

Definition at line 3863 of file Database.cs.

◆ DeleteRawImageMeans()

void MyCaffe.db.image.Database.DeleteRawImageMeans ( int  nSrcId = 0)

Delete all RawImageMeans for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 2702 of file Database.cs.

◆ DeleteRawImageParameters()

void MyCaffe.db.image.Database.DeleteRawImageParameters ( int  nSrcId)

Delete all RawImage parameters within a data source.

Parameters
nSrcIdSpecifies the ID of the data source.

Definition at line 3637 of file Database.cs.

◆ DeleteRawImageResults()

void MyCaffe.db.image.Database.DeleteRawImageResults ( int  nSrcId = 0)

Delete all RawImageResults for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 2564 of file Database.cs.

◆ DeleteRawImages()

void MyCaffe.db.image.Database.DeleteRawImages ( int  nSrcId = 0)

Delete all RawImages in a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 2527 of file Database.cs.

◆ DeleteSource()

virtual bool MyCaffe.db.image.Database.DeleteSource ( int  nSrcId = 0)
virtual

Delete a data source from the database.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
Returns true if the source was found.

Reimplemented in MyCaffe.db.temporal.DatabaseTemporal.

Definition at line 4155 of file Database.cs.

◆ DeleteSourceData() [1/3]

void MyCaffe.db.image.Database.DeleteSourceData ( )

Deletes the data source data for the open data source.

Definition at line 3896 of file Database.cs.

◆ DeleteSourceData() [2/3]

virtual bool MyCaffe.db.image.Database.DeleteSourceData ( int  nSrcId = 0)
virtual

Delete the data source data (images, means, results and parameters) from the database.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
Returns true if the source was found.

Reimplemented in MyCaffe.db.temporal.DatabaseTemporal.

Definition at line 4225 of file Database.cs.

◆ DeleteSourceData() [3/3]

void MyCaffe.db.image.Database.DeleteSourceData ( string  strSrc)

Delete the data source data (images, means, results and parameters) from the database.

Parameters
strSrcSpecifies the data source name.

Definition at line 4247 of file Database.cs.

◆ DeleteSources()

void MyCaffe.db.image.Database.DeleteSources ( params string[]  rgstrSrc)

Delete the list of data sources, listed by name, from the database.

Parameters
rgstrSrcSpecifies the list of data sources.

Definition at line 4197 of file Database.cs.

◆ DisableAllLabels()

void MyCaffe.db.image.Database.DisableAllLabels ( int  nSrcId)

Disable all labels within the source specified by the ID.

Parameters
nSrcIdSpecifies the source ID.

Definition at line 1833 of file Database.cs.

◆ DisableAllNonMatchingImages()

int MyCaffe.db.image.Database.DisableAllNonMatchingImages ( int  nSrcId,
int  nWidth,
int  nHeight 
)

Disable all images that do not have a matching widxht size.

Parameters
nSrcIdSpecifies the source ID.
nWidthSpecifies the expected image width.
nHeightSpecifies the expected image height.
Returns
The number of images disabled is returned.

Definition at line 1847 of file Database.cs.

◆ DisableLabel()

void MyCaffe.db.image.Database.DisableLabel ( int  nSrcId,
int  nLabel,
bool  bOriginalLabel = false 
)

Disable a set of labels within the source specified by the ID.

Parameters
nSrcIdSpecifies the source ID.
nLabelSpecifies the label to disable.
bOriginalLabelSpecifies whether the label is the original label (true) or the active label (false).

Definition at line 1816 of file Database.cs.

◆ Dispose()

void MyCaffe.db.image.Database.Dispose ( )

Release any resources used.

Definition at line 82 of file Database.cs.

◆ FindDatasetFromSourceId()

int MyCaffe.db.image.Database.FindDatasetFromSourceId ( int  nSourceId)

Searches for the dataset containing the sourceId.

Parameters
nSourceIdSpecifies the source ID to look for.
Returns
If found, the dataset ID is returned, otherwise 0 is returned.

Definition at line 4594 of file Database.cs.

◆ FindDatasetNameFromSourceName()

string MyCaffe.db.image.Database.FindDatasetNameFromSourceName ( string  strTrainSrc,
string  strTestSrc 
)

Searches for the data set name based on the training and testing source names.

Parameters
strTrainSrcSpecifies the data source name for training.
strTestSrcSpecifies the data source name for testing.
Returns
If found, the dataset name is returned, otherwise null is returned.

Definition at line 4560 of file Database.cs.

◆ FindLabelInCache()

Label MyCaffe.db.image.Database.FindLabelInCache ( int  nLabel)

Search for a Label in the label cache.

Parameters
nLabelSpecifies the label.
Returns
When found, the Label is returned, otherwise null is returned.

Definition at line 447 of file Database.cs.

◆ FindRawImageGroup()

RawImageGroup MyCaffe.db.image.Database.FindRawImageGroup ( int  nIdx,
DateTime  dtStart,
DateTime  dtEnd 
)

Searches for a RawImageGroup by index, start time-stamp and end time-stamp.

Parameters
nIdxSpecifies the index of the raw image group.
dtStartSpecifies the start time-stamp of the image group.
dtEndSpecifies the end time-stamp of the image group.
Returns
If found, the RawImageGroup is returned, otherwise null is returned.

Definition at line 3830 of file Database.cs.

◆ FindRawImageGroupID()

int MyCaffe.db.image.Database.FindRawImageGroupID ( int  nIdx,
DateTime  dtStart,
DateTime  dtEnd 
)

Searches fro the RawImageGroup ID.

Parameters
nIdxSpecifies the index of the raw image group.
dtStartSpecifies the start time-stamp of the image group.
dtEndSpecifies the end time-stamp of the image group.
Returns
If found, the RawImageGroup ID is returned, otherwise 0 is returned.

Definition at line 3850 of file Database.cs.

◆ FixupRawImageCopy()

void MyCaffe.db.image.Database.FixupRawImageCopy ( int  nImageID,
int  nSecondarySrcId 
)

The FixupRawImageCopy method is used to fixup the OriginalSourceId by setting it to a secondary source ID in the event that the path created using the PrimarySourceID does not have the image data file.

When creating a copy of a Data Source that uses both training and testing Data Sources (e.g., re-arranging the time period used for training vs testing), it is important that the OriginalSourceID be set with the Data Source ID that holds the data file.

Parameters
nImageIDSpecifies the image to update.
nSecondarySrcIdSpecifies the secondary Source ID to use if the data file is not found.

Definition at line 2324 of file Database.cs.

◆ GetAllDatasets()

List< Dataset > MyCaffe.db.image.Database.GetAllDatasets ( int  nDatasetGroupID)

Returns a list of all datasets within a group.

Parameters
nDatasetGroupIDSpecifies the ID of the dataset group.
Returns
The list of Dataset entities is returned.

Definition at line 5144 of file Database.cs.

◆ GetAllDatasetsInModelGroup()

List< Dataset > MyCaffe.db.image.Database.GetAllDatasetsInModelGroup ( int  nModelGroupId)

Returns all Dataset entities within a given model group.

Parameters
nModelGroupIdSpecifies the ID of a model group.
Returns
The list of Dataset entities is returned.

Definition at line 5540 of file Database.cs.

◆ GetAllDatasetsWithCreator()

List< Dataset > MyCaffe.db.image.Database.GetAllDatasetsWithCreator ( int  nDsCreatorID,
bool?  bRelabeled = null 
)

Returns a list of all datasets within a group with dataset creators.

Parameters
nDsCreatorIDSpecifies the ID of the dataset creator.
bRelabeledOptionally, specifies whether or not only re-labeled datasets should be returned.
Returns
The list of Dataset entities is returned.

Definition at line 5185 of file Database.cs.

◆ GetAllDatasetsWithCreators()

List< Dataset > MyCaffe.db.image.Database.GetAllDatasetsWithCreators ( int  nDatasetGroupID)

Returns a list of all datasets within a group with dataset creators.

Parameters
nDatasetGroupIDSpecifies the ID of the dataset group.
Returns
The list of Dataset entities is returned.

Definition at line 5160 of file Database.cs.

◆ GetAllRawImageIndexes()

List< DbItem > MyCaffe.db.image.Database.GetAllRawImageIndexes ( bool  bBoostedOnly,
bool  bIncludeActive = true,
bool  bIncludeInactive = false 
)

Returns the list of the image indexes of all images.

Parameters
bBoostedOnlySpecifies to only retrieve boosted images.
bIncludeActiveOptionally, specifies to query active images (default = true).
bIncludeInactiveOptionally, specifies to query inactive images (default = false).
Returns
The image indexes are returned in a list.

Definition at line 1132 of file Database.cs.

◆ GetBoostCount()

int MyCaffe.db.image.Database.GetBoostCount ( int  nSrcId = 0,
string  strFilterVal = null,
int?  nBoostVal = null 
)

Return the number of boosted images for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strFilterValOptionally, specifies a parameter filtering value (default = null).
nBoostValOptionally, specifies a boost filtering value (default = null).
Returns
The number of boosted images is returned.

Definition at line 2748 of file Database.cs.

◆ GetDatabaseFilePath()

string MyCaffe.db.image.Database.GetDatabaseFilePath ( string  strName)

Query the physical database file path.

Parameters
strNameSpecifies the name of the database.
Returns
The physical file path is returned.

Definition at line 306 of file Database.cs.

◆ GetDatabaseImagePath()

string MyCaffe.db.image.Database.GetDatabaseImagePath ( string  strName)

Query the physical database file path for Images.

Parameters
strNameSpecifies the name of the database.
Returns
The physical file path is returned.

Definition at line 339 of file Database.cs.

◆ GetDataset() [1/3]

Dataset MyCaffe.db.image.Database.GetDataset ( int  nID,
ConnectInfo  ci = null 
)

Returns the Dataset entity for a dataset ID.

Parameters
nIDSpecifies the dataset ID.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The Dataset entity is returned.

Definition at line 4648 of file Database.cs.

◆ GetDataset() [2/3]

Dataset MyCaffe.db.image.Database.GetDataset ( string  strName)

Returns the Dataset entity for a dataset name.

Parameters
strNameSpecifies the dataset name.
Returns
The Dataset entity is returned.

Definition at line 4671 of file Database.cs.

◆ GetDataset() [3/3]

Dataset MyCaffe.db.image.Database.GetDataset ( string  strTestingSrc,
string  strTrainingSrc 
)

Returns the Dataset entity containing the training and testing source names.

Parameters
strTestingSrcSpecifies the data source name for testing.
strTrainingSrcSpecifies the data source name for training.
Returns
If found the Dataset entity is returned, otherwise null is returned.

Definition at line 4691 of file Database.cs.

◆ GetDatasetCreatorID()

int MyCaffe.db.image.Database.GetDatasetCreatorID ( string  strName)

Returns the ID of a dataset creator given its name.

Parameters
strNameSpecifies the name of the dataset creator.
Returns
Returns the ID of the dataset creator, or 0 if not found.

Definition at line 5249 of file Database.cs.

◆ GetDatasetCreatorName()

string MyCaffe.db.image.Database.GetDatasetCreatorName ( int  nDatasetCreatorID,
ConnectInfo  ci = null 
)

Returns the name of a dataset creator given its ID.

Parameters
nDatasetCreatorIDSpecifies the ID of the dataset creator.
ciOptionally, specifies a specific connection to use (default = null).
Returns
Returns name of the dataset creator, or null if not found.

Definition at line 5225 of file Database.cs.

◆ GetDatasetGroup()

DatasetGroup MyCaffe.db.image.Database.GetDatasetGroup ( int  nGroupID,
ConnectInfo  ci = null 
)

Returns the DatasetGroup entity given a group ID.

Parameters
nGroupIDSpecifies the ID of the group.
ciOptionally, specifies a specific connection to use (default = null).
Returns
If found, the DatasetGroup is returned, otherwise null is returned.

Definition at line 4897 of file Database.cs.

◆ GetDatasetGroupID()

int MyCaffe.db.image.Database.GetDatasetGroupID ( string  strName)

Returns the ID of a dataset group given its name.

Parameters
strNameSpecifies the name of the group.
Returns
Returns the ID of the dataset group, or 0 if not found.

Definition at line 5206 of file Database.cs.

◆ GetDatasetGroupName()

string MyCaffe.db.image.Database.GetDatasetGroupName ( int  nGroupID)

Returns the name of a dataset group given its ID.

Parameters
nGroupIDSpecifies the ID of the group.
Returns
The dataset group name is returned.

Definition at line 4915 of file Database.cs.

◆ GetDatasetID()

int MyCaffe.db.image.Database.GetDatasetID ( string  strName,
ConnectInfo  ci = null 
)

Returns a datasets ID given its name.

Parameters
strNameSpecifies the dataset name.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the dataset is returned.

Definition at line 4612 of file Database.cs.

◆ GetDatasetMaximumTimestamp()

DateTime MyCaffe.db.image.Database.GetDatasetMaximumTimestamp ( int  nDsID)

Returns the maximum time-stamp for a dataset.

Parameters
nDsIDSpecifies the ID of the dataset.
Returns
IF found, the maximum time-stamp is returned, otherwiseo the DateTime.MinValue is returned.

Definition at line 5328 of file Database.cs.

◆ GetDatasetMinimumTimestamp()

DateTime MyCaffe.db.image.Database.GetDatasetMinimumTimestamp ( int  nDsID)

Returns the minimum time-stamp for a dataset.

Parameters
nDsIDSpecifies the ID of the dataset.
Returns
IF found, the minimum time-stamp is returned, otherwiseo the DateTime.MinValue is returned.

Definition at line 5306 of file Database.cs.

◆ GetDatasetName()

string MyCaffe.db.image.Database.GetDatasetName ( int  nID,
ConnectInfo  ci = null 
)

Returns the name of a dataset given its ID.

Parameters
nIDSpecifies the dataset ID.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The dataset name is returned.

Definition at line 4632 of file Database.cs.

◆ GetDatasetParameter() [1/4]

string MyCaffe.db.image.Database.GetDatasetParameter ( int  nDsId,
string  strName 
)

Returns the value of a dataset parameter as a string.

Parameters
nDsIdSpecifies the ID of the dataset.
strNameSpecifies the name of the parameter.
Returns
If the parameter is found it is returned as a string, otherwise null is returned.

Definition at line 4957 of file Database.cs.

◆ GetDatasetParameter() [2/4]

bool MyCaffe.db.image.Database.GetDatasetParameter ( int  nDsId,
string  strName,
bool  bDefault 
)

Returns the value of a dataset parameter as a bool.

Parameters
nDsIdSpecifies the ID of the dataset.
strNameSpecifies the name of the parameter.
bDefaultSpecifies the default value to return if not found.
Returns
If the parameter is found it is returned as a bool, otherwise the default value is returned.

Definition at line 5011 of file Database.cs.

◆ GetDatasetParameter() [3/4]

double MyCaffe.db.image.Database.GetDatasetParameter ( int  nDsId,
string  strName,
double  dfDefault 
)

Returns the value of a dataset parameter as a double.

Parameters
nDsIdSpecifies the ID of the dataset.
strNameSpecifies the name of the parameter.
dfDefaultSpecifies the default value to return if not found.
Returns
If the parameter is found it is returned as a double, otherwise the default value is returned.

Definition at line 4994 of file Database.cs.

◆ GetDatasetParameter() [4/4]

int MyCaffe.db.image.Database.GetDatasetParameter ( int  nDsId,
string  strName,
int  nDefault 
)

Returns the value of a dataset parameter as an int.

Parameters
nDsIdSpecifies the ID of the dataset.
strNameSpecifies the name of the parameter.
nDefaultSpecifies the default value to return if not found.
Returns
If the parameter is found it is returned as an int, otherwise the default value is returned.

Definition at line 4977 of file Database.cs.

◆ GetDatasetParameters()

Dictionary< string, string > MyCaffe.db.image.Database.GetDatasetParameters ( int  nDsId,
ConnectInfo  ci = null 
)

Returns all dataset parameters for a given dataset.

Parameters
nDsIdSpecifies the ID of the dataset.
ciOptionally, specifies a specific connection to use (default = null).
Returns
A dictionary of the dataset parameters is returned.

Definition at line 4934 of file Database.cs.

◆ GetFirstTimeStamp()

DateTime MyCaffe.db.image.Database.GetFirstTimeStamp ( int  nSrcId = 0,
string  strDesc = null 
)

Returns the first time-stamp in the data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescOptionally, specifies a description to filter the values with (default = null, no filter).
Returns
If found, the time-stamp is returned, otherwise, DateTime.MinValue is returned.

Definition at line 4399 of file Database.cs.

◆ GetImageCount() [1/2]

int MyCaffe.db.image.Database.GetImageCount ( )

Returns the number of raw images in the database for the open data source.

Returns

Definition at line 1120 of file Database.cs.

◆ GetImageCount() [2/2]

int MyCaffe.db.image.Database.GetImageCount ( int  nSrcId = 0,
bool  bActive = true,
bool  bInactive = true,
ConnectInfo  ci = null 
)

Get the number of images in the source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
bActiveOptionally, specifies to get the active image count.
bInactiveOptionally, specifies to get the inactive image count.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The number of images is returned. When both 'bActive' and 'bInactive' are true the total image count is returned.

Definition at line 2820 of file Database.cs.

◆ getImagePath() [1/2]

string MyCaffe.db.image.Database.getImagePath ( byte[]  rgData)
protected

Returns the file path contained within a byte array or null if no path is found.

Parameters
rgDataSpecifies the bytes to check.
Returns
The actual embedded file path is returned if found, otherwise, null is returned.

Definition at line 1688 of file Database.cs.

◆ getImagePath() [2/2]

virtual string MyCaffe.db.image.Database.getImagePath ( string  strSrcName = null)
protectedvirtual

Returns the base image path used when saving binary data to the file system.

Returns
The base image path is returned.

Definition at line 250 of file Database.cs.

◆ GetLabel()

Label MyCaffe.db.image.Database.GetLabel ( int  nID)

Return the Label with the given ID.

Parameters
nIDSpecifies the Label ID.
Returns
When found, the Label with the ID is returned, otherwise null is returned.

Definition at line 399 of file Database.cs.

◆ GetLabelBoosts()

List< LabelBoost > MyCaffe.db.image.Database.GetLabelBoosts ( int  nProjectId,
bool  bSort = true,
int  nSrcId = 0 
)

Returns a list of all label boosts set on a project.

Parameters
nProjectIdSpecifies the ID of a project.
bSortOptionally, specifies whether or not to sort the labels by active label (default = true).
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
A list of LabelBoosts is returned.

Definition at line 967 of file Database.cs.

◆ GetLabelBoostsAsText()

string MyCaffe.db.image.Database.GetLabelBoostsAsText ( int  nProjectId,
int  nSrcId = 0,
bool  bSort = true 
)

Returns the Label boosts as a string.

Parameters
nProjectIdSpecifies the ID of a project.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
bSortOptionally, specifies whether or not to sort the labels by active label (default = true).
Returns

Definition at line 990 of file Database.cs.

◆ GetLabelCount()

int MyCaffe.db.image.Database.GetLabelCount ( int  nLabel)

Returns the number of images under a given label.

Parameters
nLabelSpecifies the label.
Returns
The number of images is returned.

Definition at line 479 of file Database.cs.

◆ GetLabelCountsAsText()

string MyCaffe.db.image.Database.GetLabelCountsAsText ( int  nSrcId = 0,
ConnectInfo  ci = null 
)

Returns the label counts for a given data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
A string containing the label counts is returned.

Definition at line 592 of file Database.cs.

◆ GetLabelID()

int MyCaffe.db.image.Database.GetLabelID ( int  nLabel)

Returns the label ID associated with a label value.

Parameters
nLabelSpecifies the label.
Returns
The ID of the Label is returned.

Definition at line 463 of file Database.cs.

◆ GetLabelName()

string MyCaffe.db.image.Database.GetLabelName ( int  nLabel,
int  nSrcId = 0 
)

Get the Label name of a label within a data source.

Parameters
nLabelSpecifies the label.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
When found, the Label is returned, otherwise null is returned.

Definition at line 416 of file Database.cs.

◆ GetLabels()

List< Label > MyCaffe.db.image.Database.GetLabels ( bool  bSort = true,
bool  bWithImagesOnly = false,
int  nSrcId = 0,
ConnectInfo  ci = null 
)

Returns a list of all labels used by a data source.

Parameters
bSortSpecifies to sort the labels by label.
bWithImagesOnlySpecifies to only return labels that actually have images associated with them.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
The list of labels is returned.

Definition at line 710 of file Database.cs.

◆ GetLastTimeStamp() [1/4]

DateTime MyCaffe.db.image.Database.GetLastTimeStamp ( DateTime  dtStart,
DateTime  dtEnd,
bool  bEndInclusive,
int  nSrcId = 0,
string  strDesc = null 
)

Returns the last time-stamp in the data source.

Parameters
dtStartSpecifies the start of the time range.
dtEndSpecifies the end of the time range.
bEndInclusiveSpecifies whether or not to include the end time in the range.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescOptionally, specifies a description to filter the values with (default = null, no filter).
Returns
If found, the time-stamp is returned, otherwise, DateTime.MinValue is returned.

Definition at line 4452 of file Database.cs.

◆ GetLastTimeStamp() [2/4]

DateTime MyCaffe.db.image.Database.GetLastTimeStamp ( DateTime  dtStart,
DateTime  dtEnd,
bool  bEndInclusive,
out int  nIndex,
int  nSrcId = 0,
string  strDesc = null 
)

Returns the last time-stamp and index in the data source falling within a time range.

Parameters
dtStartSpecifies the start of the time range.
dtEndSpecifies the end of the time range.
bEndInclusiveSpecifies whether or not to include the end time in the range.
nIndexReturns the index of the last item.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescOptionally, specifies a description to filter the values with (default = null, no filter).
Returns
If found, the time-stamp is returned, otherwise, DateTime.MinValue is returned.

Definition at line 4517 of file Database.cs.

◆ GetLastTimeStamp() [3/4]

DateTime MyCaffe.db.image.Database.GetLastTimeStamp ( int  nSrcId = 0,
string  strDesc = null 
)

Returns the last time-stamp in the data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescOptionally, specifies a description to filter the values with (default = null, no filter).
Returns
If found, the time-stamp is returned, otherwise, DateTime.MinValue is returned.

Definition at line 4424 of file Database.cs.

◆ GetLastTimeStamp() [4/4]

DateTime MyCaffe.db.image.Database.GetLastTimeStamp ( out int  nIndex,
int  nSrcId = 0,
string  strDesc = null 
)

Returns the last time-stamp and index in the data source.

Parameters
nIndexReturns the index of the last item.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescOptionally, specifies a description to filter the values with (default = null, no filter).
Returns
If found, the time-stamp is returned, otherwise, DateTime.MinValue is returned.

Definition at line 4484 of file Database.cs.

◆ GetModelGroup()

ModelGroup MyCaffe.db.image.Database.GetModelGroup ( int  nGroupID,
ConnectInfo  ci = null 
)

Returns the ModelGroup entity given the ID of a model group.

Parameters
nGroupIDSpecifies the ID of the model group.
ciOptionally, specifies a specific connection to use (default = null).
Returns
If found, the ModelGroup entity is returned, otherwise null is returned.

Definition at line 5487 of file Database.cs.

◆ GetModelGroupID()

int MyCaffe.db.image.Database.GetModelGroupID ( string  strGroup)

Retruns the ID of a model group given its name.

Parameters
strGroupSpecifies the name of the model group.
Returns
The ID of the model group is returned.

Definition at line 5523 of file Database.cs.

◆ GetModelGroupName()

string MyCaffe.db.image.Database.GetModelGroupName ( int  nGroupID)

Returns the name of a model group given its ID.

Parameters
nGroupIDSpecifies the ID of the model group.
Returns
The model group name is returned.

Definition at line 5505 of file Database.cs.

◆ getRawImage()

byte[] MyCaffe.db.image.Database.getRawImage ( byte[]  rgData,
int?  nSecondarySrcId = null,
ConnectInfo  ci = null,
DNNEntities  entities = null,
bool  bTestConnection = false 
)
protected

Converts a set of bytes from a file path-name by loading its bytes and returning them, or if the original bytes do not contain a path, just returns the original bytes.

Parameters
rgDataSpecifies the original bytes.
nSecondarySrcIdOptionally, specifies a secondary data Source ID (default = null).
ciOptionally, specifies a specific connection to use (default = null).
entitiesOptionally, specifies the entities to use.
bTestConnectionOptionally, specifies that the connection is being tested.
Returns
The actual data bytes (whether direct or loaded from file) are returned.

Definition at line 1588 of file Database.cs.

◆ GetRawImage()

RawImage MyCaffe.db.image.Database.GetRawImage ( int  nID)

Returns the RawImage with a given ID.

Parameters
nIDSpecifies the RawImage ID.
Returns
The RawImage is returned, or null if not found.

Definition at line 2494 of file Database.cs.

◆ GetRawImageAt()

RawImage MyCaffe.db.image.Database.GetRawImageAt ( int  nIdx,
int  nSrcId = 0 
)

Returns the RawImage at a given image index.

Parameters
nIdxSpecifies the image index to retrieve.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns

Definition at line 1334 of file Database.cs.

◆ GetRawImageData()

byte[] MyCaffe.db.image.Database.GetRawImageData ( RawImage  img,
bool  bLoadDataCriteria,
bool  bLoadDebugData,
out byte[]  rgDataCriteria,
out int?  nDataCriteriaFmtId,
out byte[]  rgDebugData,
out int?  nDebugDataFmtId 
)

Returns the raw data of the RawImage.

If the RawImage uses its Virtual ID, the RawImage with that ID is queried from the database and its raw data is returned.

Parameters
imgSpecifies the RawImage to use.
bLoadDataCriteriaSpecifies whether or not to load the data criteria data if any exists. When false, the data criteria data is not loaded from file.
bLoadDebugDataSpecifies whether or not to load the debug data if any exists. When false, the debug data is not loaded from file.
rgDataCriteriaReturns the image data criteria (if any).
nDataCriteriaFmtIdReturns the image data criteria format (if any).
rgDebugDataReturns the image debug data (if any).
nDebugDataFmtIdReturns the debug data format (if any).
Returns
The raw data is returned as a array of byte values.

Definition at line 1389 of file Database.cs.

◆ GetRawImageDataCriteria() [1/3]

byte[] MyCaffe.db.image.Database.GetRawImageDataCriteria ( byte[]  rgData,
int?  nOriginalSourceID = null 
)

Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data.

Parameters
rgDataSpecifies the raw data, which may contain an image path.
nOriginalSourceIDOptionally, specifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 1538 of file Database.cs.

◆ GetRawImageDataCriteria() [2/3]

byte[] MyCaffe.db.image.Database.GetRawImageDataCriteria ( int  nImgID,
int?  nOriginalSourceID = null 
)

Queries the Data Criteria for an image an Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data.

Parameters
nImgIDSpecifies the image ID that has the raw data, which may contain an image path.
nOriginalSourceIDOptionally, specifies the original source ID that stores the image.

You must Open the database with the source under which the image is stored.

Returns
The actual raw data is returned.

Definition at line 1552 of file Database.cs.

◆ GetRawImageDataCriteria() [3/3]

byte[] MyCaffe.db.image.Database.GetRawImageDataCriteria ( RawImage  img,
out int?  nDataCriteriaFmtId 
)

Returns the raw data criteria data of the RawImage.

If the RawImage uses its Virtual ID, the RawImage with that ID is queried from the database and its raw data is returned.

Parameters
imgSpecifies the RawImage to use.
nDataCriteriaFmtIdReturns the image data criteria format (if any).
Returns
The raw data criteria is returned as a array of byte values.

Definition at line 1431 of file Database.cs.

◆ GetRawImageDebugData() [1/3]

byte[] MyCaffe.db.image.Database.GetRawImageDebugData ( byte[]  rgData,
int?  nOriginalSourceID = null 
)

Converts the raw image debug data which may be stored as a path to the underlying data file, to the actual data.

Parameters
rgDataSpecifies the raw data, which may contain an image path.
nOriginalSourceIDOptionally, specifies the original source ID that stores the image.

You must Open the database with the source under which the image is stored.

Returns
The actual raw data is returned.

Definition at line 1495 of file Database.cs.

◆ GetRawImageDebugData() [2/3]

byte[] MyCaffe.db.image.Database.GetRawImageDebugData ( int  nImgID,
int?  nOriginalSourceID = null 
)

Queries the Debug Data for an image an Converts the raw image data criteria data which may be stored as a path to the underlying data file, to the actual data.

Parameters
nImgIDSpecifies the image ID that has the raw data, which may contain an image path.
nOriginalSourceIDOptionally, specifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 1506 of file Database.cs.

◆ GetRawImageDebugData() [3/3]

byte[] MyCaffe.db.image.Database.GetRawImageDebugData ( RawImage  img,
out int?  nDebugDataFormatId 
)

Returns the raw debug data data of the RawImage.

If the RawImage uses its Virtual ID, the RawImage with that ID is queried from the database and its raw data is returned.

Parameters
imgSpecifies the RawImage to use.
nDebugDataFormatIdReturns the image debug data format (if any).
Returns
The raw debug data is returned as a array of byte values.

Definition at line 1463 of file Database.cs.

◆ GetRawImageDistinctParameterDescriptions()

List< string > MyCaffe.db.image.Database.GetRawImageDistinctParameterDescriptions ( int  nSrcId = 0)

Returns a list of distinct RawImage parameter descriptions for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The list of distinct descriptions is returned.

Definition at line 3715 of file Database.cs.

◆ GetRawImageID()

int MyCaffe.db.image.Database.GetRawImageID ( DateTime  dt,
int  nSrcId = 0 
)

Returns the RawImage ID for the image with the given time-stamp.

Parameters
dtSpecifies the image time-stamp.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The ID of the RawImage is returned.

Definition at line 1359 of file Database.cs.

◆ GetRawImageMean()

RawImageMean MyCaffe.db.image.Database.GetRawImageMean ( int  nSrcId = 0,
ConnectInfo  ci = null 
)

Return the RawImageMean for the image mean from the open data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
The RawImageMean is returned if found, otherwise null is returned.

Definition at line 2583 of file Database.cs.

◆ GetRawImageParameter() [1/4]

bool MyCaffe.db.image.Database.GetRawImageParameter ( int  nRawImageID,
string  strName,
bool  bDefault 
)

Return the bool value of a RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
bDefaultSpecifies the default value to return if the RawImage or parameter are not found.
Returns
The parameter value is returned as a bool.

Definition at line 3467 of file Database.cs.

◆ GetRawImageParameter() [2/4]

double MyCaffe.db.image.Database.GetRawImageParameter ( int  nRawImageID,
string  strName,
double  dfDefault 
)

Return the double value of a RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
dfDefaultSpecifies the default value to return if the RawImage or parameter are not found.
Returns
The parameter value is returned as a double.

Definition at line 3450 of file Database.cs.

◆ GetRawImageParameter() [3/4]

int MyCaffe.db.image.Database.GetRawImageParameter ( int  nRawImageID,
string  strName,
int  nDefault 
)

Return the int value of a RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
nDefaultSpecifies the default value to return if the RawImage or parameter are not found.
Returns
The parameter value is returned as a int.

Definition at line 3433 of file Database.cs.

◆ GetRawImageParameter() [4/4]

string MyCaffe.db.image.Database.GetRawImageParameter ( int  nRawImageID,
string  strName,
string  strDefault 
)

Return the string value of a RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
strDefaultSpecifies the default value to return if the RawImage or parameter are not found.
Returns
The parameter value is returned as a string.

Definition at line 3413 of file Database.cs.

◆ GetRawImageParameterCount()

int MyCaffe.db.image.Database.GetRawImageParameterCount ( string  strName,
int  nSrcId = 0,
string  strType = "TEXT" 
)

Returns the RawImage parameter count for a data source.

Parameters
strNameSpecifies the parameter name.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strTypeOptionally, specifies the parameter type of 'TEXT', 'NUMERIC' or 'VALUE' (default = "TEXT").
Returns
The number of RawImage parameters is returned.

Definition at line 3654 of file Database.cs.

◆ GetRawImageParameterData()

byte[] MyCaffe.db.image.Database.GetRawImageParameterData ( int  nRawImageID,
string  strName 
)

Return the byte array data of a RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
Returns
The parameter byte array data is returned.

Definition at line 3483 of file Database.cs.

◆ GetRawImageParameterEx()

RawImageParameter MyCaffe.db.image.Database.GetRawImageParameterEx ( int  nRawImageID,
string  strName 
)

Returns the RawImageParameter entity given the image ID and parameter name..

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the parameter name.
Returns
The RawImageParameter entity is returned.

Definition at line 3502 of file Database.cs.

◆ GetRawImageParameterExist()

bool MyCaffe.db.image.Database.GetRawImageParameterExist ( string  strName,
int  nSrcId = 0,
string  strType = "TEXT" 
)

Returns whether or not a given RawImage parameter exists.

Parameters
strNameSpecifies the parameter name.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strTypeOptionally, specifies the parameter type of 'TEXT', 'NUMERIC' or 'VALUE' (default = "TEXT").
Returns
Returns true if the parameter exists, false otherwise.

Definition at line 3681 of file Database.cs.

◆ GetRawImageResultBatch()

List< Tuple< SimpleDatum, List< Result > > > MyCaffe.db.image.Database.GetRawImageResultBatch ( int  nBatchCount,
byte[]  rgResults 
)

Extracts the raw image result batch from the result binary data.

Parameters
nBatchCountSpecifies the number of results in the batch.
rgResultsSpecifies the binary batch data.
Returns
An array of tuples containing SimpleDatum/Result pairs is returned.

Definition at line 3293 of file Database.cs.

◆ GetRawImageResults()

List< RawImageResult > MyCaffe.db.image.Database.GetRawImageResults ( int  nSrcId = 0,
bool  bRequireExtraData = false,
int  nMax = -1 
)

Returns the RawImageResults for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
bRequireExtraDataOptionally, specifies whether or not the Extra 'target' data is required or not.
nMaxOptionally, specifies the maximum number of items to load.
Returns
The list of RawImageResults is returned.

Definition at line 3329 of file Database.cs.

◆ GetRawImagesAt() [1/2]

List< RawImage > MyCaffe.db.image.Database.GetRawImagesAt ( int  nIdx,
int  nCount,
int  nSrcId = 0,
string  strDescription = null 
)

Returns a list of RawImages from the database for a data source.

Parameters
nIdxSpecifies the starting image index.
nCountSpecifies the number of images to retrieve from the starting index nIdx.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescriptionOptionally, specifies a description to filter the images retrieved (when specified, only images matching the filter are returned) (default = null).
Returns

Definition at line 1243 of file Database.cs.

◆ GetRawImagesAt() [2/2]

List< RawImage > MyCaffe.db.image.Database.GetRawImagesAt ( List< int >  rgImageIdx,
int  nSrcId = 0,
string  strDescription = null 
)

Returns a list of RawImages from the database for a data source.

Parameters
rgImageIdxSpecifies the list of image indexes to query (maximum of 100).
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescriptionOptionally, specifies a description to filter the images retrieved (when specified, only images matching the filter are returned) (default = null).
Returns

Definition at line 1265 of file Database.cs.

◆ GetRawImagesAtID()

List< RawImage > MyCaffe.db.image.Database.GetRawImagesAtID ( List< int >  rgImageID,
int  nSrcId = 0,
string  strDescription = null 
)

Returns a list of RawImages from the database for a data source.

Parameters
rgImageIDSpecifies the list of image IDs to query (maximum of 100).
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
strDescriptionOptionally, specifies a description to filter the images retrieved (when specified, only images matching the filter are returned) (default = null).
Returns

Definition at line 1299 of file Database.cs.

◆ GetSource() [1/2]

Source MyCaffe.db.image.Database.GetSource ( int  nID,
ConnectInfo  ci = null 
)

Returns the Source entity given a data source ID.

Parameters
nIDSpecifies the ID of the data source.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The data source name is returned.

Definition at line 4071 of file Database.cs.

◆ GetSource() [2/2]

Source MyCaffe.db.image.Database.GetSource ( string  strName,
ConnectInfo  ci = null 
)

Returns the Source entity given a data source name.

Parameters
strNameSpecifies the data source name.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The Source entity is returned.

Definition at line 4051 of file Database.cs.

◆ GetSourceID()

int MyCaffe.db.image.Database.GetSourceID ( string  strName,
ConnectInfo  ci = null 
)

Returns the ID of a data source given its name.

Parameters
strNameSpecifies the data source name.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the data source is returned.

Definition at line 4018 of file Database.cs.

◆ GetSourceName()

string MyCaffe.db.image.Database.GetSourceName ( int  nID,
ConnectInfo  ci = null 
)

Returns the name of a data source given its ID.

Parameters
nIDSpecifies the ID of the data source.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The data source name is returned.

Definition at line 4035 of file Database.cs.

◆ GetSourceParameter() [1/4]

bool MyCaffe.db.image.Database.GetSourceParameter ( string  strName,
bool  bDefault,
int  nSrcId = 0 
)

Return the data source parameter as a bool.

Parameters
strNameSpecifies the parameter name.
bDefaultSpecifies the default value returned if the parameter is not found.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The parameter value is returned as a bool.

Definition at line 4344 of file Database.cs.

◆ GetSourceParameter() [2/4]

double MyCaffe.db.image.Database.GetSourceParameter ( string  strName,
double  dfDefault,
int  nSrcId = 0 
)

Return the data source parameter as a double.

Parameters
strNameSpecifies the parameter name.
dfDefaultSpecifies the default value returned if the parameter is not found.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The parameter value is returned as a double.

Definition at line 4326 of file Database.cs.

◆ GetSourceParameter() [3/4]

int MyCaffe.db.image.Database.GetSourceParameter ( string  strName,
int  nDefault,
int  nSrcId = 0 
)

Return the data source parameter as an int.

Parameters
strNameSpecifies the parameter name.
nDefaultSpecifies the default value returned if the parameter is not found.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The parameter value is returned as an int.

Definition at line 4308 of file Database.cs.

◆ GetSourceParameter() [4/4]

string MyCaffe.db.image.Database.GetSourceParameter ( string  strName,
int  nSrcId = 0 
)

Return the data source parameter as a string.

Parameters
strNameSpecifies the parameter name.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The parameter value is returned as a string.

Definition at line 4283 of file Database.cs.

◆ GetSourceParameters()

Dictionary< string, string > MyCaffe.db.image.Database.GetSourceParameters ( int  nSrcId = 0,
ConnectInfo  ci = null 
)

Returns a dictionary of the data source parameters.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
The dictionary of source parameter values is returned.

Definition at line 4258 of file Database.cs.

◆ LoadLabelCounts()

void MyCaffe.db.image.Database.LoadLabelCounts ( Dictionary< int, int >  rgCounts,
int  nSrcId = 0 
)

Load the label counts from the database for a data source.

Parameters
rgCountsSpecifies where the counts are loaded.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 569 of file Database.cs.

◆ Open() [1/2]

virtual void MyCaffe.db.image.Database.Open ( int  nSrcId,
FORCE_LOAD  nForceLoad = FORCE_LOAD.NONE,
ConnectInfo  ci = null 
)
virtual

Opens a data source.

Parameters
nSrcIdSpecifies the ID of the data source to open.
nForceLoadOptionally, specifies how to force load the data (default = NONE).
ciOptionally, specifies a specific connection to use (default = null).

Reimplemented in MyCaffe.db.temporal.DatabaseTemporal.

Definition at line 188 of file Database.cs.

◆ Open() [2/2]

void MyCaffe.db.image.Database.Open ( string  strSrc,
bool  bForceLoadImageFilePath = false 
)

Opens a data source.

Parameters
strSrcSpecifies the name of the data source to open.
bForceLoadImageFilePathOptionally, specifies to force load the image file path (default = false) and use file-based data.

Definition at line 211 of file Database.cs.

◆ PackExtraData()

static byte[] MyCaffe.db.image.Database.PackExtraData ( List< Tuple< DateTime, int > >  rg)
static

Pack the extra data into a byte array.

Parameters
rgSpecifies the extra data.
Returns
The byte array containing the extra data is returned.

Definition at line 3353 of file Database.cs.

◆ PutDataset()

int MyCaffe.db.image.Database.PutDataset ( Dataset  ds)

Save the Dataset entity to the database.

Parameters
dsSpecifies the Dataset entity.
Returns
The ID of the dataset is returned.

Definition at line 4855 of file Database.cs.

◆ PutRawImage()

int MyCaffe.db.image.Database.PutRawImage ( int  nIdx,
SimpleDatum  d,
string  strDescription = null 
)

Save a SimpleDatum as a RawImage in the database.

Parameters
nIdxSpecifies the image index.
dSpecifies the SimpleDatum containing the data.
strDescriptionOptionally, specifies a description for the RawImage (default = null).
Returns
The ID of the RawImage is returned.

Definition at line 2469 of file Database.cs.

◆ PutRawImageGroup()

int MyCaffe.db.image.Database.PutRawImageGroup ( RawImageGroup  g)

Adds a RawImageGroup to the database.

Parameters
gSpecifies the group to add.
Returns
The ID of the RawImageGroup is returned.

Definition at line 3790 of file Database.cs.

◆ PutRawImageMean()

int MyCaffe.db.image.Database.PutRawImageMean ( SimpleDatum  sd,
bool  bUpdate,
int  nSrcId = 0,
ConnectInfo  ci = null 
)

Save the SimpleDatum as a RawImageMean in the database.

Parameters
sdSpecifies the data.
bUpdateSpecifies whether or not to update the mean image.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the RawImageMean is returned.

Definition at line 2607 of file Database.cs.

◆ PutRawImageParameters()

void MyCaffe.db.image.Database.PutRawImageParameters ( List< ParameterData rgParam,
ConnectInfo  ci = null 
)

Save a list of raw image parameters.

Parameters
rgParamSpecifies the list of parameters to save.
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 2368 of file Database.cs.

◆ PutRawImageResultExtraData()

int MyCaffe.db.image.Database.PutRawImageResultExtraData ( int  nRawImageResultID,
byte[]  rgExtraData 
)

Set the raw image result extra data field.

Parameters
nRawImageResultIDSpecifies the ID of the raw image result to update.
rgExtraDataSpecifies the extra data to set.
Returns
The raw image result ID is returned, or 0 is returned if not found.

Definition at line 3307 of file Database.cs.

◆ PutRawImageResults() [1/2]

int MyCaffe.db.image.Database.PutRawImageResults ( int  nSrcId,
int  nIdx,
int  nLabel,
DateTime  dt,
List< Result rgResults,
bool  bInvert,
List< Tuple< DateTime, int > >  rgExtra = null 
)

Save the results of a Run as a RawImageResult.

Parameters
nSrcIdSpecifies the ID of the data source.
nIdxSpecifies the index of the result.
nLabelSpecifies the expected label of the result.
dtSpecifies the time-stamp of the result.
rgResultsSpecifies the results of the run as a list of (int nLabel, double dfReult) values.
bInvertSpecifies whether or not the results are inverted.
rgExtraOptionally, specifies the extra target data.
Returns

Definition at line 3199 of file Database.cs.

◆ PutRawImageResults() [2/2]

int MyCaffe.db.image.Database.PutRawImageResults ( int  nSrcId,
int  nIdx,
int  nLabel,
DateTime  dt,
List< Tuple< SimpleDatum, List< Result > > >  rgrgResults,
List< Tuple< DateTime, int > >  rgExtra = null 
)

Save the results of a Run as a RawImageResult.

Parameters
nSrcIdSpecifies the ID of the data source.
nIdxSpecifies the index of the result.
nLabelSpecifies the expected label of the result.
dtSpecifies the time-stamp of the result.
rgrgResultsSpecifies the time-synchronized batch of results of the run as a list of (int nLabel, double dfReult) values.
rgExtraOptionally, specifies the extra target data.
Returns

Definition at line 3248 of file Database.cs.

◆ PutRawImages()

void MyCaffe.db.image.Database.PutRawImages ( List< RawImage >  rgImg,
List< List< ParameterData > >  rgrgParam = null,
ConnectInfo  ci = null 
)

Saves a List of RawImages to the database.

Parameters
rgImgSpecifies the list of RawImages.
rgrgParamOptionally, specifies the List of parameters to also save for each RawImage (default = null).
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 2413 of file Database.cs.

◆ PutSource()

int MyCaffe.db.image.Database.PutSource ( Source  src,
ConnectInfo  ci = null 
)

Adds or updates (if exists) a data source to the database.

Parameters
srcSpecifies the Source entity to add.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the data source added is returned.

Definition at line 4090 of file Database.cs.

◆ QueryAllRawImageIDs()

List< int > MyCaffe.db.image.Database.QueryAllRawImageIDs ( int  nSrcId = 0,
int  nMax = int.MaxValue,
int  nLabel = -1,
int  nBoost = -1,
bool  bBoostIsExact = false,
bool  bAnnotatedOnly = false,
bool  bActiveOnly = true 
)

Returns the ID's of all RawImages within a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
nMaxOptionally, specifies the maximum number of ID's to query (default = int.MaxValue).
nLabelOptionally, specifies a label from which images are to be queried (default = -1, which ignores this parameter).
nBoostOptionally, specifies a boost from which images are to be queried (default = -1, which ignores this parameter).
bBoostIsExactOptionally, specifies whether the boost value is exact (true) or the minimum boost where all values equal are greater are retrieved (false). Default = false.
bAnnotatedOnlyOptionally, specifies to query annotated images only (default = false).
bActiveOnlyOptionally, specifies to query all images or only active images (default = true).
Returns
The List of RawImage ID's is returned.

Definition at line 1959 of file Database.cs.

◆ QueryRawImageCount()

int MyCaffe.db.image.Database.QueryRawImageCount ( int  nSrcId = 0)

Returns the number of RawImages in a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
The number of RawImages is returned.

Definition at line 2512 of file Database.cs.

◆ QueryRawImageParameters() [1/2]

List< RawImageParameter > MyCaffe.db.image.Database.QueryRawImageParameters ( int  nImageID)

Query all image parameters for a given image.

Parameters
nImageIDSpecifies the image ID who's image parameters are to be queried.
Returns
The list of any image parameters forund for the image are returned

Definition at line 1193 of file Database.cs.

◆ QueryRawImageParameters() [2/2]

List< RawImageParameter > MyCaffe.db.image.Database.QueryRawImageParameters ( int  nSrcId,
string  strName 
)

Query a list of all raw image parameters of a give name stored with a given source ID.

Parameters
nSrcIdSpecifies the source ID.
strNameSpecifies the parameter name.
Returns
The list of RawImageParameter values is returned.

Definition at line 1179 of file Database.cs.

◆ QueryRawImages() [1/2]

List< RawImage > MyCaffe.db.image.Database.QueryRawImages ( int  nSrcId,
bool?  bActive = null,
int  nBoostVal = 0,
bool  bExactBoostVal = false 
)

Returns the list of raw images that have a source ID from a selected list.

Parameters
nSrcIdSpecifies the source ID.
bActiveOptionally, specifies to query active (or non active) images (default = null, which queries all images).
nBoostValOptionally, specifies a boost value to query (default = 0, which ignores this filter).
bExactBoostValOptionally, specifies whether or not the boost value is an exact value or to be treated as a value greater than or equal to (default = false).
Returns
The list of RawImage's is returned.

Definition at line 1211 of file Database.cs.

◆ QueryRawImages() [2/2]

List< RawImage > MyCaffe.db.image.Database.QueryRawImages ( params int[]  rgSrcId)

Returns the list of raw images that have a source ID from a selected list.

Parameters
rgSrcIdSpecifies the list of source ID.
Returns
The list of RawImage's is returned.

Definition at line 1158 of file Database.cs.

◆ Refresh()

void MyCaffe.db.image.Database.Refresh ( )

Close and re Open with the current data source.

Definition at line 294 of file Database.cs.

◆ ReindexRawImages()

List< RawImage > MyCaffe.db.image.Database.ReindexRawImages ( Log  log,
CancelEvent  evtCancel,
int  nSrcId = 0 
)

Reindex the RawImages of a data source.

Parameters
logSpecifies the Log to use for status output.
evtCancelSpecifies the cancel event used to cancel the operation.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
Upon completion the list of raw images reindexed is returned, otherwise null is returned when cancelled.

Definition at line 2915 of file Database.cs.

◆ ResetAllActiveLabels()

void MyCaffe.db.image.Database.ResetAllActiveLabels ( int  nSrcId)

Reset the all active labels to their original label within a source.

Parameters
nSrcIdSpecifies the source ID.

Definition at line 1803 of file Database.cs.

◆ ResetAllBoosts()

void MyCaffe.db.image.Database.ResetAllBoosts ( int  nSrcId = 0,
int  nMinBoost = 0,
bool  bExactVal = false,
int  nDesiredBoostVal = -1 
)

Reset all image boosts for a data set.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
nMinBoostOptionally, specifies a minimum boost where all ActiveBoost values of this value or higher are reset (default = 0 which resets all boosts to their original setting).
bExactValOptionally, specifies that the min boost value is an exact value instead of a minimum value.
nDesiredBoostValOptionally, specifies the desired boost value (default = -1, which resets to the OriginalBoost value).

Definition at line 2848 of file Database.cs.

◆ ResetAllDatasetRelabelWithCreator()

void MyCaffe.db.image.Database.ResetAllDatasetRelabelWithCreator ( int  nDsCreatorID)

Reset all dataset relabel flags with a given creator.

Parameters
nDsCreatorIDSpecifies the ID of the dataset creator.

Definition at line 5266 of file Database.cs.

◆ ResetLabelBoosts()

void MyCaffe.db.image.Database.ResetLabelBoosts ( int  nProjectId)

Reset all label boosts to their orignal settings for a project.

Parameters
nProjectIdSpecifies the ID of a project.

Definition at line 945 of file Database.cs.

◆ ResetLabels()

void MyCaffe.db.image.Database.ResetLabels ( int  nProjectId = 0,
int  nSrcId = 0 
)

Resets all labels back to their original labels for a project.

Parameters
nProjectIdOptionally, specifies the ID of a project (default = 0).
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 894 of file Database.cs.

◆ SaveChanges()

void MyCaffe.db.image.Database.SaveChanges ( )

Saves any changes on the open satabase.

Definition at line 168 of file Database.cs.

◆ SaveLabelCache()

void MyCaffe.db.image.Database.SaveLabelCache ( )

Saves the label cache to the database.

Definition at line 517 of file Database.cs.

◆ SetDatasetParameter()

void MyCaffe.db.image.Database.SetDatasetParameter ( int  nDsId,
string  strName,
string  strValue 
)

Adds a new parameter or Sets the value of an existing dataset parameter.

Parameters
nDsIdSpecifies the ID of the dataset.
strNameSpecifies the name of the parameter.
strValueSpecifies the value of the parameter.

Definition at line 5027 of file Database.cs.

◆ SetDatasetParameters()

void MyCaffe.db.image.Database.SetDatasetParameters ( int  nDsId,
Dictionary< string, string >  rgP 
)

Adds a batch of new parametes.

Parameters
nDsIdSpecifies the ID of the dataset.
rgPSpecifies a dictionary of name,value pairs.

Definition at line 5059 of file Database.cs.

◆ setImageByteData()

byte[] MyCaffe.db.image.Database.setImageByteData ( byte[]  rgImg,
string  strType = null,
string  strGuid = null,
int  nBackgroundWritingThreadCount = 0 
)
protected

When enabled, saves the bytes to file and returns the file name of the binary file saved as an array of bytes..

The path format returned is 'FILE:filepath'

Parameters
rgImgSpecifies the bytes to check for a path.
strTypeSpecifies an extra name to add to the file name.
strGuidSpecifies an optional guid string to use as the file name.
nBackgroundWritingThreadCountOptionally, specifies the background writing thread count, or 0 for to disable background writing (default = 0).
Returns

Definition at line 2082 of file Database.cs.

◆ setImagePath()

virtual void MyCaffe.db.image.Database.setImagePath ( FORCE_LOAD  nForceLoad)
protectedvirtual

Sets the image path member to the path used when saving binary data to the file system.

Parameters
nForceLoadOptionally, specifies how to force load the data (default = NONE).

Definition at line 224 of file Database.cs.

◆ SetLabelMapping()

void MyCaffe.db.image.Database.SetLabelMapping ( LabelMapping  map,
int  nSrcId = 0 
)

Saves a label mapping in the database for a data source.

Parameters
mapSpecifies the label mapping.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 830 of file Database.cs.

◆ SetRawImageParameter() [1/2]

int MyCaffe.db.image.Database.SetRawImageParameter ( int  nRawImageID,
string  strName,
string  strValue,
double?  dfVal = null,
byte[]  rgData = null,
bool  bSave = true,
bool  bOnlyAddNew = false,
DNNEntities  entities = null 
)

Add a new RawImage parameter (or update an existing if found).

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
strValueSpecifies the value of the parameter as a string.
dfValSpecifies the value of the parameter as a numeric value (default = null).
rgDataOptionally, specifies the byte data associated with the parameter (default = null).
bSaveOptionally, specifies to save the data to the database (default = true).
bOnlyAddNewOptionally, specifies to only add the parameter if it doesnt exist (default = false).
entitiesOptionally, specifies the entities to use (default = null in which case the open data source entities are used).
Returns
The ID of the RawImageParameter is returned.

Definition at line 3527 of file Database.cs.

◆ SetRawImageParameter() [2/2]

int MyCaffe.db.image.Database.SetRawImageParameter ( int  nSrcId,
int  nRawImageID,
string  strName,
string  strValue,
double?  dfVal = null,
byte[]  rgData = null 
)

Add a new RawImage parameter (or update an existing if found).

Parameters
nSrcIdSpecifies the ID of the data source.
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
strValueSpecifies the value of the parameter as a string.
dfValSpecifies the value of the parameter as a numeric value (default = null).
rgDataOptionally, specifies the byte data associated with the parameter (default = null).
Returns
The ID of the RawImageParameter is returned.

Definition at line 3582 of file Database.cs.

◆ SetRawImageParameterAt()

int MyCaffe.db.image.Database.SetRawImageParameterAt ( DateTime  dt,
string  strName,
string  strValue,
double?  dfVal,
byte[]  rgData 
)

Set the RawImage parameter for all RawImages with the given time-stamp in the data source.

Parameters
dtSpecifies the time-stamp.
strNameSpecifies the name of the parameter.
strValueSpecifies the value of the parameter as a string.
dfValSpecifies the value of the parameter as a numeric value.
rgDataOptionally, specifies the byte data associated with the parameter (default = null).
Returns
The ID of the RawImageParameter is returned.

Definition at line 3623 of file Database.cs.

◆ SetSourceParameter()

void MyCaffe.db.image.Database.SetSourceParameter ( string  strName,
string  strValue,
int  nSrcId = 0 
)

Set the value of a data source parameter.

Parameters
strNameSpecifies the parameter name.
strValueSpecifies the value of the parameter.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 4361 of file Database.cs.

◆ UnpackExtraData()

static List< Tuple< DateTime, int > > MyCaffe.db.image.Database.UnpackExtraData ( byte[]  rg)
static

Unpack the extra data from a byte array.

Parameters
rgSpecifies the byte array containing the extra data.
Returns
The array of extra data is returned.

Definition at line 3376 of file Database.cs.

◆ UpdateActiveLabel()

bool MyCaffe.db.image.Database.UpdateActiveLabel ( int  nID,
int  nLabel,
bool  bActivate = true,
bool  bSaveChanges = true 
)

Update the label value of a label.

Parameters
nIDSpecifies the ID of the label.
nLabelSpecifies the new label value.
bActivateSpecifies whether or not to activate the image, the default = true.
bSaveChangesSpecifies whether or not to save the changes, the default = true.
Returns
If the Label is found and set, true is returned, otherwise false is returned.

Definition at line 1739 of file Database.cs.

◆ UpdateActiveLabelByID()

void MyCaffe.db.image.Database.UpdateActiveLabelByID ( int  nID,
int  nLabel 
)

Update the label value of a label.

Parameters
nIDSpecifies the ID of the image.
nLabelSpecifies the new label value.

Definition at line 1760 of file Database.cs.

◆ UpdateActiveLabelByIndex()

void MyCaffe.db.image.Database.UpdateActiveLabelByIndex ( int  nSrcId,
int  nIdx,
int  nLabel 
)

Update the label value of a label.

Parameters
nSrcIdSpecifies the source ID.
nIdxSpecifies the index of the image.
nLabelSpecifies the new label value.

Definition at line 1774 of file Database.cs.

◆ UpdateActiveLabelDirect()

void MyCaffe.db.image.Database.UpdateActiveLabelDirect ( int  nID,
int  nLabel 
)

Directly update the active label and activate the image with the specified ID.

Parameters
nIDSpecifies the image ID.
nLabelSpecifies the new active label.

Definition at line 1880 of file Database.cs.

◆ UpdateAllActiveLabels()

void MyCaffe.db.image.Database.UpdateAllActiveLabels ( int  nSrcId,
int  nLabel,
int?  nOriginalLabel 
)

Update the all items to a label value for the given nSrcId.

Parameters
nSrcIdSpecifies the source ID.
nLabelSpecifies the new label value.
nOriginalLabelOptionally, specifies the original label to relabel.

Definition at line 1788 of file Database.cs.

◆ UpdateBoost()

void MyCaffe.db.image.Database.UpdateBoost ( long  nImageID,
int  nBoost 
)

Update the image boost of a given image.

Parameters
nImageIDSpecifies the ID of the RawImage.
nBoostSpecifies the new boost value.

Definition at line 2883 of file Database.cs.

◆ UpdateBoosts()

void MyCaffe.db.image.Database.UpdateBoosts ( int  nSrcId,
DateTime  dtStart,
DateTime  dtEnd,
int  nBoost 
)

Update the boost of all images between a date range.

Parameters
nSrcIdSpecifies the data source ID.
dtStartSpecifies the start of the date range.
dtEndSpecifies the end of the date range.
nBoostSpecifies the new boost value.

Definition at line 2899 of file Database.cs.

◆ UpdateDatasetCounts() [1/2]

void MyCaffe.db.image.Database.UpdateDatasetCounts ( CancelEvent  evtCancel,
Log  log,
int  nDatasetCreatorID,
List< string >  rgstrDs,
string  strParamNameForDescription 
)

Updates the dataset counts for a set of datasets.

Parameters
evtCancelSpecifies a cancel event used to abort the process.
logSpecifies the Log used for status output.
nDatasetCreatorIDSpecifies the ID of the dataset creator.
rgstrDsSpecifies a list of the dataset names to update.
strParamNameForDescriptionSpecifies the parameter name used for descriptions.

Definition at line 5353 of file Database.cs.

◆ UpdateDatasetCounts() [2/2]

void MyCaffe.db.image.Database.UpdateDatasetCounts ( int  nDsId,
ConnectInfo  ci = null 
)

Update the dataset counts.

Parameters
nDsIdSpecifies the ID of the dataset to update.
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 4821 of file Database.cs.

◆ UpdateDatasetDescription()

void MyCaffe.db.image.Database.UpdateDatasetDescription ( int  nDsId,
string  strDesc 
)

Update the description of a given dataset.

Parameters
nDsIdSpecifies the ID of the dataset to update.
strDescSpecifies the new description.

Definition at line 4802 of file Database.cs.

◆ UpdateDatasetImageAnnotations()

void MyCaffe.db.image.Database.UpdateDatasetImageAnnotations ( int  nSrcId,
int  nImageId,
AnnotationGroupCollection  annotations,
bool  bSetLabelOnly 
)

Update the annotations of a given raw image.

Parameters
nSrcIdSpecifies the ID of the data source.
nImageIdSpecifies the ID of the RawImage to update.
annotationsSpecifies the new annotations to update.
bSetLabelOnlySpecifies to only set the label.

Definition at line 3125 of file Database.cs.

◆ UpdateDatasetRelabel()

void MyCaffe.db.image.Database.UpdateDatasetRelabel ( int  nDsID,
bool  bRelabel 
)

Update the dataset relabel flag for a dataset.

Parameters
nDsIDSpecifies the ID of the dataset.
bRelabelSpecifies the re-label flag.

Definition at line 5286 of file Database.cs.

◆ UpdateLabelBoost()

void MyCaffe.db.image.Database.UpdateLabelBoost ( int?  nTgtLbl,
bool  bTgtLblExact,
int?  nTgtBst,
bool  bTgtBstExact,
int?  nNewLbl,
int?  nNewBst,
params int[]  rgSrcId 
)

Update the label and boost for a given search target criteria.

Parameters
nTgtLblSpecifies the target label to replace, or null to ignore.
bTgtLblExactWhen a target label is specified, this parameter specifies whether to treat the target label as an exact value (true) for a minimum value (false).
nTgtBstSpecifies the target boost to replace, or null to ignore.
bTgtBstExactWhen a target boost is specified, this parameter specifies whether to treat the target boost as an exact value (true) for a minimum value (false).
nNewLblSpecifies the new label, or null to ignore.
nNewBstSpecifies the new boost, or null to ignore.
rgSrcIdSpecifies the SourceID's on which to alter the label and/or boost.

Definition at line 1053 of file Database.cs.

◆ UpdateLabelCounts() [1/3]

void MyCaffe.db.image.Database.UpdateLabelCounts ( Dictionary< int, int >  rgCounts,
DNNEntities  entities 
)

Updates the label counts in the database for the open data source.

Parameters
rgCountsSpecifies a dictionary containing (int nLabel, int nCount) pairs.
entitiesOptionally, specifies the entities to use.

Definition at line 543 of file Database.cs.

◆ UpdateLabelCounts() [2/3]

void MyCaffe.db.image.Database.UpdateLabelCounts ( Dictionary< int, int >  rgCounts,
int  nSrcId = 0 
)

Update the label counts for a given data source.

Parameters
rgCountsSpecifies the counts.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 627 of file Database.cs.

◆ UpdateLabelCounts() [3/3]

void MyCaffe.db.image.Database.UpdateLabelCounts ( int  nSrcId = 0,
int  nProjectId = 0,
ConnectInfo  ci = null 
)

Update the label counts for a given data source and project (optionally) by querying the database for the actual counts.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
nProjectIdOptionally, specifies the ID of a project to use (default = 0).
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 659 of file Database.cs.

◆ UpdateLabelMapping()

void MyCaffe.db.image.Database.UpdateLabelMapping ( int  nNewLabel,
List< int >  rgOriginalLabels,
int  nSrcId = 0 
)

Update a label mapping in the database for a data source.

Parameters
nNewLabelSpecifies the new label.
rgOriginalLabelsSpecifies the original labels that are to be mapped to the new label.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 866 of file Database.cs.

◆ UpdateLabelName()

void MyCaffe.db.image.Database.UpdateLabelName ( int  nLabel,
string  strName,
int  nSrcId = 0 
)

Update the name of a label.

Parameters
nLabelSpecifies the label.
strNameSpecifies the new name.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 363 of file Database.cs.

◆ UpdateRawImageDescription()

bool MyCaffe.db.image.Database.UpdateRawImageDescription ( int  nID,
string  strDescription 
)

Update the description of a RawImage.

Parameters
nIDSpecifies the ID of the RawImage.
strDescriptionSpecifies the new description.
Returns
If the RawImage is found and updated, true is returned, otherwise false is returned.

Definition at line 1902 of file Database.cs.

◆ UpdateRawImageDescriptionFromParameter()

bool MyCaffe.db.image.Database.UpdateRawImageDescriptionFromParameter ( int  nID,
string  strParamName 
)

Update the RawImage description from a RawImage parameter.

Parameters
nIDSpecifies the ID of the RawImage.
strParamNameSpecifies the RawImage parameter name.
Returns
If the RawImage is found and updated, true is returned, otherwise false is returned.

Definition at line 1921 of file Database.cs.

◆ UpdateRawImageSourceID()

bool MyCaffe.db.image.Database.UpdateRawImageSourceID ( int  nImageID,
int  nSrcID 
)

Updates a given image's source ID.

Parameters
nImageIDSpecifies the ID of the image to update.
nSrcIDSpecifies the new source ID.
Returns
If the source ID is updated, true is returned, otherwise false is returned.

Definition at line 2968 of file Database.cs.

◆ UpdateSaveImagesToFile()

void MyCaffe.db.image.Database.UpdateSaveImagesToFile ( bool  bSaveToFile,
int  nSrcId = 0 
)

Update the SaveImagesToFile flag in a given Data Source.

Parameters
bSaveToFileSpecifies whether images are saved to the file system (true), or the directly to the database (false).
nSrcIdOptionally, specifies a source ID to use. When 0, this parameter is ignored and the open Source is used instead.

Definition at line 3906 of file Database.cs.

◆ UpdateSource()

void MyCaffe.db.image.Database.UpdateSource ( int  nChannels,
int  nWidth,
int  nHeight,
bool  bDataIsReal,
int  nSrcId = 0 
)

Updates a data source.

Parameters
nChannelsSpecifies the number of channels per item.
nWidthSpecifies the width of each item.
nHeightSpecifies the height of each item.
bDataIsRealSpecifies whether or not the item uses real or byte data.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).

Definition at line 3934 of file Database.cs.

◆ UpdateSourceCounts() [1/2]

void MyCaffe.db.image.Database.UpdateSourceCounts ( ConnectInfo  ci = null)

Updates the source counts for the open data source by querying the database for the counts.

Parameters
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 3988 of file Database.cs.

◆ UpdateSourceCounts() [2/2]

void MyCaffe.db.image.Database.UpdateSourceCounts ( int  nImageCount,
ConnectInfo  ci = null 
)

Updates the source counts for the open data source.

Parameters
nImageCountSpecifies the new image count.
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 3967 of file Database.cs.

◆ VerifyDataConnection()

bool MyCaffe.db.image.Database.VerifyDataConnection ( string  strSrc,
ConnectInfo  ci 
)

Verify the data connection information.

Parameters
strSrcSpecifies the data source name to verify.
ciSpecifies the data connection information to verify.
Returns
On success, this method returns true and on error an exception is thrown.

Definition at line 94 of file Database.cs.

◆ WaitForFileWriter()

bool MyCaffe.db.image.Database.WaitForFileWriter ( int  nWait = int.MaxValue)

Wait for the file writer to complete writing all files.

Parameters
nWaitOptionally, specifies an amount of time to wait.
Returns
If all files have been written, true is returned.

Definition at line 2062 of file Database.cs.

Member Data Documentation

◆ m_bEnableFileBasedData

bool MyCaffe.db.image.Database.m_bEnableFileBasedData = false
protected

Specifies whether or not file based data is enabled.

Definition at line 41 of file Database.cs.

◆ m_nLastIndex

int MyCaffe.db.image.Database.m_nLastIndex = -1
protected

Specifies the last index added to the data source.

Definition at line 45 of file Database.cs.

◆ m_src

Source MyCaffe.db.image.Database.m_src = null
protected

Specifies the default data source.

Definition at line 27 of file Database.cs.

◆ m_strPrimaryImgPath

string MyCaffe.db.image.Database.m_strPrimaryImgPath = null
protected

Specifies the base path to the file based data.

Definition at line 33 of file Database.cs.

◆ m_strSecondaryImgPath

string MyCaffe.db.image.Database.m_strSecondaryImgPath = null
protected

Specifies the secondary base path to the file based data (used when copying a data source)


Definition at line 37 of file Database.cs.

Property Documentation

◆ CurrentSource

Source MyCaffe.db.image.Database.CurrentSource
get

Returns the current entity framwork Source object set during the previous call to Open().

Definition at line 177 of file Database.cs.

◆ LastIndex

int MyCaffe.db.image.Database.LastIndex
get

Returns the last image index added to the database.

Definition at line 142 of file Database.cs.


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