MyCaffe  0.11.2.9-beta1
Deep learning software for Windows C# programmers.
MyCaffe.db.image.DatasetFactory Class Reference

The DatasetFactory manages the connection to the Database object. More...

Inheritance diagram for MyCaffe.db.image.DatasetFactory:

Public Member Functions

 DatasetFactory ()
 The DatasetFactory constructor. More...
 
 DatasetFactory (bool bLoadDataCriteria, bool bLoadDebugData)
 The DatasetFactory constructor. More...
 
 DatasetFactory (DatasetFactory factory)
 The DatasetFactory constructor. More...
 
 DatasetFactory (int nSrcId)
 The DatasetFactory constructor. More...
 
void Dispose ()
 Releases all resources used. More...
 
void SetLoadingParameters (bool bLoadDataCriteria, bool bLoadDebugData)
 Sets the loading parameters that are used to determine which data to load with each image. 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...
 
void SaveChanges ()
 Save the changes on the open data source. More...
 
void Open (SourceDescriptor src, int nCacheMax=500, ConnectInfo ci=null)
 Open a given data source. More...
 
void Open (int nSrcId, int nCacheMax=500, Database.FORCE_LOAD nForceLoad=Database.FORCE_LOAD.NONE, Log log=null, ConnectInfo ci=null)
 Open a given data source. More...
 
void Close ()
 Close the current data source used. More...
 
void Refresh ()
 Close and re-open the current data source used. More...
 
void PutRawImageParameterCache (int nImageID, string strParam, string strVal, double? dfVal, byte[] rgData, bool bOnlyAddNew)
 Add a new parameter to the parameter cache making sure to save once a maximum count is reached. More...
 
void ClearParamCache (bool bSave)
 Clear the param cache and save when specified. More...
 
void PutRawImageCache (int nIdx, SimpleDatum sd, int nBackgroundWritingThreadCount=0, string strDescription=null, bool bActive=true, params ParameterData[] rgParams)
 Add a SimpleDatum to the RawImage cache. More...
 
void ClearImageCache (bool bSave)
 Clear the RawImage cache and optionally save the images. More...
 
int PutRawImage (int nIdx, SimpleDatum sd, string strDescription=null)
 Save a SimpleDatum to the database. More...
 
int SetRawImageParameter (int nRawImageID, string strName, string strValue, double? dfVal=null, byte[] rgData=null, bool bOnlyAddNew=false)
 Add a new or Set an existing RawImage parameter. More...
 
int SetRawImageParameterAt (DateTime dt, string strName, string strValue, double? dfVal=null, byte[] rgData=null)
 Set the RawImage parameter for all RawImages with the given time-stamp in the data source. 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...
 
RawImageMean GetRawImageMean ()
 Return the RawImageMean for the open data source. More...
 
List< RawImage > GetRawImagesAt (int nImageIdx, int nImageCount, 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, ManualResetEvent evtCancel, 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, ManualResetEvent evtCancel, int nSrcId=0, string strDescription=null)
 Returns a list of RawImages from the database for a data source. More...
 
List< RawImage > GetRawImagesAt (List< DbItem > rgImgItems, ManualResetEvent evtCancel, int nSrcId=0, string strDescription=null)
 Returns a list of RawImages from the database for a data source. More...
 
List< SimpleDatumGetImagesAt (List< int > rgImageIdx, ManualResetEvent evtCancel, int nSrcId=0, string strDescription=null)
 Returns a list of SimpleDatum from the database for a data source. More...
 
List< SimpleDatumGetImagesAt (List< DbItem > rgImageItems, ManualResetEvent evtCancel, int nSrcId=0, string strDescription=null)
 Returns a list of SimpleDatum from the database for a data source. More...
 
List< SimpleDatumGetImagesAtID (List< int > rgImageId, int nSrcId=0, string strDescription=null)
 Returns a list of SimpleDatum from the database for a data source. More...
 
List< RawImage > QueryRawImages (int nSrcId, bool? bActive=null, bool bLoadCriteria=false, bool bLoadDebug=false, Log log=null, CancelEvent evtCancel=null, int nBoostVal=0, bool bExactBoostVal=false)
 Returns the list of raw images that have a source ID from a selected list. More...
 
void LoadRawImageData (RawImage img, bool bLoadCriteria, bool bLoadDebug)
 Returns the list of raw images that have a source ID from a selected list. More...
 
int PutRawImageMean (SimpleDatum sd, bool bUpdate, ConnectInfo ci=null)
 Save the SimpleDatum as a RawImageMean in the database for the open data source. More...
 
bool SaveImageMean (SimpleDatum sd, bool bUpdate, int nSrcId=0)
 Save the SimpleDatum as a RawImageMean in the database. More...
 
SimpleDatum QueryImageMean (int nSrcId=0)
 Return the SimpleDatum for the image mean from the open data source. More...
 
bool CopyImageMean (string strSrcSrc, string strDstSrc)
 Copy the raw image mean from one source to another. More...
 
int GetImageCount ()
 Returns the number of images in the database for the open data source. More...
 
List< int > QueryRawImageIDs (int nSrcId=0, int nMax=int.MaxValue, int nLabel=-1, int nBoost=-1, bool bBoostIsExact=false, bool bAnnotatedOnly=false)
 Returns all raw image IDs for a given data source. More...
 
int GetRawImageMeanID (int nSrcId=0)
 Returns the raw image ID for the image mean associated with a data source. More...
 
int GetRawImageID (DateTime dt, int nSrcId=0)
 Returns the RawImage ID for the image with the given time-stamp. More...
 
RawImage GetRawImageFromID (int nImageID)
 Returns the raw image with a specified image ID. More...
 
void DeleteRawImageResults (int nSrcId=0)
 Delete all RawImageResults for a data source. More...
 
int PutRawImageResults (int nSrcId, int nIdx, int nLabel, DateTime dt, List< Result > rgResults, bool bInvert)
 Save the results of a Run as a RawImageResult. More...
 
int AddRawImageGroup (Image img, int nIdx, DateTime dtStart, DateTime dtEnd, List< double > rgProperties)
 Adds a new RawImage group to the database. More...
 
int FindRawImageGroupID (int nIdx, DateTime dtStart, DateTime dtEnd)
 Searches fro the RawImageGroup ID. More...
 
List< string > GetRawImageDistinctParameterDescriptions (int nSrcId)
 Returns a list of distinct RawImage parameter descriptions for a data source. More...
 
byte [] GetRawImageParameterData (int nRawImageID, string strParam)
 Return the byte array data of a RawImage parameter. More...
 
int GetRawImageParameterCount (string strParam, 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...
 
bool UpdateActiveLabel (int nImageID, int nNewActiveLabel, bool bActivate=true, bool bSaveChanges=true)
 Update the active label on a given raw image. More...
 
void UpdateActiveLabelDirect (int nID, int nLabel)
 Directly update the active label and activate the image with the specified ID. More...
 
void UpdateAllActiveLabelsDirect (int nLabel)
 Directly update all active labels and activate all of the images for the open Source ID. More...
 
void UpdateActiveLabelByIndex (int nIdx, int nNewActiveLabel)
 Update the active label on a given raw image by its index. More...
 
void ActivateRawImageByIndex (int nIdx, bool bActive)
 Activate/deactivate a raw image based on its index. More...
 
void UpdateRawImageSourceID (int nImageID, int nSrcID)
 Change the source ID on an image to another source ID. More...
 
bool ActivateRawImage (int nImageID, bool bActive, bool bSave=true)
 Activate/Deactivate a given image. More...
 
void ActivateAllRawImages (bool bActive, bool bAnnotatedOnly, params int[] rgSrcId)
 Activates all images with the given 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 FixupRawImageCopy (int nImageID, int nSecondarySrcId)
 The FixupRawImageCopy function is used to fix errors in the copy source ID of a copied raw image. For original images, this function does nothing. More...
 
byte [] GetRawImageDataCriteria (byte[] rgData, int nOriginalSourceID)
 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)
 Queries the Data Criteria data for an image and then 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 (byte[] rgData, int nOriginalSourceID)
 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)
 Queries the Debug data for an image and then converts the raw image debug data which may be stored as a path to the underlying data file, to the actual data. More...
 
void UpdateDatasetImageAnnotations (int nSrcId, int nImageId, AnnotationGroupCollection annotations)
 Update the annotations on a given RawImage. More...
 
List< LabelBoostDescriptorGetLabelBoosts (int nProjectId, int nSrcId=0)
 Returns a list of all label boosts set on a 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 AddLabelBoost (int nProjectId, int nLabel, double dfBoost, int nSrcId=0)
 Add a label boost to the database for a given project. More...
 
string GetLabelBoostsAsText (int nProjectId, int nSrcId=0, bool bSort=true)
 Returns the Label boosts as a string. More...
 
Dictionary< int, int > LoadLabelCounts (int nSrcId=0)
 Load the label counts from the database for a data source. More...
 
void UpdateLabelCounts (Dictionary< int, int > rgCounts)
 Updates the label counts in the database for the open data source. More...
 
void UpdateLabelCounts (int nSrcId=0, int nProjectId=0)
 Update the label counts for a given data source and project (optionally) by querying the database for the actual counts. More...
 
string GetLabelCountsAsText (int nSrcId)
 Returns the label counts for a given data source. More...
 
void UpdateLabelName (int nLabel, string strName, int nSrcId=0)
 Update the name of a label. More...
 
string GetLabelName (int nLabel, int nSrcId=0)
 Get the Label name of a label within a data source. 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 DeleteLabels (int nSrcId=0)
 Delete the labels of a data source from the database. 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...
 
List< Label > QueryLabels (int nSrcId=0, ConnectInfo ci=null)
 Query the list of labels for a given source. More...
 
int GetSourceID (string strName)
 Returns the ID of a data source given its name. More...
 
string GetSourceName (int nId)
 Returns the name of a data source given its ID. More...
 
int AddSource (SourceDescriptor src, ConnectInfo ci=null, bool? bSaveImagesToFileOverride=null)
 Adds a new 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...
 
void DeleteSources (params string[] rgstrSrc)
 Delete the list of data sources, listed by name, from the database. More...
 
void DeleteSourceData (int nSrcId=0)
 Delete the data source data (images, means, results and parameters) from the database. 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...
 
bool ReindexRawImages (Log log, CancelEvent evtCancel, int nSrcId=0, bool bCreateImageMean=false)
 Reindex the RawImages of a data source. More...
 
void UpdateSource (int nChannels, int nWidth, int nHeight, bool bDataIsReal, int nSrcId=0)
 Updates a data source. More...
 
void UpdateSourceCounts ()
 Saves the label cache, updates the label counts from the database and then updates the source counts from the database. More...
 
void SetSourceParameter (string strParam, string strValue, int nSrcId=0)
 Set the value of a data source parameter. More...
 
string GetSourceParameter (string strParam, int nSrcId=0)
 Return the data source parameter as a string. More...
 
int GetSourceParameter (string strParam, int nDefault, int nSrcId=0)
 Return the data source parameter as an int. More...
 
bool GetSourceParameter (string strParam, bool bDefault, int nSrcId=0)
 Return the data source parameter as a bool. More...
 
double GetSourceParameter (string strParam, double dfDefault, int nSrcId=0)
 Return the data source parameter as a double. 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 from within a time period. 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 within a given time range. More...
 
int GetDatasetID (string strDsName, 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...
 
int AddDataset (DatasetDescriptor ds, ConnectInfo ci=null, bool? bSaveImagesToFileOverride=null)
 Adds or updates the training source, testing source, dataset creator and dataset to the database. More...
 
int AddDataset (int nDsCreatorID, string strName, int nTestSrcId, int nTrainSrcId, int nDsGroupID=0, int nModelGroupID=0, ConnectInfo ci=null)
 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)
 Updates the dataset counts, and training/testing source counts. More...
 
void UpdateDatasetCounts (CancelEvent evtCancel, Log log, int nDatasetCreatorID, List< string > rgstrDs, string strParamNameForDescription)
 Updates the dataset counts for a set of datasets. 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...
 
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...
 
void SetDatasetParameters (int nDsId, Dictionary< string, string > rgP)
 Set a batch of dataset parameters. More...
 
void SetDatasetParameter (int nDsId, string strParam, string strValue)
 Adds a new parameter or Sets the value of an existing dataset parameter. More...
 
string GetDatasetParameter (int nDsId, string strParam)
 Returns the value of a dataset parameter as a string. More...
 
int GetDatasetParameter (int nDsId, string strParam, int nDefault)
 Returns the value of a dataset parameter as an int. More...
 
bool GetDatasetParameter (int nDsId, string strParam, bool bDefault)
 Returns the value of a dataset parameter as a bool. More...
 
double GetDatasetParameter (int nDsId, string strParam, double dfDefault)
 Returns the value of a dataset parameter as a double. More...
 
int GetDatasetGroupID (string strName)
 Returns the ID of a dataset group given its name. More...
 
List< DbItemLoadImageIndexes (bool bBoostedOnly, bool bIncludeActive=true, bool bIncludeInactive=false)
 Returns a list of the image indexes of all boosted images in the Data Source. More...
 
List< ImageDescriptorLoadImages (CancelEvent evtCancel, params int[] rgSrcId)
 Load the image descriptors for a set of given source ID's. More...
 
SimpleDatum LoadDatum (int nImageId, int nChannels, bool bDataIsReal, int nLabel, int nSrcId=0)
 Loads a new SimpleDataum from a RawImage ID. More...
 
SimpleDatum LoadDatum (RawImage img, int nPadW=0, int nPadH=0)
 Loads a new SimpleDatum from a RawImage. More...
 
SimpleDatum LoadDatum (RawImageMean img, int nPadW=0, int nPadH=0)
 Loads a new image mean from a RawImageMean. More...
 
SimpleDatum LoadImage (int nImageId, int nSrcId=0)
 Returns the image at a given image ID. More...
 
SimpleDatum LoadImageMean (int nSrcId, ConnectInfo ci=null)
 Returns the image mean for a give data source. More...
 
SimpleDatum LoadImageAt (int nIdx, bool? bLoadDataCriteria=null, bool? bLoadDebugData=null, int nSrcId=0, int nPadW=0, int nPadH=0)
 Load an image at a given index. More...
 
void LoadRawData (SimpleDatum sd, bool bLoadDataCriteria, bool bLoadDebugData)
 Load the data criteria and/or debug data. More...
 
List< LabelDescriptorLoadLabels (int nSrcId=0, bool bSort=true, bool bWithImagesOnly=false, ConnectInfo ci=null)
 Load a list of LabelDescriptors for a data source. More...
 
SourceDescriptor LoadSource (string strSource)
 Load the source descriptor from a data source name. More...
 
SourceDescriptor LoadSource (int nSrcId, ConnectInfo ci=null)
 Load the source descriptor from a data source ID. More...
 
ParameterDescriptorCollection LoadSourceParameters (int nSrcId, ConnectInfo ci=null)
 Loads the data source parameters for a given source. More...
 
GroupDescriptor LoadDatasetGroup (int nGroupId, ConnectInfo ci=null)
 Load a dataset group descriptor from a group ID. More...
 
GroupDescriptor LoadModelGroup (int nGroupId, ConnectInfo ci=null)
 Load a model group descriptor from a group ID. More...
 
DatasetDescriptor LoadDataset (string strDataset, ConnectInfo ci=null)
 Load a dataset descriptor from a dataset name. More...
 
DatasetDescriptor LoadDataset (int nDatasetID, ConnectInfo ci=null)
 Load a dataset descriptor from a dataset ID. More...
 
DatasetDescriptor LoadDataset (int nDatasetID, string strDataset)
 Load a dataset descriptor from a dataset ID or name, where the ID is tried first and name second. More...
 
DatasetDescriptor LoadDataset (string strTestingSrc, string strTrainingSrc)
 Load the dataset descriptor that contains the testing and training data source names. More...
 
List< DatasetDescriptorLoadAllDatasetsWithCreators (int nGroupId)
 Loads all dataset descriptors within a group that have a creator. More...
 
