Class Signature
Represents a signature as a collection of features, containing the data that flows in the pipeline.
Inheritance
Namespace: SigStat.Common
Assembly: SigStat.Common.dll
Syntax
public class Signature : IEnumerable<KeyValuePair<FeatureDescriptor, object>>
Constructors
| Improve this Doc View SourceSignature()
Initializes a signature instance
Declaration
public Signature()
Signature(String, Origin, Signer)
Initializes a signature instance with the given properties
Declaration
public Signature(string signatureID, Origin origin = default(Origin), Signer signer = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | signatureID | |
Origin | origin | |
Signer | signer |
Properties
| Improve this Doc View SourceID
An identifier for the Signature. Keep it unique to be useful for logs.
Declaration
public string ID { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Item[FeatureDescriptor]
Gets or sets the specified feature.
Declaration
public object this[FeatureDescriptor featureDescriptor] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
FeatureDescriptor | featureDescriptor |
Property Value
Type | Description |
---|---|
System.Object | The feature object without cast. |
Item[String]
Gets or sets the specified feature.
Declaration
public object this[string featureKey] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | featureKey |
Property Value
Type | Description |
---|---|
System.Object | The feature object without cast. |
Origin
Represents our knowledge on the origin of the signature. Unknown may be used in practice before it is verified.
Declaration
public Origin Origin { get; set; }
Property Value
Type | Description |
---|---|
Origin |
Signer
A reference to the Signer who this signature belongs to. (The origin is not constrained to be genuine.)
Declaration
public Signer Signer { get; set; }
Property Value
Type | Description |
---|---|
Signer |
Methods
| Improve this Doc View SourceGetAggregateFeature(List<FeatureDescriptor>)
Aggregate multiple features into one. Example: X, Y features -> P.xy feature. Use this for example at DTW algorithm input.
Declaration
public List<double[]> GetAggregateFeature(List<FeatureDescriptor> fs)
Parameters
Type | Name | Description |
---|---|---|
List<FeatureDescriptor> | fs | List of features to aggregate. |
Returns
Type | Description |
---|---|
List<System.Double[]> | Aggregated feature value |
GetEnumerator()
Returns an enumerator that iterates through the features.
Declaration
public IEnumerator<KeyValuePair<FeatureDescriptor, object>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<FeatureDescriptor, System.Object>> | An enumerator that can be used to iterate through the features. |
GetFeature<T>(FeatureDescriptor)
Gets the specified feature. This is the preferred way.
Declaration
public T GetFeature<T>(FeatureDescriptor featureDescriptor)
Parameters
Type | Name | Description |
---|---|---|
FeatureDescriptor | featureDescriptor |
Returns
Type | Description |
---|---|
T | The casted feature object |
Type Parameters
Name | Description |
---|---|
T |
GetFeature<T>(FeatureDescriptor<T>)
Gets the specified feature. This is the preferred way.
Declaration
public T GetFeature<T>(FeatureDescriptor<T> featureDescriptor)
Parameters
Type | Name | Description |
---|---|---|
FeatureDescriptor<T> | featureDescriptor |
Returns
Type | Description |
---|---|
T | The casted feature object |
Type Parameters
Name | Description |
---|---|
T |
GetFeature<T>(String)
Gets the specified feature.
Declaration
public T GetFeature<T>(string featureKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | featureKey |
Returns
Type | Description |
---|---|
T | The casted feature object |
Type Parameters
Name | Description |
---|---|
T |
GetFeatureDescriptors()
Gets a collection of FeatureDescriptors that are used in this signature.
Declaration
public IEnumerable<FeatureDescriptor> GetFeatureDescriptors()
Returns
Type | Description |
---|---|
IEnumerable<FeatureDescriptor> | A collection of FeatureDescriptors. |
HasFeature(FeatureDescriptor)
Returns true if the signature contains the specified feature
Declaration
public bool HasFeature(FeatureDescriptor featureDescriptor)
Parameters
Type | Name | Description |
---|---|---|
FeatureDescriptor | featureDescriptor |
Returns
Type | Description |
---|---|
System.Boolean |
HasFeature(String)
Returns true if the signature contains the specified feature
Declaration
public bool HasFeature(string featureKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | featureKey |
Returns
Type | Description |
---|---|
System.Boolean |
SetFeature<T>(FeatureDescriptor, T)
Sets the specified feature.
Declaration
public Signature SetFeature<T>(FeatureDescriptor featureDescriptor, T feature)
Parameters
Type | Name | Description |
---|---|---|
FeatureDescriptor | featureDescriptor | The feature to put the new value in. |
T | feature | The value to set. |
Returns
Type | Description |
---|---|
Signature |
Type Parameters
Name | Description |
---|---|
T |
SetFeature<T>(String, T)
Sets the specified feature.
Declaration
public Signature SetFeature<T>(string featureKey, T feature)
Parameters
Type | Name | Description |
---|---|---|
System.String | featureKey | The unique key of the feature. |
T | feature | The value to set. |
Returns
Type | Description |
---|---|
Signature |
Type Parameters
Name | Description |
---|---|
T |
ToString()
Returns a string representation of the signature
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |