MyCaffe  1.11.7.7
Deep learning software for Windows C# programmers.
MyCaffe.basecode.SimpleDatum Class Reference

The SimpleDatum class holds a data input within host memory. More...

Inheritance diagram for MyCaffe.basecode.SimpleDatum:
MyCaffe.basecode.Datum

Public Types

enum  ANNOTATION_TYPE { NONE = -1 , BBOX = 0 }
 Specifies the annotation type when using annotations. More...
 
enum  DATA_FORMAT {
  NONE , IMAGE_1CH , IMAGE_3CH , SEGMENTATION ,
  DICTIONARY , CUSTOM , BITMAP , LIST_DOUBLE ,
  LIST_FLOAT , ANNOTATION_DATA
}
 Defines the data format of the DebugData and DataCriteria when specified. More...
 

Public Member Functions

 SimpleDatum ()
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel=-1, DateTime? dtTime=null, int nBoost=0, bool bAutoLabeled=false, int nIdx=-1, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, List< byte > rgData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, List< double > rgfData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, List< float > rgfData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, byte[] rgData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, double[] rgdfData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, float[] rgfData, int nBoost, bool bAutoLabeled, int nIdx, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (bool bIsReal, int nChannels, int nWidth, int nHeight, int nLabel, DateTime dtTime, int nBoost=0, bool bAutoLabeled=false, int nIdx=-1, int nVirtualID=0, int nImageID=0, int nSourceID=0, int nOriginalSourceID=0)
 The SimpleDatum constructor. More...
 
 SimpleDatum (int nChannels, int nWidth, int nHeight, float[] rgf, int nOffset, int nCount, bool bDataIsReal=true)
 The SimpleDatum constructor. More...
 
 SimpleDatum (int nChannels, int nWidth, int nHeight)
 The SimpleDatum constructor. More...
 
 SimpleDatum (Bytemap data)
 The SimpleDatum constructor. More...
 
 SimpleDatum (Valuemap data)
 The SimpleDatum constructor. More...
 
 SimpleDatum (SimpleDatum d, bool bCopyData=false)
 The SimpleDatum constructor. More...
 
 SimpleDatum (SimpleDatum d, int nHeight, int nWidth)
 The SimpleDatum constructor. More...
 
 SimpleDatum (List< SimpleDatum > rg, bool bAlignChannels)
 Constructor that copies an array into a single SimpleDatum by appending each to the other in order. More...
 
void Clip (int nDataLen, int? nNewChannel, int? nNewHeight, int? nNewWidth)
 Clip the data length down to a smaller size and copies the clipped data. More...
 
List< int > GetNonZeroIndexes ()
 Returns all indexes with non-zero data. More...
 
void Zero ()
 Zero out all data in the datum but keep the size and other settings. More...
 
bool Sub (SimpleDatum sd, bool bSetNegativeToZero=false)
 Subtract the data of another SimpleDatum from this one, so this = this - sd. More...
 
bool SubAbs (SimpleDatum sd)
 Subtract the data of another SimpleDatum from this one, and take the absolute value, so this = Math.Abs(this - sd). More...
 
void Scale (double dfScale, double dfMin=-double.MaxValue, double dfMax=double.MaxValue)
 Scale the values by the scaling factor. More...
 
void ScalePow (double dfScalePow, double dfMin=-double.MaxValue, double dfMax=double.MaxValue)
 Scale the values by the scaling factor that raises each value by the specified power. More...
 
void Copy (SimpleDatum d, bool bCopyData, int? nHeight=null, int? nWidth=null)
 Copy another SimpleDatum into this one. More...
 
void CopyData (SimpleDatum d)
 Copy just the data from another SimpleDatum, making sure to update the C x H x W dimensions and IsReal settings to fit the new data. More...
 
void SetData (SimpleDatum d)
 Set the data of the current SimpleDatum by copying the data of another. More...
 
bool GetDataValid (bool bByType=true)
 Returns true if the ByteData or RealDataD or RealDataF are not null, false otherwise. More...
 
List< T > ClipToLastColumnsX< T > (int nLastColumns=10)
 DEPRECIATED: Clips the SimpleDatum to the last nLastColumns and returns the data. More...
 
void MaskOutAllButLastColumnsX (int nLastColumsToRetain, int nMaskingValue)
 DEPRECIATED: Masks out all data except for the last columns of data. More...
 
void SetData (List< byte > rgByteData, int nLabel, bool bAllowVirtualOverride=false)
 Sets the byte data of the SimpleDatum and its Label. More...
 
void SetData (List< double > rgRealData, int nLabel, bool bAllowVirtualOverride=false)
 Sets the double data of the SimpleDatum and its Label. More...
 
void SetData (List< float > rgRealData, int nLabel, bool bAllowVirtualOverride=false)
 Sets the float data of the SimpleDatum and its Label. More...
 
void SetData (byte[] rgb, int nLabel)
 Set the data to the byte array specified. More...
 
void SetData (double[] rgdf, int nLabel)
 Set the data to the double array specified. More...
 
void SetData (float[] rgf, int nLabel)
 Set the data to the float array specified. More...
 
void SetLabel (int nLabel)
 Sets the label. More...
 
void ResetLabel ()
 Resets the label to the original label used when creating the SimpleDatum. More...
 
GetDataAt< T > (int nIdx)
 Returns the item at a specified index in the type specified. More...
 
double GetDataAtD (int nIdx)
 Returns the item at a specified index in the double type. More...
 
float GetDataAtF (int nIdx)
 Returns the item at a specified index in the float type. More...
 
byte GetDataAtByte (int nIdx)
 Returns the item at a specified index in the byte type. More...
 
T[] GetData< T > (int nImagePadX=0, int nImagePadY=0)
 Returns the data as a generic array and optionally pads the data. More...
 
byte[] GetByteData (out bool bEncoded)
 Returns the data as a byte array regardless of how it is stored. More...
 
SimpleDatum Add (SimpleDatum d)
 Creates a new SimpleDatum and adds another SimpleDatum to it. More...
 
SimpleDatum Div (double dfVal, bool bConvertToByte)
 Divides all elements of the SimpleDatum by a value and returns the result as a new SimpleDatum. More...
 
void SetImageID (int nID)
 Set the image ID. More...
 
void ResetBoost ()
 Reset the boost to the original boost. More...
 
SimpleDatum Resize (int nH, int nW)
 Resize the data and return it as a new SimpleDatum. More...
 
override string ToString ()
 Return a string representation of the SimpleDatum. More...
 
string ToArrayAsString (int nMaxItems)
 Returns a string containing the items of the SimpleDatum. More...
 
Bytemap ToBytemap ()
 Return the SimpleData data as a Bytemap. More...
 
void SaveAnnotationDataToDataCriteria ()
 Save the annotation data and type to the data criteria. More...
 
bool LoadAnnotationDataFromDataCriteria ()
 Load the annotation data and type from the data criteria. More...
 
void SaveInfo (string strFile)
 Save the SimpleDatum information to a text file. More...
 

Static Public Member Functions

static byte[] GetByteData (byte[] rgData, int nImagePadX, int nImagePadY, int nHeight, int nWidth, int nChannels)
 Return the non-real data as a byte array after padding the data. More...
 
static Tuple< double[], float[]> GetRealData (byte[] rgData, int nImagePadX, int nImagePadY, int nHeight, int nWidth, int nChannels)
 Return the real data as a double or float array (depending on the original encoding data type) after padding the data. More...
 
static T[] PadData< T > (List< T > rgData, int nImagePadX, int nImagePadY, int nHeight, int nWidth, int nChannels)
 Padd the data. More...
 
static byte[] GetByteData (List< double > rgData)
 Encodes a list of double values to an encoded byte array. More...
 
static byte[] GetByteData (List< float > rgData)
 Encodes a list of float values to an encoded byte array. More...
 
static Tuple< double[], float[]> GetRealData (byte[] rgData)
 Decodes an array of byte values into a array of either double or float values depending on how the original encoding was made. More...
 
static bool AccumulateMean (ref double[] rgdfMean, SimpleDatum sd, int nTotal)
 Accumulate a portion of a SimpleDatum to calculate the mean value. More...
 
static SimpleDatum CalculateMean (Log log, SimpleDatum[] rgImg, WaitHandle[] rgAbort)
 Calculate the mean of an array of SimpleDatum and return the mean as a new SimpleDatum. More...
 
static byte[] SaveAnnotationDataToDataCriteriaByteArray (ANNOTATION_TYPE type, AnnotationGroupCollection annotations)
 Save the annotation data to a byte array. More...
 
static AnnotationGroupCollection LoadAnnotationDataFromDataCriteria (byte[] rg, DATA_FORMAT fmt, out ANNOTATION_TYPE type)
 Load the AnnotationGroups from the byte array. More...
 
static SimpleDatum LoadInfo (string strFile)
 Load a SimpleData from text file information previously saved with SaveInfo. More...
 
static List< SimpleDatumLoadFromPath (string strPath)
 Load all SimpleDatums from a directory of files previously stored with SaveInfo. More...
 
static float[] Transpose (float[] rg, int nH, int nW, int nDim=1)
 Transpose the data within a float array. More...
 
static double[] Transpose (double[] rg, int nH, int nW, int nDim=1)
 Transpose the data within a double array. More...
 

Static Protected Member Functions

static double[] getRealDataD (byte[] rgData, int nIdx)
 Decodes an array of byte values into a array of double values. More...
 
static float[] getRealDataF (byte[] rgData, int nIdx)
 Decodes an array of byte values into a array of float values. More...
 

Protected Attributes

object m_tag = null
 Specifies a user value. More...
 
string m_strTagName = null
 Specifies the name of the user value. More...
 

Properties

int HitCount [getset]
 Get/set the hit count for the SimpleDatum. More...
 
object Tag [getset]
 Specifies user data associated with the SimpleDatum. More...
 
string TagName [getset]
 Returns a user-defined name of the tag associated with the data. More...
 
double Min [get]
 Returns the minimum value in the data or double.NaN if there is no data. More...
 
double Max [get]
 Returns the maximum value in the data or double.NaN if there is no data. More...
 
int ItemCount [get]
 Returns the number of data items. More...
 
bool HasRealData [get]
 Returns true if either the RealDataD or RealDataF are non null and have length > 0. More...
 
int SourceID [get]
 Returns the ID of the data source that owns this image. More...
 
int OriginalSourceID [get]
 Returns the original source ID which is set when using a virtual ID. More...
 
int ImageID [get]
 Returns the ID of the image in the database. More...
 
int VirtualID [get]
 Returns the virtual ID of the SimpleDatum. More...
 
int GroupID [getset]
 Get/set the group ID of the SimpleDatum. More...
 
int Index [getset]
 Returns the index of the SimpleDatum. More...
 
DateTime TimeStamp [getset]
 Get/set the Timestamp. More...
 
bool AutoLabeled [getset]
 Get/set whether or not the label was auto generated. More...
 
bool IsRealData [get]
 Returns whether or not the data contains real numbers or byte data. More...
 
int Height [get]
 Return the height of the data. More...
 
int Width [get]
 Return the width of the data. More...
 
int Channels [get]
 Return the number of channels of the data. More...
 
int Label [get]
 Return the known label of the data. More...
 
int OriginalLabel [getset]
 Get/set the original known label of the data. More...
 
byte[] ByteData [get]
 Return the byte data. This field is valid when IsRealData = false. More...
 
double[] RealDataD [get]
 Return the double data. This field is valid when IsRealData = true. More...
 
float[] RealDataF [get]
 Return the float data. This field is valid when IsRealData = true. More...
 
int Boost [getset]
 Get/set the boost for this data. More...
 
DATA_FORMAT DataCriteriaFormat [getset]
 Get/set the data format of the data criteria. More...
 
byte[] DataCriteria [getset]
 Get/set data criteria associated with the data. More...
 
DATA_FORMAT DebugDataFormat [getset]
 Get/set the data format of the debug data. More...
 
byte[] DebugData [getset]
 Get/set debug data associated with the data. More...
 
string Description [getset]
 Get/set a description of the data. More...
 
ANNOTATION_TYPE annotation_type [getset]
 When using annotations, the annotation type specifies the type of annotation. Currently, only the BBOX annotation type is supported. More...
 
AnnotationGroupCollection annotation_group [getset]
 When using annoations, each annotation group contains an annotation for a particular class used with SSD. More...
 

Detailed Description

The SimpleDatum class holds a data input within host memory.

Definition at line 18 of file SimpleDatum.cs.

Member Enumeration Documentation

◆ ANNOTATION_TYPE

Specifies the annotation type when using annotations.

Enumerator
NONE 

Specifies that annotations are not used.

BBOX 

Specifies to use the bounding box annoation type.

Definition at line 59 of file SimpleDatum.cs.

◆ DATA_FORMAT

Defines the data format of the DebugData and DataCriteria when specified.

Enumerator
NONE 

Specifies that there is no data.

IMAGE_1CH 

Specifies that the data contains a black and white square image packed as a set of byte values [0-255] in the order: image wxh.

IMAGE_3CH 

Specifies that the data contains a RGB square image packed as a set of byte values [0-255] in the order: wxh of R, wxh of G and wxh of B.

SEGMENTATION 

Specifies that the data contains segmentation data where the height and width are equal.

DICTIONARY 

Specifies that the data contains a dictionary of values.

CUSTOM 

Specifies that the data contains custom data.

BITMAP 

Specifies that the data contains an image converted to a byte array using ImageTools.ImageToByteArray.

To convert back to an image, use the ImageTools.ByteArrayToImage method.

LIST_DOUBLE 

Specifies that the data contains a list of double values where the first item is an Int32 which is the count followed by that many double values.

LIST_FLOAT 

Specifies that the data contains a list of float values where the first item is an Int32 which is the count followed by that many float values.

ANNOTATION_DATA 

Specifies that the data contains annotation data used with SSD.

Definition at line 74 of file SimpleDatum.cs.

Constructor & Destructor Documentation