List< DatasetDescriptorLoadAllDatasetsWithCreator (int nCreatorID, bool? bRelabeled=null)
 Loads all dataset descriptors with a given dataset creator. More...
 
ParameterDescriptorCollection LoadDatasetParameters (int nDsId, ConnectInfo ci=null)
 Loads the dataset parameters for a given dataset. More...
 
List< ResultDescriptorLoadRawImageResults (int nSrcId=0)
 Loads a list of RawImage results for a data source. More...
 

Protected Member Functions

virtual DatasetDescriptor loadDataset (Dataset ds, ConnectInfo ci=null)
 Loads a dataset creator from a Dataset entity. More...
 

Protected Attributes

Database m_db = new Database()
 Specifies the Database managed. More...
 
SourceDescriptor m_openSource = null
 Specifies the open source descriptor (if any). More...
 
int m_nOriginalSourceID = null
 Specifies the original source ID (if any). More...
 
bool m_bLoadDataCriteria = false
 Specifies whether or not to load the data criteria data if any exists. When false, the data criteria data is not loaded from file (default = false). More...
 
bool m_bLoadDebugData = false
 Specifies whether or not to load the debug data if any exists. When false, the debug data is not loaded from file (default = false). More...
 
ConnectInfo m_ciOpen = null
 Specifies the connection information used on open. More...
 

Properties

int LastIndex [get]
 Returns the index of the last image added to the database. More...
 
bool LoadDataCriteria [get]
 Returns whether or not the image data criteria is to be loaded when loading each image. More...
 
bool LoadDebugData [get]
 Returns whether or not the image debug data is to be loaded when loading each image. More...
 
SourceDescriptor OpenSource [get]
 Returns the currently open data source. More...
 
int OriginalSourceID [get, set]
 Get/set the original source ID (if any). This field is used when copying a source and using the virutal image reference, but retaining the original source ID for the internal image lookup. More...
 

Detailed Description

The DatasetFactory manages the connection to the Database object.

Definition at line 17 of file DatasetFactory.cs.

Constructor & Destructor Documentation

◆ DatasetFactory() [1/4]

MyCaffe.db.image.DatasetFactory.DatasetFactory ( )

The DatasetFactory constructor.

Definition at line 51 of file DatasetFactory.cs.

◆ DatasetFactory() [2/4]

MyCaffe.db.image.DatasetFactory.DatasetFactory ( bool  bLoadDataCriteria,
bool  bLoadDebugData 
)

The DatasetFactory constructor.

Parameters
bLoadDataCriteriaOptionally, specifies to load the data criteria when loading images.
bLoadDebugDataOptionally, specifies to load the debug data when loading images.

Definition at line 61 of file DatasetFactory.cs.

◆ DatasetFactory() [3/4]

MyCaffe.db.image.DatasetFactory.DatasetFactory ( DatasetFactory  factory)

The DatasetFactory constructor.

Parameters
factorySpecifies the DatasetFactory to create this one from.

Definition at line 72 of file DatasetFactory.cs.

◆ DatasetFactory() [4/4]

MyCaffe.db.image.DatasetFactory.DatasetFactory ( int  nSrcId)

The DatasetFactory constructor.

Parameters
nSrcIdSpecifies the data source ID of data source to open within the constructor.

Definition at line 82 of file DatasetFactory.cs.

Member Function Documentation

◆ ActivateAllRawImages() [1/2]

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

Activates all images with the given source ID's.

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

Definition at line 896 of file DatasetFactory.cs.

◆ ActivateAllRawImages() [2/2]

void MyCaffe.db.image.DatasetFactory.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 911 of file DatasetFactory.cs.

◆ ActivateFiltered()

int MyCaffe.db.image.DatasetFactory.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 1299 of file DatasetFactory.cs.

◆ ActivateLabels()

void MyCaffe.db.image.DatasetFactory.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 1171 of file DatasetFactory.cs.

◆ ActivateRawImage()

bool MyCaffe.db.image.DatasetFactory.ActivateRawImage ( int  nImageID,
bool  bActive,
bool  bSave = true 
)

Activate/Deactivate a given image.

Parameters
nImageIDSpecifies the ID of the image to activate/deactivate.
bActiveSpecifies 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 885 of file DatasetFactory.cs.

◆ ActivateRawImageByIndex()

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

Activate/deactivate a raw image based on its index.

Parameters
nIdxSpecifies the raw image index.
bActiveSpecifies the new active state of the image to set.

Definition at line 863 of file DatasetFactory.cs.

◆ AddDataset() [1/2]

int MyCaffe.db.image.DatasetFactory.AddDataset ( DatasetDescriptor  ds,
ConnectInfo  ci = null,
bool?  bSaveImagesToFileOverride = null 
)

Adds or updates the training source, testing source, dataset creator and dataset to the database.

Parameters
ds
ciOptionally, specifies a specific connection to use (default = null).
bSaveImagesToFileOverrideOptionally, specifies the save images to file override, or null to ignore (default = null).
Returns
The dataset ID is returned.

Definition at line 1563 of file DatasetFactory.cs.

◆ AddDataset() [2/2]

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

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).
Returns
The dataset ID is returned.

Definition at line 1587 of file DatasetFactory.cs.

◆ AddLabel()

int MyCaffe.db.image.DatasetFactory.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 1151 of file DatasetFactory.cs.

◆ AddLabelBoost()

void MyCaffe.db.image.DatasetFactory.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 1063 of file DatasetFactory.cs.

◆ AddRawImageGroup()

int MyCaffe.db.image.DatasetFactory.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 754 of file DatasetFactory.cs.

◆ AddSource() [1/2]

int MyCaffe.db.image.DatasetFactory.AddSource ( SourceDescriptor  src,
ConnectInfo  ci = null,
bool?  bSaveImagesToFileOverride = null 
)

Adds a new data source to the database.

Parameters
srcSpecifies source desciptor to add.
ciOptionally, specifies a specific connection to use (default = null).
bSaveImagesToFileOverrideOptionally, specifies the save images to file override, or null to ignore (default = null).
Returns
The ID of the data source added is returned.

Definition at line 1237 of file DatasetFactory.cs.

◆ AddSource() [2/2]

int MyCaffe.db.image.DatasetFactory.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 (and has virtual raw image references). The default of 0 specifies that this is an original source.
bSaveImagesToFileOptionally, specifies whether or not to save the images to the file system (true) or directly into the database (false). The default is true.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The ID of the data source added is returned.

Definition at line 1257 of file DatasetFactory.cs.

◆ ChangeRawImageSourceID()

bool MyCaffe.db.image.DatasetFactory.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 136 of file DatasetFactory.cs.

◆ ClearImageCache()

void MyCaffe.db.image.DatasetFactory.ClearImageCache ( bool  bSave)

Clear the RawImage cache and optionally save the images.

Parameters
bSaveWhen true the images in the cache are saved to the database in a bulk save, otherwise they are just flushed from the cache.

Definition at line 271 of file DatasetFactory.cs.

◆ ClearParamCache()

void MyCaffe.db.image.DatasetFactory.ClearParamCache ( bool  bSave)

Clear the param cache and save when specified.

Parameters
bSaveSpecifies to save the parameter values in the cache before clearing.

Definition at line 240 of file DatasetFactory.cs.

◆ Close()

void MyCaffe.db.image.DatasetFactory.Close ( )

Close the current data source used.

Definition at line 192 of file DatasetFactory.cs.

◆ CopyImageMean()

bool MyCaffe.db.image.DatasetFactory.CopyImageMean ( string  strSrcSrc,
string  strDstSrc 
)

Copy the raw image mean from one source to another.

Parameters
strSrcSrcSpecifies the Data Source with the source image mean to copy.
strDstSrcSpecifies the Data Source with the destination image mean where the source is copied to.
Returns
On success, true is returned, otherwise false.

Definition at line 658 of file DatasetFactory.cs.

◆ DeleteLabelBoosts()

void MyCaffe.db.image.DatasetFactory.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 1051 of file DatasetFactory.cs.

◆ DeleteLabels()

void MyCaffe.db.image.DatasetFactory.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 1160 of file DatasetFactory.cs.

