Vectors¶
A vector is a one-dimensional array of pixels (taken from an image profile or contour).
EVector .NET Python is the base class for all vectors. It contains all non-type-specific methods, mainly for counting elements and serialization.
Profile in a C24 image, RGB values plot along profile and RGB values array (EC24Vector .NET Python)¶
A vector manages an array of elements. Memory allocation is transparent, so vectors can be resized dynamically. Whenever a function uses a vector, the vector type, size and structure are automatically adjusted to suit the function needs.
The use of vectors is quite straightforward:
To create a vector of the appropriate type:
Use its constructor and preallocate elements if required.
To fill a vector with values:
Call the
EVector::Empty.NET Python member to empty it.Call the
EC24Vector::AddElement.NET Python member to add elements one by one.Use the indexing to access any element.
To access a vector element, either for reading or writing:
Use the brackets operator
EC24Vector::operator[].
To determine the current number of elements:
Use the
EVector::GetNumElements.NET Python member.
To draw the vector:
A pixel vector is a plot of the element values as a function of the element index, so its graphical appearance depends on its type. You can draw a vector in a window. For legibility, the drawing should appear on a neutral background.
Drawing is done in the device context associated to the desired window. By default, curves are drawn in blue and annotations in black. You can define:
graphicContext,width,height,originX,originY,color0,color1andcolor2.The
EC24Vector.NET Python has three curves drawn instead of one, each corresponding to a color component. By default the red, blue and green pens are used.
Vector types¶
EBW8Vector.NET Python: a sequence of gray-level pixel values, often extracted from an image profile (used byEasyImage::Lut.NET Python,EasyImage::SetupEqualize.NET Python,EasyImage::ImageToLineSegment.NET Python,EasyImage::LineSegmentToImage.NET Python,EasyImage::ProfileDerivative.NET Python…).
Graphical representation of an
EBW8Vector.NET Python (seeEBW8Vector::Draw.NET Python method)¶EBW16Vector.NET Python: a sequence of gray-level pixel values, using an extended range (16 bits), mainly for intermediate computations.
Graphical representation of an
EBW16Vector.NET Python¶EBW32Vector.NET Python: a sequence of gray-level pixel values, using an extended range (32 bits), mainly for intermediate computations (used inEasyImage::ProjectOnARow.NET Python,EasyImage::ProjectOnAColumn.NET Python…).
Graphical representation of an
EBW32Vector.NET Python¶EC24Vector.NET Python: a sequence of color pixel values, often extracted from an image profile (used byEasyImage::ImageToLineSegment.NET Python,EasyImage::LineSegmentToImage.NET Python,EasyImage::ProfileDerivative.NET Python…).
Graphical representation of an
EC24Vector.NET Python¶EBW8PathVector.NET Python: a sequence of gray-level pixel values, extracted from an image profile or contour, with corresponding pixel coordinates (used byEasyImage::ImageToPath.NET Python,EasyImage::PathToImage.NET Python…).
Graphical representation of an
EBW8PathVector.NET Python (seeEBW8PathVector::Draw.NET Python method)¶EBW16PathVector.NET Python: a sequence of gray-level pixel values, extracted from an image profile or contour, with corresponding pixel coordinates (used byEasyImage::ImageToPath.NET Python,EasyImage::PathToImage.NET Python…).
Graphical representation of an
EBW16PathVector.NET Python (seeEBW16PathVector::Draw.NET Python method)¶EC24PathVector.NET Python: a sequence of color pixel values, extracted from an image profile or contour, with corresponding pixel coordinates (used byEasyImage::ImageToPath.NET Python,EasyImage::PathToImage.NET Python…).
Graphical representation of an
EC24PathVector.NET Python (seeEC24PathVector::Draw.NET Python method)¶EBWHistogramVector.NET Python: a sequence of frequency counts of pixels in a BW8 or BW16 image (used byEasyImage::IsodataThreshold.NET Python,EasyImage::Histogram.NET Python,EasyImage::AnalyseHistogram.NET Python,EasyImage::SetupEqualize.NET Python…).
Graphical representation of an
EBWHistogramVector.NET Python (seeEBWHistogramVector::Draw.NET Python method)¶EPathVector.NET Python: a sequence of pixel coordinates. The corresponding pixels need not be contiguous (used byEasyImage::PathToImage.NET Python andEasyImage::Contour.NET Python).
Graphical representation of an
EPathVector.NET Python (seeEPathVector::Draw.NET Python method)¶EPeakVector.NET Python: peaks found in an image profile (used byEasyImage::GetProfilePeaks.NET Python).EColorVector.NET Python: a description of colors (used byEasyColor::ClassAverages.NET Python andEasyColor::ClassVariances.NET Python).