◆ SimpleDatum() [1/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( )

The SimpleDatum constructor.

Definition at line 123 of file SimpleDatum.cs.

◆ SimpleDatum() [2/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel = -1,
DateTime?  dtTime = null,
int  nBoost = 0,
bool  bAutoLabeled = false,
int  nIdx = -1,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelOptionally, specifies the known label of the data (default = -1).
dtTimeOptionally, specifies a time-stamp associated with the data (default = null).
nBoostOptionally, specifies the boost to use with the data (default = 0, where a value of 0 indicates no boost).
bAutoLabeledOptionally, specifies whether or not the label was auto-generated (default = false).
nIdxOptionally, specifies the index of the data (default = -1).
nVirtualIDOptionally, specifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDOptionally, specifies the image ID within the database (default = 0).
nSourceIDOptionally, specifies the data source ID of the data source that owns this image (default = 0).
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 143 of file SimpleDatum.cs.

◆ SimpleDatum() [3/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
List< byte >  rgData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgDataSpecifies the data as a list of bytes (expects bIsReal = false).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 179 of file SimpleDatum.cs.

◆ SimpleDatum() [4/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
List< double >  rgfData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgfDataSpecifies the data as a list of double (expects bIsReal = true).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 220 of file SimpleDatum.cs.

◆ SimpleDatum() [5/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
List< float >  rgfData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgfDataSpecifies the data as a list of float (expects bIsReal = true).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 261 of file SimpleDatum.cs.

◆ SimpleDatum() [6/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
byte[]  rgData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgDataSpecifies the data as a list of bytes (expects bIsReal = false).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 302 of file SimpleDatum.cs.

◆ SimpleDatum() [7/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
double[]  rgdfData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgdfDataSpecifies the data as a list of double (expects bIsReal = true).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 343 of file SimpleDatum.cs.

◆ SimpleDatum() [8/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
float[]  rgfData,
int  nBoost,
bool  bAutoLabeled,
int  nIdx,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
rgfDataSpecifies the data as a list of float (expects bIsReal = true).
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 384 of file SimpleDatum.cs.

◆ SimpleDatum() [9/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( bool  bIsReal,
int  nChannels,
int  nWidth,
int  nHeight,
int  nLabel,
DateTime  dtTime,
int  nBoost = 0,
bool  bAutoLabeled = false,
int  nIdx = -1,
int  nVirtualID = 0,
int  nImageID = 0,
int  nSourceID = 0,
int  nOriginalSourceID = 0 
)

The SimpleDatum constructor.

Parameters
bIsRealSpecifies whether or not the data values are double or byte.
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
nLabelSpecifies the known label of the data.
dtTimeSpecifies a time-stamp associated with the data.
nBoostSpecifies the boost to use with the data (a value of 0 indicates no boost).
bAutoLabeledSpecifies whether or not the label was auto-generated.
nIdxSpecifies the index of the data.
nVirtualIDSpecifies a virtual index for the data (default = 0). When specified, the SimpleDatum is used to reference another.
nImageIDSpecifies the image ID within the database.
nSourceIDSpecifies the data source ID of the data source that owns this image.
nOriginalSourceIDOptionally, specifies the ogiginal source ID which is set when using a virtual ID - the original source ID is the ID of the source associated with the image with the ID of the virtual ID.

Definition at line 424 of file SimpleDatum.cs.

◆ SimpleDatum() [10/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( int  nChannels,
int  nWidth,
int  nHeight,
float[]  rgf,
int  nOffset,
int  nCount,
bool  bDataIsReal = true 
)

The SimpleDatum constructor.

Parameters
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).
rgfSpecifies the data to copy.
nOffsetSpecifies the offset into the data where the copying should start.
nCountSpecifies the number of data items to copy.
bDataIsRealOptionally, specifies whether or not the data is real.

Definition at line 456 of file SimpleDatum.cs.

◆ SimpleDatum() [11/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( int  nChannels,
int  nWidth,
int  nHeight 
)

The SimpleDatum constructor.

Parameters
nChannelsSpecifies the number of channels in the data (e.g. 3 for color, 1 for black and white images)
nWidthSpecifies the width of the data (e.g. the number of pixels wide).
nHeightSpecifies the height of the data (e.g. the number of pixels high).

Definition at line 502 of file SimpleDatum.cs.

◆ SimpleDatum() [12/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( Bytemap  data)

The SimpleDatum constructor.

Parameters
dataSpecifies the byte data to fill the SimpleDatum with.

Definition at line 523 of file SimpleDatum.cs.

◆ SimpleDatum() [13/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( Valuemap  data)

The SimpleDatum constructor.

Parameters
dataSpecifies the valuse data to fill the SimpleDatum with.

Definition at line 539 of file SimpleDatum.cs.

◆ SimpleDatum() [14/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( SimpleDatum  d,
bool  bCopyData = false 
)

The SimpleDatum constructor.

Parameters
dSpecifies a SimpleDatum used to create this new Datum.
bCopyDataSpecifies whether or not to copy the data, or just share it (default = false, share the data).

Definition at line 556 of file SimpleDatum.cs.

◆ SimpleDatum() [15/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( SimpleDatum  d,
int  nHeight,
int  nWidth 
)

The SimpleDatum constructor.

Parameters
dSpecifies a SimpleDatum used to create this new Datum.
nHeightSpecifies a height override.
nWidthSpecifies a width override.

Definition at line 567 of file SimpleDatum.cs.

◆ SimpleDatum() [16/16]

MyCaffe.basecode.SimpleDatum.SimpleDatum ( List< SimpleDatum rg,
bool  bAlignChannels 
)

Constructor that copies an array into a single SimpleDatum by appending each to the other in order.

Data is ordered by HxWxC where C is filled with the channels of each input. So if three inputs are used the output is HxWx[c1,c2,c3].

Parameters
rgSpecifies the array of SimpleDatum to append together.
bAlignChannelsWhen true, the data is packed with each channel following the other. For example, packing three hxw images together using channel ordering, so three single channel images would then result in the following ordering:

h0,w0,c0,c1,c2 h0,w1,c0,c1,c2 ...

When false (default), the channel data from each data item are stacked back to back similar to the way a single data item is already ordered.

Definition at line 589 of file SimpleDatum.cs.

Member Function Documentation

◆ AccumulateMean()

static bool MyCaffe.basecode.SimpleDatum.AccumulateMean ( ref double[]  rgdfMean,
SimpleDatum  sd,
int  nTotal 
)
static

Accumulate a portion of a SimpleDatum to calculate the mean value.

Parameters
rgdfMeanSpecifies the accumulated mean value.
sdSpecifies the SimpleDatum to add to the mean.
nTotalSpecifies the overall total used to calculate the portion of the sd to add to the mean value.
Returns
After successfully adding to the total used to calculate the mean, true is returned, otherwise if the SimpleDatum is a virtual datum false is returned.

Definition at line 2366 of file SimpleDatum.cs.

◆ Add()

SimpleDatum MyCaffe.basecode.SimpleDatum.Add ( SimpleDatum  d)

Creates a new SimpleDatum and adds another SimpleDatum to it.

Parameters
dSpecifies the other SimpleDatum.
Returns
The new SimpleDatum is returned.

Definition at line 1888 of file SimpleDatum.cs.

◆ CalculateMean()

static SimpleDatum MyCaffe.basecode.SimpleDatum.CalculateMean ( Log  log,
SimpleDatum[]  rgImg,
WaitHandle[]  rgAbort 
)
static

Calculate the mean of an array of SimpleDatum and return the mean as a new SimpleDatum.

Parameters
logSpecifies the Log used for output.
rgImgSpecifies the input SimpleDatum.
rgAbortSpecifies a set of wait handles used to abort the process.
Returns
A new SimpleDatum containing the mean is returned.

Definition at line 2410 of file SimpleDatum.cs.

◆ Clip()

void MyCaffe.basecode.SimpleDatum.Clip ( int  nDataLen,
int?  nNewChannel,
int?  nNewHeight,
int?  nNewWidth 
)

Clip the data length down to a smaller size and copies the clipped data.

Parameters
nDataLenSpecifies the new, smaller, size.
nNewChannelSpecifies the new channel size, or null to ignore.
nNewHeightSpecifies the new height size, or null to ignore.
nNewWidthSpecifies the new width size, or null to ignore.

Definition at line 816 of file SimpleDatum.cs.

◆ ClipToLastColumnsX< T >()

List< T > MyCaffe.basecode.SimpleDatum.ClipToLastColumnsX< T > ( int  nLastColumns = 10)

DEPRECIATED: Clips the SimpleDatum to the last nLastColumns and returns the data.

Template Parameters
TSpecifies base the type of data returned, either double or float.
Parameters
nLastColumnsSpecifies the number of last columns of data to keep.
Returns
The last columns of data are returned.

Definition at line 1252 of file SimpleDatum.cs.

◆ Copy()

void MyCaffe.basecode.SimpleDatum.Copy ( SimpleDatum  d,
bool  bCopyData,
int?  nHeight = null,
int?  nWidth = null 
)

Copy another SimpleDatum into this one.

Parameters
dSpecifies the SimpleDatum to copy.
bCopyDataSpecifies whether or not to copy the data.
nHeightOptionally, specifies a height override.
nWidthOptionally, specifies a width override.

Definition at line 1136 of file SimpleDatum.cs.

◆ CopyData()

void MyCaffe.basecode.SimpleDatum.CopyData ( SimpleDatum  d)

Copy just the data from another SimpleDatum, making sure to update the C x H x W dimensions and IsReal settings to fit the new data.

Parameters
dSpecifies the SimpleDatum whos data is to be copied.

Definition at line 1194 of file SimpleDatum.cs.

◆ Div()

SimpleDatum MyCaffe.basecode.SimpleDatum.Div ( double  dfVal,
bool  bConvertToByte 
)

Divides all elements of the SimpleDatum by a value and returns the result as a new SimpleDatum.

Parameters
dfValSpecifies the non-zero divisor.
bConvertToByteIf the SimpleDatum contains real numbers, specifies whether or not to convert the data to byte data.
Returns
The new SimpleDatum is returned.

Definition at line 1952 of file SimpleDatum.cs.

◆ GetByteData() [1/4]

static byte[] MyCaffe.basecode.SimpleDatum.GetByteData ( byte[]  rgData,
int  nImagePadX,
int  nImagePadY,
int  nHeight,
int  nWidth,
int  nChannels 
)
static

Return the non-real data as a byte array after padding the data.

Parameters
rgDataSpecifies the data.
nImagePadXSpecifies the amount to pad the data width.
nImagePadYSpecifies the amount to pad the data height.
nHeightSpecifies the height of the original data.
nWidthSpecifies the width of the original data.
nChannelsSpecifies the number of channels in the original data.
Returns
The data is returned as a byte array.

Definition at line 1639 of file SimpleDatum.cs.

◆ GetByteData() [2/4]

static byte[] MyCaffe.basecode.SimpleDatum.GetByteData ( List< double >  rgData)
static

Encodes a list of double values to an encoded byte array.

Each double in the stored data is converted using a BitConverter.

Parameters
rgDataSpecifies the data as list of double values.
Returns
The encoded doubles are returned as an array of byte values.

Definition at line 1752 of file SimpleDatum.cs.

◆ GetByteData() [3/4]

static byte[] MyCaffe.basecode.SimpleDatum.GetByteData ( List< float >  rgData)
static

Encodes a list of float values to an encoded byte array.

Each double in the stored data is converted using a BitConverter.

Parameters
rgDataSpecifies the data as list of float values.
Returns
The encoded doubles are returned as an array of byte values.

Definition at line 1787 of file SimpleDatum.cs.

◆ GetByteData() [4/4]

byte[] MyCaffe.basecode.SimpleDatum.GetByteData ( out bool  bEncoded)

Returns the data as a byte array regardless of how it is stored.

Parameters
bEncodedReturns whether or not the original data is real (true) or not (false).
Returns
A byte array of the data is returned.

Definition at line 1726 of file SimpleDatum.cs.

◆ GetData< T >()

T[] MyCaffe.basecode.SimpleDatum.GetData< T > ( int  nImagePadX = 0,
int  nImagePadY = 0 
)

Returns the data as a generic array and optionally pads the data.

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.
Parameters
nImagePadXOptionally, specifies the amount to pad the data width.
nImagePadYOptionally, specifies the amount to pad the data height.
Returns
The data is returned as a generic array.

Definition at line 1572 of file SimpleDatum.cs.

◆ GetDataAt< T >()

T MyCaffe.basecode.SimpleDatum.GetDataAt< T > ( int  nIdx)

Returns the item at a specified index in the type specified.

Template Parameters
TSpecifies the output type.
Parameters
nIdxSpecifies the index of the data to retrieve.
Returns
The converted value is returned.

Definition at line 1478 of file SimpleDatum.cs.

◆ GetDataAtByte()

byte MyCaffe.basecode.SimpleDatum.GetDataAtByte ( int  nIdx)

Returns the item at a specified index in the byte type.

Parameters
nIdxSpecifies the index of the data to retrieve.
Returns
The value is returned as a byte.

Definition at line 1544 of file SimpleDatum.cs.

◆ GetDataAtD()

double MyCaffe.basecode.SimpleDatum.GetDataAtD ( int  nIdx)

Returns the item at a specified index in the double type.

Parameters
nIdxSpecifies the index of the data to retrieve.
Returns
The value is returned as a double.

Definition at line 1500 of file SimpleDatum.cs.

◆ GetDataAtF()

float MyCaffe.basecode.SimpleDatum.GetDataAtF ( int  nIdx)

Returns the item at a specified index in the float type.

Parameters
nIdxSpecifies the index of the data to retrieve.
Returns
The value is returned as a float.

Definition at line 1522 of file SimpleDatum.cs.

◆ GetDataValid()

bool MyCaffe.basecode.SimpleDatum.GetDataValid ( bool  bByType = true)

Returns true if the ByteData or RealDataD or RealDataF are not null, false otherwise.

Parameters
bByTypeSpecifies to only test if real (RealDataD and RealDataF) or if not real (ByteData). When false, all data types are tested.

Definition at line 1228 of file SimpleDatum.cs.

◆ GetNonZeroIndexes()

List< int > MyCaffe.basecode.SimpleDatum.GetNonZeroIndexes ( )

Returns all indexes with non-zero data.

Returns
The list of indexes corresponding to non-zero data is returned.

Definition at line 846 of file SimpleDatum.cs.

◆ GetRealData() [1/2]

static Tuple< double[], float[]> MyCaffe.basecode.SimpleDatum.GetRealData ( byte[]  rgData)
static

Decodes an array of byte values into a array of either double or float values depending on how the original encoding was made.

Parameters
rgDataSpecifies the array of byte values containing the encoded double or float values.
Returns
The array of decoded double or float values is returned in a Tuple where only one item is set depending on the encoding data type used.

Definition at line 1819 of file SimpleDatum.cs.

◆ GetRealData() [2/2]

static Tuple< double[], float[]> MyCaffe.basecode.SimpleDatum.GetRealData ( byte[]  rgData,
int  nImagePadX,
int  nImagePadY,
int  nHeight,
int  nWidth,
int  nChannels 
)
static

Return the real data as a double or float array (depending on the original encoding data type) after padding the data.

Parameters
rgDataSpecifies the data.
nImagePadXSpecifies the amount to pad the data width.
nImagePadYSpecifies the amount to pad the data height.
nHeightSpecifies the height of the original data.
nWidthSpecifies the width of the original data.
nChannelsSpecifies the number of channels in the original data.
Returns
The data is returned as a double or float array depending on the original encoding type.

Definition at line 1657 of file SimpleDatum.cs.

◆ getRealDataD()

static double[] MyCaffe.basecode.SimpleDatum.getRealDataD ( byte[]  rgData,
int  nIdx 
)
staticprotected

Decodes an array of byte values into a array of double values.

Parameters
rgDataSpecifies the array of byte values containing the encoded double values.
nIdxSpecifies the offset where reading is to start.
Returns
The array of decoded double values is returned.

Definition at line 1851 of file SimpleDatum.cs.

◆ getRealDataF()

static float[] MyCaffe.basecode.SimpleDatum.getRealDataF ( byte[]  rgData,
int  nIdx 
)
staticprotected

Decodes an array of byte values into a array of float values.

Parameters
rgDataSpecifies the array of byte values containing the encoded float values.
nIdxSpecifies the offset where reading is to start.
Returns
The array of decoded float values is returned.

Definition at line 1870 of file SimpleDatum.cs.

◆ LoadAnnotationDataFromDataCriteria() [1/2]

bool MyCaffe.basecode.SimpleDatum.LoadAnnotationDataFromDataCriteria ( )

Load the annotation data and type from the data criteria.

Returns
When successfully loaded true is returned, otherwise false is returned.

Definition at line 2618 of file SimpleDatum.cs.

◆ LoadAnnotationDataFromDataCriteria() [2/2]

static AnnotationGroupCollection MyCaffe.basecode.SimpleDatum.LoadAnnotationDataFromDataCriteria ( byte[]  rg,
DATA_FORMAT  fmt,
out ANNOTATION_TYPE  type 
)
static

Load the AnnotationGroups from the byte array.

Parameters
rgSpecifies the byte array containing the annotation data.
fmtSpecifies the annotation data format (expected to be ANNOATION_DATA).
typeReturns the annoation data type.
Returns
The AnnotationGroupCollection loaded is returned.

Definition at line 2588 of file SimpleDatum.cs.

◆ LoadFromPath()

static List< SimpleDatum > MyCaffe.basecode.SimpleDatum.LoadFromPath ( string  strPath)
static

Load all SimpleDatums from a directory of files previously stored with SaveInfo.

Parameters
strPathSpecifies the path to the files to load.
Returns
The list of SimpleDatum are returned.

Definition at line 2721 of file SimpleDatum.cs.

◆ LoadInfo()

static SimpleDatum MyCaffe.basecode.SimpleDatum.LoadInfo ( string  strFile)
static

Load a SimpleData from text file information previously saved with SaveInfo.

Note, the SimpleDatum only contains the information but no data for this is used for debugging.

Parameters
strFileSpecifies the file to load the SimpleDatum from.
Returns
The SimpleDatum is returned.

Definition at line 2661 of file SimpleDatum.cs.

◆ MaskOutAllButLastColumnsX()

void MyCaffe.basecode.SimpleDatum.MaskOutAllButLastColumnsX ( int  nLastColumsToRetain,
int  nMaskingValue 
)

DEPRECIATED: Masks out all data except for the last columns of data.

Parameters
nLastColumsToRetainSpecifies the number of last columns to retain.
nMaskingValueSpecifies the value to use for the masked columns.

Definition at line 1283 of file SimpleDatum.cs.

◆ PadData< T >()

static T[] MyCaffe.basecode.SimpleDatum.PadData< T > ( List< T >  rgData,
int  nImagePadX,
int  nImagePadY,
int  nHeight,
int  nWidth,
int  nChannels 
)
static

Padd the data.

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.
Parameters
rgDataSpecifies the data to pad.
nImagePadXOptionally, specifies the amount to pad the data width.
nImagePadYOptionally, specifies the amount to pad the data height.
nHeightSpecifies the height of the original data.
nWidthSpecifies the width of the original data.
nChannelsSpecifies the number of channels in the original data.
Returns
The padded data is returned as a generic array.

Definition at line 1683 of file SimpleDatum.cs.

◆ ResetBoost()

void MyCaffe.basecode.SimpleDatum.ResetBoost ( )

Reset the boost to the original boost.

Definition at line 2195 of file SimpleDatum.cs.

◆ ResetLabel()

void MyCaffe.basecode.SimpleDatum.ResetLabel ( )

Resets the label to the original label used when creating the SimpleDatum.

Definition at line 1429 of file SimpleDatum.cs.

◆ Resize()

SimpleDatum MyCaffe.basecode.SimpleDatum.Resize ( int  nH,
int  nW 
)

Resize the data and return it as a new SimpleDatum.

Parameters
nHSpecifies the new height.
nWSpecifies the new width.
Returns
A new resized SimpleDatum is returned.

Definition at line 2270 of file SimpleDatum.cs.

◆ SaveAnnotationDataToDataCriteria()

void MyCaffe.basecode.SimpleDatum.SaveAnnotationDataToDataCriteria ( )

Save the annotation data and type to the data criteria.

Definition at line 2575 of file SimpleDatum.cs.

◆ SaveAnnotationDataToDataCriteriaByteArray()

static byte[] MyCaffe.basecode.SimpleDatum.SaveAnnotationDataToDataCriteriaByteArray ( ANNOTATION_TYPE  type,
AnnotationGroupCollection  annotations 
)
static

Save the annotation data to a byte array.

Parameters
typeSpecifies the annotation type.
annotationsSpecifies the annotations to save.
Returns
The byte array containing the annotations is returned.

Definition at line 2546 of file SimpleDatum.cs.

◆ SaveInfo()

void MyCaffe.basecode.SimpleDatum.SaveInfo ( string  strFile)

Save the SimpleDatum information to a text file.

This function is typically used for debugging.

Parameters
strFileSpecifies the name of the target file.

Definition at line 2635 of file SimpleDatum.cs.

◆ Scale()

void MyCaffe.basecode.SimpleDatum.Scale ( double  dfScale,
double  dfMin = -double.MaxValue,
double  dfMax = double.MaxValue 
)

Scale the values by the scaling factor.

Parameters
dfScaleSpecifies the scaling factor.
dfMinOptionally, specifies a minimum cutoff value.
dfMaxOptionally, specifies a maximum cutoff value.

Definition at line 1043 of file SimpleDatum.cs.

◆ ScalePow()

void MyCaffe.basecode.SimpleDatum.ScalePow ( double  dfScalePow,
double  dfMin = -double.MaxValue,
double  dfMax = double.MaxValue 
)

Scale the values by the scaling factor that raises each value by the specified power.

Parameters
dfScalePowSpecifies the scaling factor.
dfMinOptionally, specifies a minimum cutoff value.
dfMaxOptionally, specifies a maximum cutoff value.

Definition at line 1089 of file SimpleDatum.cs.

◆ SetData() [1/7]

void MyCaffe.basecode.SimpleDatum.SetData ( byte[]  rgb,
int  nLabel 
)

Set the data to the byte array specified.

Parameters
rgbSpecifies the data to set.
nLabelSpecifies the label to set.

The data of the array is cast to either (double) for real data, or (byte) for the byte data.

Definition at line 1371 of file SimpleDatum.cs.

◆ SetData() [2/7]

void MyCaffe.basecode.SimpleDatum.SetData ( double[]  rgdf,
int  nLabel 
)

Set the data to the double array specified.

Parameters
rgdfSpecifies the data to set.
nLabelSpecifies the label to set.

The data of the array is cast to either (double) for real data, or (byte) for the byte data.

Definition at line 1389 of file SimpleDatum.cs.

◆ SetData() [3/7]

void MyCaffe.basecode.SimpleDatum.SetData ( float[]  rgf,
int  nLabel 
)

Set the data to the float array specified.

Parameters
rgfSpecifies the data to set.
nLabelSpecifies the label to set.

The data of the array is cast to either (double) for real data, or (byte) for the byte data.

Definition at line 1407 of file SimpleDatum.cs.

◆ SetData() [4/7]

void MyCaffe.basecode.SimpleDatum.SetData ( List< byte >  rgByteData,
int  nLabel,
bool  bAllowVirtualOverride = false 
)

Sets the byte data of the SimpleDatum and its Label.

Parameters
rgByteDataSpecifies the byte data.
bAllowVirtualOverrideOptionally, allow virtual ID override. When true the data can be set on a virtual SimpleDatum, otherwise it cannot.
nLabelSpecifies the label.

Definition at line 1312 of file SimpleDatum.cs.

◆ SetData() [5/7]

void MyCaffe.basecode.SimpleDatum.SetData ( List< double >  rgRealData,
int  nLabel,
bool  bAllowVirtualOverride = false 
)

Sets the double data of the SimpleDatum and its Label.

Parameters
rgRealDataSpecifies the double data.
nLabelSpecifies the label.
bAllowVirtualOverrideOptionally, allow virtual ID override. When true the data can be set on a virtual SimpleDatum, otherwise it cannot.

Definition at line 1331 of file SimpleDatum.cs.

◆ SetData() [6/7]

void MyCaffe.basecode.SimpleDatum.SetData ( List< float >  rgRealData,
int  nLabel,
bool  bAllowVirtualOverride = false 
)

Sets the float data of the SimpleDatum and its Label.

Parameters
rgRealDataSpecifies the float data.
nLabelSpecifies the label.
bAllowVirtualOverrideOptionally, allow virtual ID override. When true the data can be set on a virtual SimpleDatum, otherwise it cannot.

Definition at line 1350 of file SimpleDatum.cs.

◆ SetData() [7/7]

void MyCaffe.basecode.SimpleDatum.SetData ( SimpleDatum  d)

Set the data of the current SimpleDatum by copying the data of another.

Parameters
dSpecifies the SimpleDatum to copy.

Definition at line 1209 of file SimpleDatum.cs.

◆ SetImageID()

void MyCaffe.basecode.SimpleDatum.SetImageID ( int  nID)

Set the image ID.

Parameters
nIDSpecifies the image ID.

Definition at line 2061 of file SimpleDatum.cs.

◆ SetLabel()

void MyCaffe.basecode.SimpleDatum.SetLabel ( int  nLabel)

Sets the label.

Parameters
nLabelSpecifies the label.

Definition at line 1421 of file SimpleDatum.cs.

◆ Sub()

bool MyCaffe.basecode.SimpleDatum.Sub ( SimpleDatum  sd,
bool  bSetNegativeToZero = false 
)

Subtract the data of another SimpleDatum from this one, so this = this - sd.

Parameters
sdSpecifies the other SimpleDatum to subtract.
bSetNegativeToZeroOptionally, specifies to zero out any negative values (default = false).
Returns
If both data values are different true is returned, otherwise false is returned.

Definition at line 906 of file SimpleDatum.cs.

◆ SubAbs()

bool MyCaffe.basecode.SimpleDatum.SubAbs ( SimpleDatum  sd)

Subtract the data of another SimpleDatum from this one, and take the absolute value, so this = Math.Abs(this - sd).

Parameters
sdSpecifies the other SimpleDatum to subtract.
Returns
If both data values are different true is returned, otherwise false is returned.

Definition at line 988 of file SimpleDatum.cs.

◆ ToArrayAsString()

string MyCaffe.basecode.SimpleDatum.ToArrayAsString ( int  nMaxItems)

Returns a string containing the items of the SimpleDatum.

Parameters
nMaxItemsSpecifies the maximum number of items to output.
Returns
Returns a string containing the data items.

Definition at line 2307 of file SimpleDatum.cs.

◆ ToBytemap()

Bytemap MyCaffe.basecode.SimpleDatum.ToBytemap ( )

Return the SimpleData data as a Bytemap.

This function is only suported on byte based SimpleDatum's.

Returns
The Bytemap data is returned.

Definition at line 2351 of file SimpleDatum.cs.

◆ ToString()

override string MyCaffe.basecode.SimpleDatum.ToString ( )

Return a string representation of the SimpleDatum.

Returns
The string representation is returned.

Definition at line 2286 of file SimpleDatum.cs.

◆ Transpose() [1/2]

static double[] MyCaffe.basecode.SimpleDatum.Transpose ( double[]  rg,
int  nH,
int  nW,
int  nDim = 1 
)
static

Transpose the data within a double array.

Parameters
rgSpecifies the array of data.
nHSpecifies the height of the data.
nWSpecifies the width of the data.
nDimSpecifies the inner dimension of the data, default = 1
Returns
The data is returned in a new transposed array.

Definition at line 2771 of file SimpleDatum.cs.

◆ Transpose() [2/2]

static float[] MyCaffe.basecode.SimpleDatum.Transpose ( float[]  rg,
int  nH,
int  nW,
int  nDim = 1 
)
static

Transpose the data within a float array.

Parameters
rgSpecifies the array of data.
nHSpecifies the height of the data.
nWSpecifies the width of the data.
nDimSpecifies the inner dimension of the data, default = 1
Returns
The data is returned in a new transposed array.

Definition at line 2742 of file SimpleDatum.cs.

◆ Zero()

void MyCaffe.basecode.SimpleDatum.Zero ( )

Zero out all data in the datum but keep the size and other settings.

Definition at line 888 of file SimpleDatum.cs.

Member Data Documentation

◆ m_strTagName

string MyCaffe.basecode.SimpleDatum.m_strTagName = null
protected

Specifies the name of the user value.

Definition at line 54 of file SimpleDatum.cs.

◆ m_tag

object MyCaffe.basecode.SimpleDatum.m_tag = null
protected

Specifies a user value.

Definition at line 50 of file SimpleDatum.cs.

Property Documentation

◆ annotation_group

AnnotationGroupCollection MyCaffe.basecode.SimpleDatum.annotation_group
getset

When using annoations, each annotation group contains an annotation for a particular class used with SSD.

Definition at line 2258 of file SimpleDatum.cs.

◆ annotation_type

ANNOTATION_TYPE MyCaffe.basecode.SimpleDatum.annotation_type
getset

When using annotations, the annotation type specifies the type of annotation. Currently, only the BBOX annotation type is supported.

Definition at line 2249 of file SimpleDatum.cs.

◆ AutoLabeled

bool MyCaffe.basecode.SimpleDatum.AutoLabeled
getset

Get/set whether or not the label was auto generated.

Definition at line 2104 of file SimpleDatum.cs.

◆ Boost

int MyCaffe.basecode.SimpleDatum.Boost
getset

Get/set the boost for this data.

Definition at line 2186 of file SimpleDatum.cs.

◆ ByteData

byte [] MyCaffe.basecode.SimpleDatum.ByteData
get

Return the byte data. This field is valid when IsRealData = false.

Definition at line 2162 of file SimpleDatum.cs.

◆ Channels

int MyCaffe.basecode.SimpleDatum.Channels
get

Return the number of channels of the data.

Definition at line 2137 of file SimpleDatum.cs.

◆ DataCriteria

byte [] MyCaffe.basecode.SimpleDatum.DataCriteria
getset

Get/set data criteria associated with the data.

Definition at line 2212 of file SimpleDatum.cs.

◆ DataCriteriaFormat

DATA_FORMAT MyCaffe.basecode.SimpleDatum.DataCriteriaFormat
getset

Get/set the data format of the data criteria.

Definition at line 2203 of file SimpleDatum.cs.

◆ DebugData

byte [] MyCaffe.basecode.SimpleDatum.DebugData
getset

Get/set debug data associated with the data.

Definition at line 2230 of file SimpleDatum.cs.

◆ DebugDataFormat

DATA_FORMAT MyCaffe.basecode.SimpleDatum.DebugDataFormat
getset

Get/set the data format of the debug data.

Definition at line 2221 of file SimpleDatum.cs.

◆ Description

string MyCaffe.basecode.SimpleDatum.Description
getset

Get/set a description of the data.

Definition at line 2239 of file SimpleDatum.cs.

◆ GroupID

int MyCaffe.basecode.SimpleDatum.GroupID
getset

Get/set the group ID of the SimpleDatum.

Definition at line 2077 of file SimpleDatum.cs.

◆ HasRealData

bool MyCaffe.basecode.SimpleDatum.HasRealData
get

Returns true if either the RealDataD or RealDataF are non null and have length > 0.

Definition at line 1458 of file SimpleDatum.cs.

◆ Height

int MyCaffe.basecode.SimpleDatum.Height
get

Return the height of the data.

Definition at line 2121 of file SimpleDatum.cs.

◆ HitCount

int MyCaffe.basecode.SimpleDatum.HitCount
getset

Get/set the hit count for the SimpleDatum.

Definition at line 733 of file SimpleDatum.cs.

◆ ImageID

int MyCaffe.basecode.SimpleDatum.ImageID
get

Returns the ID of the image in the database.

Definition at line 2052 of file SimpleDatum.cs.

◆ Index

int MyCaffe.basecode.SimpleDatum.Index
getset

Returns the index of the SimpleDatum.

Definition at line 2086 of file SimpleDatum.cs.

◆ IsRealData

bool MyCaffe.basecode.SimpleDatum.IsRealData
get

Returns whether or not the data contains real numbers or byte data.

Definition at line 2113 of file SimpleDatum.cs.

◆ ItemCount

int MyCaffe.basecode.SimpleDatum.ItemCount
get

Returns the number of data items.

Definition at line 1437 of file SimpleDatum.cs.

◆ Label

int MyCaffe.basecode.SimpleDatum.Label
get

Return the known label of the data.

Definition at line 2145 of file SimpleDatum.cs.

◆ Max

double MyCaffe.basecode.SimpleDatum.Max
get

Returns the maximum value in the data or double.NaN if there is no data.

Definition at line 786 of file SimpleDatum.cs.

◆ Min

double MyCaffe.basecode.SimpleDatum.Min
get

Returns the minimum value in the data or double.NaN if there is no data.

Definition at line 760 of file SimpleDatum.cs.

◆ OriginalLabel

int MyCaffe.basecode.SimpleDatum.OriginalLabel
getset

Get/set the original known label of the data.

Definition at line 2153 of file SimpleDatum.cs.

◆ OriginalSourceID

int MyCaffe.basecode.SimpleDatum.OriginalSourceID
get

Returns the original source ID which is set when using a virtual ID.

Definition at line 2044 of file SimpleDatum.cs.

◆ RealDataD

double [] MyCaffe.basecode.SimpleDatum.RealDataD
get

Return the double data. This field is valid when IsRealData = true.

Definition at line 2170 of file SimpleDatum.cs.

◆ RealDataF

float [] MyCaffe.basecode.SimpleDatum.RealDataF
get

Return the float data. This field is valid when IsRealData = true.

Definition at line 2178 of file SimpleDatum.cs.

◆ SourceID

int MyCaffe.basecode.SimpleDatum.SourceID
get

Returns the ID of the data source that owns this image.

Definition at line 2036 of file SimpleDatum.cs.

◆ Tag

object MyCaffe.basecode.SimpleDatum.Tag
getset

Specifies user data associated with the SimpleDatum.

Definition at line 742 of file SimpleDatum.cs.

◆ TagName

string MyCaffe.basecode.SimpleDatum.TagName
getset

Returns a user-defined name of the tag associated with the data.

Definition at line 751 of file SimpleDatum.cs.

◆ TimeStamp

DateTime MyCaffe.basecode.SimpleDatum.TimeStamp
getset

Get/set the Timestamp.

Definition at line 2095 of file SimpleDatum.cs.

◆ VirtualID

int MyCaffe.basecode.SimpleDatum.VirtualID
get

Returns the virtual ID of the SimpleDatum.

Definition at line 2069 of file SimpleDatum.cs.

◆ Width

int MyCaffe.basecode.SimpleDatum.Width
get

Return the width of the data.

Definition at line 2129 of file SimpleDatum.cs.


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