◆ DeleteRawImageResults()

void MyCaffe.db.image.DatasetFactory.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 725 of file DatasetFactory.cs.

◆ DeleteSourceData()

void MyCaffe.db.image.DatasetFactory.DeleteSourceData ( int  nSrcId = 0)

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).

Definition at line 1275 of file DatasetFactory.cs.

◆ DeleteSources()

void MyCaffe.db.image.DatasetFactory.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 1266 of file DatasetFactory.cs.

◆ Dispose()

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

Releases all resources used.

Definition at line 90 of file DatasetFactory.cs.

◆ FindDatasetFromSourceId()

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

Searches for the dataset containing the sourceId.

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

Definition at line 1654 of file DatasetFactory.cs.

◆ FindDatasetNameFromSourceName()

string MyCaffe.db.image.DatasetFactory.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 1644 of file DatasetFactory.cs.

◆ FindRawImageGroupID()

int MyCaffe.db.image.DatasetFactory.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 766 of file DatasetFactory.cs.

◆ FixupRawImageCopy()

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

The FixupRawImageCopy function is used to fix errors in the copy source ID of a copied raw image. For original images, this function does nothing.

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 ID of the raw image to fixup.
nSecondarySrcIdSpecifies the secondary Source ID to use if the data file is not found.

Definition at line 927 of file DatasetFactory.cs.

◆ GetBoostCount()

int MyCaffe.db.image.DatasetFactory.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 1287 of file DatasetFactory.cs.

◆ GetDatasetGroupID()

int MyCaffe.db.image.DatasetFactory.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 1751 of file DatasetFactory.cs.

◆ GetDatasetID()

int MyCaffe.db.image.DatasetFactory.GetDatasetID ( string  strDsName,
ConnectInfo  ci = null 
)

Returns a datasets ID given its name.

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

Definition at line 1540 of file DatasetFactory.cs.

◆ GetDatasetName()

string MyCaffe.db.image.DatasetFactory.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 1551 of file DatasetFactory.cs.

◆ GetDatasetParameter() [1/4]

string MyCaffe.db.image.DatasetFactory.GetDatasetParameter ( int  nDsId,
string  strParam 
)

Returns the value of a dataset parameter as a string.

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

Definition at line 1705 of file DatasetFactory.cs.

◆ GetDatasetParameter() [2/4]

int MyCaffe.db.image.DatasetFactory.GetDatasetParameter ( int  nDsId,
string  strParam,
int  nDefault 
)

Returns the value of a dataset parameter as an int.

Parameters
nDsIdSpecifies the ID of the dataset.
strParamSpecifies 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 1717 of file DatasetFactory.cs.

◆ GetDatasetParameter() [3/4]

bool MyCaffe.db.image.DatasetFactory.GetDatasetParameter ( int  nDsId,
string  strParam,
bool  bDefault 
)

Returns the value of a dataset parameter as a bool.

Parameters
nDsIdSpecifies the ID of the dataset.
strParamSpecifies 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 1729 of file DatasetFactory.cs.

◆ GetDatasetParameter() [4/4]

double MyCaffe.db.image.DatasetFactory.GetDatasetParameter ( int  nDsId,
string  strParam,
double  dfDefault 
)

Returns the value of a dataset parameter as a double.

Parameters
nDsIdSpecifies the ID of the dataset.
strParamSpecifies 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 1741 of file DatasetFactory.cs.

◆ GetFirstTimeStamp()

DateTime MyCaffe.db.image.DatasetFactory.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 1434 of file DatasetFactory.cs.

◆ GetImageCount()

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

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

Returns

Definition at line 669 of file DatasetFactory.cs.

◆ GetImagesAt() [1/2]

List<SimpleDatum> MyCaffe.db.image.DatasetFactory.GetImagesAt ( List< int >  rgImageIdx,
ManualResetEvent  evtCancel,
int  nSrcId = 0,
string  strDescription = null 
)

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

Parameters
rgImageIdxSpecifies the list of image indexes (no maximum).
evtCancelSpecifies the cancel event.
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
The list of SimpleDatum items is returned.

Definition at line 485 of file DatasetFactory.cs.

◆ GetImagesAt() [2/2]

List<SimpleDatum> MyCaffe.db.image.DatasetFactory.GetImagesAt ( List< DbItem rgImageItems,
ManualResetEvent  evtCancel,
int  nSrcId = 0,
string  strDescription = null 
)

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

Parameters
rgImageItemsSpecifies the list of image DbItems.
evtCancelSpecifies the cancel event.
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
The list of SimpleDatum items is returned.

Definition at line 509 of file DatasetFactory.cs.

◆ GetImagesAtID()

List<SimpleDatum> MyCaffe.db.image.DatasetFactory.GetImagesAtID ( List< int >  rgImageId,
int  nSrcId = 0,
string  strDescription = null 
)

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

Parameters
rgImageIdSpecifies the list of image IDs (no maximum).
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
The list of SimpleDatum items is returned.

Definition at line 532 of file DatasetFactory.cs.

◆ GetLabelBoosts()

List<LabelBoostDescriptor> MyCaffe.db.image.DatasetFactory.GetLabelBoosts ( int  nProjectId,
int  nSrcId = 0 
)

Returns a list of all label boosts set on 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).
Returns
A list of LabelBoostDescriptors is returned.

Definition at line 1002 of file DatasetFactory.cs.

◆ GetLabelBoostsAsText()

string MyCaffe.db.image.DatasetFactory.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 1075 of file DatasetFactory.cs.

◆ GetLabelCountsAsText()

string MyCaffe.db.image.DatasetFactory.GetLabelCountsAsText ( int  nSrcId)

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).
Returns
A string containing the label counts is returned.

Definition at line 1116 of file DatasetFactory.cs.

◆ GetLabelName()

string MyCaffe.db.image.DatasetFactory.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 1138 of file DatasetFactory.cs.

◆ GetLastTimeStamp() [1/4]

DateTime MyCaffe.db.image.DatasetFactory.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 1445 of file DatasetFactory.cs.

◆ GetLastTimeStamp() [2/4]

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

Returns the last time-stamp in the data source from within a time period.

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 1459 of file DatasetFactory.cs.

◆ GetLastTimeStamp() [3/4]

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

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

Parameters
nIndexSpecifies 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 1472 of file DatasetFactory.cs.

◆ GetLastTimeStamp() [4/4]

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

Returns the last time stamp within a given 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 1487 of file DatasetFactory.cs.

◆ GetRawImageDataCriteria() [1/2]

byte [] MyCaffe.db.image.DatasetFactory.GetRawImageDataCriteria ( byte []  rgData,
int  nOriginalSourceID 
)

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.
nOriginalSourceIDSpecifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 938 of file DatasetFactory.cs.

◆ GetRawImageDataCriteria() [2/2]

byte [] MyCaffe.db.image.DatasetFactory.GetRawImageDataCriteria ( int  nImgID,
int  nOriginalSourceID 
)

Queries the Data Criteria data for an image and then converts the raw image debug data which may be stored as a path to the underlying data file, to the actual data.

Parameters
nImgIDSpecifies the raw image ID.
nOriginalSourceIDSpecifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 949 of file DatasetFactory.cs.

◆ GetRawImageDebugData() [1/2]

byte [] MyCaffe.db.image.DatasetFactory.GetRawImageDebugData ( byte []  rgData,
int  nOriginalSourceID 
)

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.
nOriginalSourceIDSpecifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 961 of file DatasetFactory.cs.

◆ GetRawImageDebugData() [2/2]

byte [] MyCaffe.db.image.DatasetFactory.GetRawImageDebugData ( int  nImgID,
int  nOriginalSourceID 
)

Queries the Debug data for an image and then converts the raw image debug data which may be stored as a path to the underlying data file, to the actual data.

Parameters
nImgIDSpecifies the raw image ID.
nOriginalSourceIDSpecifies the original source ID that stores the image.
Returns
The actual raw data is returned.

Definition at line 972 of file DatasetFactory.cs.

◆ GetRawImageDistinctParameterDescriptions()

List<string> MyCaffe.db.image.DatasetFactory.GetRawImageDistinctParameterDescriptions ( int  nSrcId)

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 776 of file DatasetFactory.cs.

◆ GetRawImageFromID()

RawImage MyCaffe.db.image.DatasetFactory.GetRawImageFromID ( int  nImageID)

Returns the raw image with a specified image ID.

Parameters
nImageIDSpecifies the image ID of the image to retrieve.
Returns
The raw image is returned.

Definition at line 716 of file DatasetFactory.cs.

◆ GetRawImageID()

int MyCaffe.db.image.DatasetFactory.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 706 of file DatasetFactory.cs.

◆ GetRawImageMean()

RawImageMean MyCaffe.db.image.DatasetFactory.GetRawImageMean ( )

Return the RawImageMean for the open data source.

Returns
The RawImageMean is returned if found, otherwise null is returned.

Definition at line 351 of file DatasetFactory.cs.

◆ GetRawImageMeanID()

int MyCaffe.db.image.DatasetFactory.GetRawImageMeanID ( int  nSrcId = 0)

Returns the raw image ID for the image mean associated with a data source.

Parameters
nSrcIdSpecifies the data source ID.
Returns
The raw image ID is returned.

Definition at line 694 of file DatasetFactory.cs.

◆ GetRawImageParameterCount()

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

Returns the RawImage parameter count for a data source.

Parameters
strParamSpecifies 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 (default = "TEXT").
Returns
The number of RawImage parameters is returned.

Definition at line 799 of file DatasetFactory.cs.

◆ GetRawImageParameterData()

byte [] MyCaffe.db.image.DatasetFactory.GetRawImageParameterData ( int  nRawImageID,
string  strParam 
)

Return the byte array data of a RawImage parameter.

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

Definition at line 787 of file DatasetFactory.cs.

◆ GetRawImageParameterExist()

bool MyCaffe.db.image.DatasetFactory.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 (default = "TEXT").
Returns
Returns true if the parameter exists, false otherwise.

Definition at line 811 of file DatasetFactory.cs.

◆ GetRawImagesAt() [1/3]

List<RawImage> MyCaffe.db.image.DatasetFactory.GetRawImagesAt ( int  nImageIdx,
int  nImageCount,
int  nSrcId = 0,
string  strDescription = null 
)

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

Parameters
nImageIdxSpecifies the starting image index.
nImageCountSpecifies 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
The list of RawImage items is returned.

Definition at line 364 of file DatasetFactory.cs.

◆ GetRawImagesAt() [2/3]

List<RawImage> MyCaffe.db.image.DatasetFactory.GetRawImagesAt ( List< int >  rgImageIdx,
ManualResetEvent  evtCancel,
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 (no maximum).
evtCancelSpecifies the cancel event.
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
The list of RawImage items is returned.

Definition at line 377 of file DatasetFactory.cs.

◆ GetRawImagesAt() [3/3]

List<RawImage> MyCaffe.db.image.DatasetFactory.GetRawImagesAt ( List< DbItem rgImgItems,
ManualResetEvent  evtCancel,
int  nSrcId = 0,
string  strDescription = null 
)

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

Parameters
rgImgItemsSpecifies the list of image DbItems.
evtCancelSpecifies the cancel event.
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
The list of RawImage items is returned.

Definition at line 449 of file DatasetFactory.cs.

◆ GetRawImagesAtID()

List<RawImage> MyCaffe.db.image.DatasetFactory.GetRawImagesAtID ( List< int >  rgImageId,
ManualResetEvent  evtCancel,
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 (no maximum).
evtCancelSpecifies the cancel event.
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
The list of RawImage items is returned.

Definition at line 413 of file DatasetFactory.cs.

◆ GetSourceID()

int MyCaffe.db.image.DatasetFactory.GetSourceID ( string  strName)

Returns the ID of a data source given its name.

Parameters
strNameSpecifies the data source name.
Returns
The ID of the data source is returned.

Definition at line 1215 of file DatasetFactory.cs.

◆ GetSourceName()

string MyCaffe.db.image.DatasetFactory.GetSourceName ( int  nId)

Returns the name of a data source given its ID.

Parameters
nIdSpecifies the ID of the data source.
Returns
The data source name is returned.

Definition at line 1225 of file DatasetFactory.cs.

◆ GetSourceParameter() [1/4]

string MyCaffe.db.image.DatasetFactory.GetSourceParameter ( string  strParam,
int  nSrcId = 0 
)

Return the data source parameter as a string.

Parameters
strParamSpecifies 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 1387 of file DatasetFactory.cs.

◆ GetSourceParameter() [2/4]

int MyCaffe.db.image.DatasetFactory.GetSourceParameter ( string  strParam,
int  nDefault,
int  nSrcId = 0 
)

Return the data source parameter as an int.

Parameters
strParamSpecifies 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 1399 of file DatasetFactory.cs.

◆ GetSourceParameter() [3/4]

bool MyCaffe.db.image.DatasetFactory.GetSourceParameter ( string  strParam,
bool  bDefault,
int  nSrcId = 0 
)

Return the data source parameter as a bool.

Parameters
strParamSpecifies 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 1411 of file DatasetFactory.cs.

◆ GetSourceParameter() [4/4]

double MyCaffe.db.image.DatasetFactory.GetSourceParameter ( string  strParam,
double  dfDefault,
int  nSrcId = 0 
)

Return the data source parameter as a double.

Parameters
strParamSpecifies 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 1423 of file DatasetFactory.cs.

◆ LoadAllDatasetsWithCreator()

List<DatasetDescriptor> MyCaffe.db.image.DatasetFactory.LoadAllDatasetsWithCreator ( int  nCreatorID,
bool?  bRelabeled = null 
)

Loads all dataset descriptors with a given dataset creator.

Parameters
nCreatorIDSpecifies the ID of the dataset creator.
bRelabeledOptionally, specifies whether or not only re-labeled datasets should be returned.
Returns
A list of DatasetDescriptors is returned.

Definition at line 2310 of file DatasetFactory.cs.

◆ LoadAllDatasetsWithCreators()

List<DatasetDescriptor> MyCaffe.db.image.DatasetFactory.LoadAllDatasetsWithCreators ( int  nGroupId)

Loads all dataset descriptors within a group that have a creator.

Parameters
nGroupIdSpecifies the ID of the dataset group.
Returns
A list of DatasetDescriptors is returned.

Definition at line 2291 of file DatasetFactory.cs.

◆ LoadDataset() [1/4]

DatasetDescriptor MyCaffe.db.image.DatasetFactory.LoadDataset ( string  strDataset,
ConnectInfo  ci = null 
)

Load a dataset descriptor from a dataset name.

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

Definition at line 2232 of file DatasetFactory.cs.

◆ LoadDataset() [2/4]

DatasetDescriptor MyCaffe.db.image.DatasetFactory.LoadDataset ( int  nDatasetID,
ConnectInfo  ci = null 
)

Load a dataset descriptor from a dataset ID.

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

Definition at line 2243 of file DatasetFactory.cs.

◆ LoadDataset() [3/4]

DatasetDescriptor MyCaffe.db.image.DatasetFactory.LoadDataset ( int  nDatasetID,
string  strDataset 
)

Load a dataset descriptor from a dataset ID or name, where the ID is tried first and name second.

Parameters
nDatasetIDSpecifies the dataset ID.
strDatasetSpecifies the dataset name.
Returns
The DatasetDescriptor is returned.

Definition at line 2258 of file DatasetFactory.cs.

◆ LoadDataset() [4/4]

DatasetDescriptor MyCaffe.db.image.DatasetFactory.LoadDataset ( string  strTestingSrc,
string  strTrainingSrc 
)

Load the dataset descriptor that contains the testing and training data source names.

Parameters
strTestingSrcSpecifies the testing data source name.
strTrainingSrcSpecifies the training data source name.
Returns
The DatasetDescriptor is returned.

Definition at line 2277 of file DatasetFactory.cs.

◆ loadDataset()

virtual DatasetDescriptor MyCaffe.db.image.DatasetFactory.loadDataset ( Dataset  ds,
ConnectInfo  ci = null 
)
protectedvirtual

Loads a dataset creator from a Dataset entity.

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

Definition at line 2329 of file DatasetFactory.cs.

◆ LoadDatasetGroup()

GroupDescriptor MyCaffe.db.image.DatasetFactory.LoadDatasetGroup ( int  nGroupId,
ConnectInfo  ci = null 
)

Load a dataset group descriptor from a group ID.

Parameters
nGroupIdSpecifies the ID of the group.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The GroupDescriptor is returned.

Definition at line 2200 of file DatasetFactory.cs.

◆ LoadDatasetParameters()

ParameterDescriptorCollection MyCaffe.db.image.DatasetFactory.LoadDatasetParameters ( int  nDsId,
ConnectInfo  ci = null 
)

Loads the dataset parameters for a given dataset.

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

Definition at line 2349 of file DatasetFactory.cs.

◆ LoadDatum() [1/3]

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadDatum ( int  nImageId,
int  nChannels,
bool  bDataIsReal,
int  nLabel,
int  nSrcId = 0 
)

Loads a new SimpleDataum from a RawImage ID.

Parameters
nImageIdSpecifies the RawImage ID.
nChannelsSpecifies the number of channels.
bDataIsRealSpecifies whether or not the data contains real or byte data.
nLabelSpecifies the label.
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
A new SimpleDatum is returned containing the image.

Definition at line 1820 of file DatasetFactory.cs.

◆ LoadDatum() [2/3]

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadDatum ( RawImage  img,
int  nPadW = 0,
int  nPadH = 0 
)

Loads a new SimpleDatum from a RawImage.

Parameters
imgSpecifies the RawImage.
nPadWOptionally, specifies a pad to apply to the width (default = 0).
nPadHOptionally, specifies a pad to apply to the height (default = 0).
Returns
A new SimpleDatum is returned containing the image.

Definition at line 1852 of file DatasetFactory.cs.

◆ LoadDatum() [3/3]

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadDatum ( RawImageMean  img,
int  nPadW = 0,
int  nPadH = 0 
)

Loads a new image mean from a RawImageMean.

Parameters
imgSpecifies the RawImageMean.
nPadWOptionally, specifies a pad to apply to the width (default = 0).
nPadHOptionally, specifies a pad to apply to the height (default = 0).
Returns
A new SimpleDatum is returned containing the image mean.

Definition at line 1957 of file DatasetFactory.cs.

◆ LoadImage()

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadImage ( int  nImageId,
int  nSrcId = 0 
)

Returns the image at a given image ID.

Parameters
nImageIdSpecifies the image ID within the database.
nSrcIdOptionally, specifies the expected Source ID. The default is 0, which specifies to use the open Source ID.
Returns
The SimpleDatum containing the image is returned.

Definition at line 2033 of file DatasetFactory.cs.

◆ LoadImageAt()

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadImageAt ( int  nIdx,
bool?  bLoadDataCriteria = null,
bool?  bLoadDebugData = null,
int  nSrcId = 0,
int  nPadW = 0,
int  nPadH = 0 
)

Load an image at a given index.

Parameters
nIdxSpecifies the image index.
bLoadDataCriteriaOptionally, specifies to load the data criteria data (default = null, which uses the default of false).
bLoadDebugDataOptionally, specifies to load the debug data (default = null, which uses the default of false).
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
nPadWOptionally, specifies a pad to apply to the width (default = 0).
nPadHOptionally, specifies a pad to apply to the height (default = 0).
Returns
A new SimpleDatum is returned containing the image.

Definition at line 2073 of file DatasetFactory.cs.

◆ LoadImageIndexes()

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

Returns a list of the image indexes of all boosted images in the Data Source.

Parameters
bBoostedOnlySpecifies to only return the indexes of boosted images.
bIncludeActiveOptionally, specifies to query active images (default = true).
bIncludeInactiveOptionally, specifies to query inactive images (default = false).
Returns
The list of DbItem's is returned where each DbItem contains the image index, label, and boost.

Definition at line 1771 of file DatasetFactory.cs.

◆ LoadImageMean()

SimpleDatum MyCaffe.db.image.DatasetFactory.LoadImageMean ( int  nSrcId,
ConnectInfo  ci = null 
)

Returns the image mean for a give data source.

Parameters
nSrcIdSpecifies the source data ID.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The image mean is returned in a SimpleDatum.

Definition at line 2054 of file DatasetFactory.cs.

◆ LoadImages()

List<ImageDescriptor> MyCaffe.db.image.DatasetFactory.LoadImages ( CancelEvent  evtCancel,
params int []  rgSrcId 
)

Load the image descriptors for a set of given source ID's.

Parameters
evtCancelOptionally specifies to cancel the load, when null this parameter is ignored.
rgSrcIdSpecifies the source ID's to load.
Returns
A list of image descriptors for each image is returned.

Definition at line 1782 of file DatasetFactory.cs.

◆ LoadLabelCounts()

Dictionary<int, int> MyCaffe.db.image.DatasetFactory.LoadLabelCounts ( int  nSrcId = 0)

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

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
Returns
A dictionary containing (int nLabel, int nCount) pairs is returned.

Definition at line 1085 of file DatasetFactory.cs.

◆ LoadLabels()

List<LabelDescriptor> MyCaffe.db.image.DatasetFactory.LoadLabels ( int  nSrcId = 0,
bool  bSort = true,
bool  bWithImagesOnly = false,
ConnectInfo  ci = null 
)

Load a list of LabelDescriptors for a data source.

Parameters
nSrcIdOptionally, specifies the ID of the data source (default = 0, which then uses the open data source ID).
bSortSpecifies whether or not to sort the labels (default = false).
bWithImagesOnlySpecifies whether or not to only load labels with images associated with them (default = false).
ciOptionally, specifies a specific connection to use (default = null).
Returns

Definition at line 2117 of file DatasetFactory.cs.

◆ LoadModelGroup()

GroupDescriptor MyCaffe.db.image.DatasetFactory.LoadModelGroup ( int  nGroupId,
ConnectInfo  ci = null 
)

Load a model group descriptor from a group ID.

Parameters
nGroupIdSpecifies the ID of the group.
ciOptionally, specifies a specific connection to use (default = null).
Returns
The GroupDescriptor is returned.

Definition at line 2216 of file DatasetFactory.cs.

◆ LoadRawData()

void MyCaffe.db.image.DatasetFactory.LoadRawData ( SimpleDatum  sd,
bool  bLoadDataCriteria,
bool  bLoadDebugData 
)

Load the data criteria and/or debug data.

Parameters
sdSpecifies the SimpleDatum to load.
bLoadDataCriteriaSpecifies to load the data criteria data (default = false).
bLoadDebugDataSpecifies to load the debug data (default = false).

Definition at line 2100 of file DatasetFactory.cs.

◆ LoadRawImageData()

void MyCaffe.db.image.DatasetFactory.LoadRawImageData ( RawImage  img,
bool  bLoadCriteria,
bool  bLoadDebug 
)

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

Parameters
imgSpecifies the Raw Image.
bLoadCriteriaOptionally, specifies to load the data criteria.
bLoadDebugOptionally, specifies to load the debug data.

Definition at line 603 of file DatasetFactory.cs.

◆ LoadRawImageResults()

List<ResultDescriptor> MyCaffe.db.image.DatasetFactory.LoadRawImageResults ( int  nSrcId = 0)

Loads a list of RawImage results for a data source.

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

Definition at line 2367 of file DatasetFactory.cs.

◆ LoadSource() [1/2]

SourceDescriptor MyCaffe.db.image.DatasetFactory.LoadSource ( string  strSource)

Load the source descriptor from a data source name.

Parameters
strSourceSpecifies the Id of the data source.
Returns
The SourceDescriptor is returned.

Definition at line 2139 of file DatasetFactory.cs.

◆ LoadSource() [2/2]

SourceDescriptor MyCaffe.db.image.DatasetFactory.LoadSource ( int  nSrcId,
ConnectInfo  ci = null 
)

Load the source descriptor from a data source ID.

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

Definition at line 2150 of file DatasetFactory.cs.

◆ LoadSourceParameters()

ParameterDescriptorCollection MyCaffe.db.image.DatasetFactory.LoadSourceParameters ( int  nSrcId,
ConnectInfo  ci = null 
)

Loads the data source parameters for a given source.

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

Definition at line 2181 of file DatasetFactory.cs.

◆ Open() [1/2]

void MyCaffe.db.image.DatasetFactory.Open ( SourceDescriptor  src,
int  nCacheMax = 500,
ConnectInfo  ci = null 
)

Open a given data source.

Parameters
srcSpecifies the data source.
nCacheMaxSpecifies the maximum cache count to use when adding RawImages (default = 500).
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 155 of file DatasetFactory.cs.

◆ Open() [2/2]

void MyCaffe.db.image.DatasetFactory.Open ( int  nSrcId,
int  nCacheMax = 500,
Database.FORCE_LOAD  nForceLoad = Database.FORCE_LOAD.NONE,
Log  log = null,
ConnectInfo  ci = null 
)

Open a given data source.

Parameters
nSrcIdSpecifies the ID of the data source to use.
nCacheMaxOptionally, specifies the maximum cache count to use when adding RawImages (default = 500).
nForceLoadOptionally, specifies how to force load the data (default = NONE).
logOptionally, specifies the output log (default = null).
ciOptionally, specifies a specific connection to use (default = null).

Definition at line 169 of file DatasetFactory.cs.

◆ PutRawImage()

int MyCaffe.db.image.DatasetFactory.PutRawImage ( int  nIdx,
SimpleDatum  sd,
string  strDescription = null 
)

Save a SimpleDatum to the database.

Parameters
nIdxSpecifies the RawImage index.
sdSpecifies the data.
strDescriptionOptionally, specifies the description (default = null).
Returns
The ID of the saved RawImage is returned.

Definition at line 292 of file DatasetFactory.cs.

◆ PutRawImageCache()

void MyCaffe.db.image.DatasetFactory.PutRawImageCache ( int  nIdx,
SimpleDatum  sd,
int  nBackgroundWritingThreadCount = 0,
string  strDescription = null,
bool  bActive = true,
params ParameterData []  rgParams 
)

Add a SimpleDatum to the RawImage cache.

Parameters
nIdxSpecifies the RawImage index.
sdSpecifies the data.
nBackgroundWritingThreadCountOptionally, specifies the background writing thread count, or 0 for to disable background writing (default = 0).
strDescriptionOptionally, specifies the description (default = null).
bActiveOptionally, specifies whether or not the image is added as active (default = true)
rgParamsOptionally, specifies a variable number of parameters to add to the RawImage.

Definition at line 260 of file DatasetFactory.cs.

◆ PutRawImageMean()

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

Save the SimpleDatum as a RawImageMean in the database for the open data source.

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

Definition at line 621 of file DatasetFactory.cs.

◆ PutRawImageParameterCache()

void MyCaffe.db.image.DatasetFactory.PutRawImageParameterCache ( int  nImageID,
string  strParam,
string  strVal,
double?  dfVal,
byte []  rgData,
bool  bOnlyAddNew 
)

Add a new parameter to the parameter cache making sure to save once a maximum count is reached.

Parameters
nImageIDSpecifies the image ID associated with the parameter.
strParamSpecifies the parameter name.
strValSpecifies the parameter value.
dfValSpecifies the parameter numeric value.
rgDataSpecifies the parameter data.
bOnlyAddNewSpecifies to only add the parameter if it does not already exist.

Definition at line 230 of file DatasetFactory.cs.

◆ PutRawImageResults()

int MyCaffe.db.image.DatasetFactory.PutRawImageResults ( int  nSrcId,
int  nIdx,
int  nLabel,
DateTime  dt,
List< Result rgResults,
bool  bInvert 
)

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.
Returns

Definition at line 740 of file DatasetFactory.cs.

◆ QueryImageMean()

SimpleDatum MyCaffe.db.image.DatasetFactory.QueryImageMean ( int  nSrcId = 0)

Return the SimpleDatum 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).
Returns
The SimpleDatum is returned if found, otherwise null is returned.

Definition at line 646 of file DatasetFactory.cs.

◆ QueryLabels()

List<Label> MyCaffe.db.image.DatasetFactory.QueryLabels ( int  nSrcId = 0,
ConnectInfo  ci = null 
)

Query the list of labels for a given source.

Parameters
nSrcIdOptionally, specifies the source ID, or when 0, uses the open source ID.
ciOptionally, specifies a specific connection to use (default = null).
Returns

Definition at line 1197 of file DatasetFactory.cs.

◆ QueryRawImageIDs()

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

Returns all raw image IDs for a given data source.

Parameters
nSrcIdSpecifies the 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).
Returns
The list of raw image ID's is returned.

Definition at line 684 of file DatasetFactory.cs.

◆ QueryRawImageParameters() [1/2]

List<RawImageParameter> MyCaffe.db.image.DatasetFactory.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 332 of file DatasetFactory.cs.

◆ QueryRawImageParameters() [2/2]

List<RawImageParameter> MyCaffe.db.image.DatasetFactory.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 342 of file DatasetFactory.cs.

◆ QueryRawImages()

List<RawImage> MyCaffe.db.image.DatasetFactory.QueryRawImages ( int  nSrcId,
bool?  bActive = null,
bool  bLoadCriteria = false,
bool  bLoadDebug = false,
Log  log = null,
CancelEvent  evtCancel = 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).
bLoadCriteriaOptionally, specifies to load the data criteria which can take longer (default = false).
bLoadDebugOptionally, specifies to load the debug data which can take longer (default = false).
logOptionally, specifies the output log (default = null).
evtCancelOptionally, specifies the cancel event to abort loading (default = null).
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 560 of file DatasetFactory.cs.

◆ Refresh()

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

Close and re-open the current data source used.

Definition at line 202 of file DatasetFactory.cs.

◆ ReindexRawImages()

bool MyCaffe.db.image.DatasetFactory.ReindexRawImages ( Log  log,
CancelEvent  evtCancel,
int  nSrcId = 0,
bool  bCreateImageMean = false 
)

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).
bCreateImageMeanOptionally, specifies whether or not to create (or recreate) the image mean (default = false).
Returns
Upon completion true is returned, otherwise false is returned when cancelled.

Definition at line 1312 of file DatasetFactory.cs.

◆ ResetAllDatasetRelabelWithCreator()

void MyCaffe.db.image.DatasetFactory.ResetAllDatasetRelabelWithCreator ( int  nDsCreatorId)

Reset all dataset relabel flags with a given creator.

Parameters
nDsCreatorIdSpecifies the ID of the dataset creator.

Definition at line 1663 of file DatasetFactory.cs.

◆ ResetLabels()

void MyCaffe.db.image.DatasetFactory.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 1041 of file DatasetFactory.cs.

◆ SaveChanges()

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

Save the changes on the open data source.

Definition at line 144 of file DatasetFactory.cs.

◆ SaveImageMean()

bool MyCaffe.db.image.DatasetFactory.SaveImageMean ( SimpleDatum  sd,
bool  bUpdate,
int  nSrcId = 0 
)

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).
Returns
The ID of the RawImageMean is returned.

Definition at line 633 of file DatasetFactory.cs.

◆ SetDatasetParameter()

void MyCaffe.db.image.DatasetFactory.SetDatasetParameter ( int  nDsId,
string  strParam,
string  strValue 
)

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

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

Definition at line 1694 of file DatasetFactory.cs.

◆ SetDatasetParameters()

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

Set a batch of dataset parameters.

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

Definition at line 1683 of file DatasetFactory.cs.

◆ SetLabelMapping()

void MyCaffe.db.image.DatasetFactory.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 1020 of file DatasetFactory.cs.

◆ SetLoadingParameters()

void MyCaffe.db.image.DatasetFactory.SetLoadingParameters ( bool  bLoadDataCriteria,
bool  bLoadDebugData 
)

Sets the loading parameters that are used to determine which data to load with each image.

Parameters
bLoadDataCriteriaSpecifies whether or not to load the data criteria data if any exists. When false, the data criteria data is not loaded from file. (default = true).
bLoadDebugDataSpecifies whether or not to load the debug data if any exists. When false, the debug data is not loaded from file. (default = true).

Definition at line 107 of file DatasetFactory.cs.

◆ SetRawImageParameter()

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

Add a new or Set an existing RawImage parameter.

Parameters
nRawImageIDSpecifies the ID of the RawImage.
strNameSpecifies the name of the parameter.
strValueSpecifies the value of the parameter.
dfValSpecifies the numeric value of the parameter (default = null).
rgDataOptionally, specifies raw data to associate with the RawImage (default = null).
bOnlyAddNewOptionally, specifies to only add the parameter if it doesnt exist (default = false).
Returns
The ID of the parameter is returned.

Definition at line 307 of file DatasetFactory.cs.

◆ SetRawImageParameterAt()

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

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 numeric value of the parameter (default = null).
rgDataOptionally, specifies the byte data associated with the parameter (default = null).
Returns
The ID of the RawImageParameter is returned.

Definition at line 321 of file DatasetFactory.cs.

◆ SetSourceParameter()

void MyCaffe.db.image.DatasetFactory.SetSourceParameter ( string  strParam,
string  strValue,
int  nSrcId = 0 
)

Set the value of a data source parameter.

Parameters
strParamSpecifies 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 1376 of file DatasetFactory.cs.

◆ UpdateActiveLabel()

bool MyCaffe.db.image.DatasetFactory.UpdateActiveLabel ( int  nImageID,
int  nNewActiveLabel,
bool  bActivate = true,
bool  bSaveChanges = true 
)

Update the active label on a given raw image.

Parameters
nImageIDSpecifies the raw image ID.
nNewActiveLabelSpecifies the new active label.
bActivateOptionally, specifies whether or not to activate/deactivate the image.
bSaveChangesOptionally, save the changes if any.
Returns
If the image is updated this function returns true, otherwise it returns false.

Definition at line 824 of file DatasetFactory.cs.

◆ UpdateActiveLabelByIndex()

void MyCaffe.db.image.DatasetFactory.UpdateActiveLabelByIndex ( int  nIdx,
int  nNewActiveLabel 
)

Update the active label on a given raw image by its index.

Parameters
nIdxSpecifies the raw image index.
nNewActiveLabelSpecifies the new active label.

Definition at line 853 of file DatasetFactory.cs.

◆ UpdateActiveLabelDirect()

void MyCaffe.db.image.DatasetFactory.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 834 of file DatasetFactory.cs.

◆ UpdateAllActiveLabelsDirect()

void MyCaffe.db.image.DatasetFactory.UpdateAllActiveLabelsDirect ( int  nLabel)

Directly update all active labels and activate all of the images for the open Source ID.

Parameters
nLabelSpecifies the new active label.

Definition at line 843 of file DatasetFactory.cs.

◆ UpdateDatasetCounts() [1/2]

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

Updates the dataset counts, and training/testing source counts.

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

Definition at line 1607 of file DatasetFactory.cs.

◆ UpdateDatasetCounts() [2/2]

void MyCaffe.db.image.DatasetFactory.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 1633 of file DatasetFactory.cs.

◆ UpdateDatasetDescription()

void MyCaffe.db.image.DatasetFactory.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 1597 of file DatasetFactory.cs.

◆ UpdateDatasetImageAnnotations()

void MyCaffe.db.image.DatasetFactory.UpdateDatasetImageAnnotations ( int  nSrcId,
int  nImageId,
AnnotationGroupCollection  annotations 
)

Update the annotations on a given RawImage.

Parameters
nSrcIdSpecifies the ID of the data source.
nImageIdSpecifies the ID of the RawImage to update.
annotationsSpecifies the new annotations to update.

Definition at line 983 of file DatasetFactory.cs.

◆ UpdateDatasetRelabel()

void MyCaffe.db.image.DatasetFactory.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 1673 of file DatasetFactory.cs.

◆ UpdateLabelBoost()

void MyCaffe.db.image.DatasetFactory.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 1186 of file DatasetFactory.cs.

◆ UpdateLabelCounts() [1/2]

void MyCaffe.db.image.DatasetFactory.UpdateLabelCounts ( Dictionary< int, int >  rgCounts)

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

Parameters
rgCountsSpecifies a dictionary containing (int nLabel, int nCount) pairs.

Definition at line 1096 of file DatasetFactory.cs.

◆ UpdateLabelCounts() [2/2]

void MyCaffe.db.image.DatasetFactory.UpdateLabelCounts ( int  nSrcId = 0,
int  nProjectId = 0 
)

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).

Definition at line 1106 of file DatasetFactory.cs.

◆ UpdateLabelMapping()

void MyCaffe.db.image.DatasetFactory.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 1031 of file DatasetFactory.cs.

◆ UpdateLabelName()

void MyCaffe.db.image.DatasetFactory.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 1127 of file DatasetFactory.cs.

◆ UpdateRawImageSourceID()

void MyCaffe.db.image.DatasetFactory.UpdateRawImageSourceID ( int  nImageID,
int  nSrcID 
)

Change the source ID on an image to another source ID.

Parameters
nImageIDSpecifies the ID of the image to update.
nSrcIDSpecifies the new source ID.

Definition at line 873 of file DatasetFactory.cs.

◆ UpdateSource()

void MyCaffe.db.image.DatasetFactory.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 1355 of file DatasetFactory.cs.

◆ UpdateSourceCounts()

void MyCaffe.db.image.DatasetFactory.UpdateSourceCounts ( )

Saves the label cache, updates the label counts from the database and then updates the source counts from the database.

Definition at line 1363 of file DatasetFactory.cs.

Member Data Documentation

◆ m_bLoadDataCriteria

bool MyCaffe.db.image.DatasetFactory.m_bLoadDataCriteria = false
protected

Specifies whether or not to load the data criteria data if any exists. When false, the data criteria data is not loaded from file (default = false).

Definition at line 34 of file DatasetFactory.cs.

◆ m_bLoadDebugData

bool MyCaffe.db.image.DatasetFactory.m_bLoadDebugData = false
protected

Specifies whether or not to load the debug data if any exists. When false, the debug data is not loaded from file (default = false).

Definition at line 38 of file DatasetFactory.cs.

◆ m_ciOpen

ConnectInfo MyCaffe.db.image.DatasetFactory.m_ciOpen = null
protected

Specifies the connection information used on open.

Definition at line 42 of file DatasetFactory.cs.

◆ m_db

Database MyCaffe.db.image.DatasetFactory.m_db = new Database()
protected

Specifies the Database managed.

Definition at line 22 of file DatasetFactory.cs.

◆ m_nOriginalSourceID

int MyCaffe.db.image.DatasetFactory.m_nOriginalSourceID = null
protected

Specifies the original source ID (if any).

Definition at line 30 of file DatasetFactory.cs.

◆ m_openSource

SourceDescriptor MyCaffe.db.image.DatasetFactory.m_openSource = null
protected

Specifies the open source descriptor (if any).

Definition at line 26 of file DatasetFactory.cs.

Property Documentation

◆ LastIndex

int MyCaffe.db.image.DatasetFactory.LastIndex
get

Returns the index of the last image added to the database.

Definition at line 98 of file DatasetFactory.cs.

◆ LoadDataCriteria

bool MyCaffe.db.image.DatasetFactory.LoadDataCriteria
get

Returns whether or not the image data criteria is to be loaded when loading each image.

Definition at line 117 of file DatasetFactory.cs.

◆ LoadDebugData

bool MyCaffe.db.image.DatasetFactory.LoadDebugData
get

Returns whether or not the image debug data is to be loaded when loading each image.

Definition at line 125 of file DatasetFactory.cs.

◆ OpenSource

SourceDescriptor MyCaffe.db.image.DatasetFactory.OpenSource
get

Returns the currently open data source.

Definition at line 211 of file DatasetFactory.cs.

◆ OriginalSourceID

int MyCaffe.db.image.DatasetFactory.OriginalSourceID
getset

Get/set the original source ID (if any). This field is used when copying a source and using the virutal image reference, but retaining the original source ID for the internal image lookup.

Definition at line 1521 of file DatasetFactory.cs.


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