Singer Instruments PIXL Client
Running Random Colony Picking
This topic assumes that there is an instance of the PIXLClient object called pixl. If this is not the case, please see the Connecting To The PIXL topic.

The Random Colony Picking workflow is a key feature of the PIXL. This workflow is made up of the following key steps:

The Random Colony Picking workflow is broken down into a flow diagram that can be viewed here.

From a clients point of view the following need steps need to be implemented in order to run a Random Colony Picking workflow:

For further examples on how to manage plates please see the Loading And Swapping PlatesRemoving Plates, and Handling Plate Requests topics.

Whenever there is a pending plate interaction it can be cancelled by calling the Abort method event on the PIXLClient.

Once the workflow has been triggered and all plates loaded the PIXL will run the workflow. By providing the name of a Project Template and a Pinning Profile the settings the PIXL uses to create the pinning program and run the pinning's can be adjusted. If an empty string is provided for either setting the last used Project Template or Pinning Profile are used.

Available Project Templates and Pinning Profiles can be viewed by checking the AvailableRandomColonyPickingProjectTemplates and AvailablePinningProfiles properties on the PIXLClient class.
Running the Random Colony Picking workflow with the last used Project Template and Pinning Profile
Copy Code
pixl.RunRandomColonyPickingWorkflow("ID1234", string.Empty, string.Empty);

The Random Colony Picking workflow returns an instance of the RunRandomColonyPickingWorkflowCommandResponse class, which contains information on the status of the finished operation as well as all data captured relating to the workflow.

Running the Random Colony Picking workflow and displaying all captured data on the Console
Copy Code
// Run the workflow.
var result = pixl.RunRandomColonyPickingWorkflow("ID1234", string.Empty, string.Empty).Result;

// Display the result.
Console.WriteLine(result.Result.Message.ToString());

// Display the local tracking base path.
Console.WriteLine($"Tracking base: {result.TrackingPath}");

// Display the program ID.
Console.WriteLine($"Program ID: {result.ProgramInformation.ProgramID}");

// Use a StringBuilder to concatenate all information to display.
var stringBuilder = new StringBuilder();

// Concatenate colony information.
for (var i = 0; i < result.ProgramInformation.ColonyInformation.Length; i++)
{
    var colony = result.ProgramInformation.ColonyInformation[i];
    stringBuilder.AppendLine($"---{i + 1} of {result.ProgramInformation.ColonyInformation.Length}:");
    stringBuilder.AppendLine($"------ID: {colony.ID}");
    stringBuilder.AppendLine($"------Name: {colony.Name}");
    stringBuilder.AppendLine($"------IsSelected: {colony.IsSelected}");
    stringBuilder.AppendLine($"------SectorID: {colony.SectorID}");
    stringBuilder.AppendLine($"------X: {colony.X}");
    stringBuilder.AppendLine($"------Y: {colony.Y}");
    stringBuilder.AppendLine($"------Area: {colony.Area}");
    stringBuilder.AppendLine($"------Diameter: {colony.Diameter}");
    stringBuilder.AppendLine($"------Brightness: {colony.Brightness}");
    stringBuilder.AppendLine($"------AverageRed: {colony.AverageRed}");
    stringBuilder.AppendLine($"------AverageGreen: {colony.AverageGreen}");
    stringBuilder.AppendLine($"------AverageBlue: {colony.AverageBlue}");
    stringBuilder.AppendLine($"------Redness: {colony.Redness}");
    stringBuilder.AppendLine($"------Greenness: {colony.Greenness}");
    stringBuilder.AppendLine($"------Blueness: {colony.Blueness}");
    stringBuilder.AppendLine($"------ProximityToClosest: {colony.ProximityToClosest}");
}

// If there were no colonies add an entry to inform the user of this.
if (result.ProgramInformation.ColonyInformation.Length == 0)
    stringBuilder.AppendLine("---None");

// Display pinning header.
Console.WriteLine("Colonies:");

// Display colony information.
Console.WriteLine(stringBuilder.ToString());

// Clear the StringBuilder ready for pinning information.
stringBuilder.Clear();

// Concatenate all pinning information.
for (var i = 0; i < result.ProgramInformation.Pinnings.Length; i++)
{
    var pinning = result.ProgramInformation.Pinnings[i];
    stringBuilder.AppendLine($"---{i + 1} of {result.ProgramInformation.Pinnings.Length}: ");
    stringBuilder.AppendLine($"------ID: {pinning.PinningID}");
    stringBuilder.AppendLine($"------Date/Time: {pinning.DateTime}");
    stringBuilder.AppendLine($"---------Source: {1} of {1}");
    stringBuilder.AppendLine($"------------Plate ID: {pinning.Source.PlateID}");
    stringBuilder.AppendLine($"------------Plate Name: {pinning.Source.PlateName}");
    stringBuilder.AppendLine($"------------Colony ID: {pinning.Source.ColonyID}");
    stringBuilder.AppendLine($"------------Colony Name: {pinning.Source.ColonyName}");
    stringBuilder.AppendLine($"------------X: {pinning.Source.X}");
    stringBuilder.AppendLine($"------------Y: {pinning.Source.Y}");
    stringBuilder.AppendLine($"------------Result: {pinning.Source.Result}");

    // Concatenate all target information for this pinning.
    for (var j = 0; j < pinning.Targets.Length; j++)
    {
        var target = pinning.Targets[j];
        stringBuilder.AppendLine($"---------Target {j + 1} of {pinning.Targets.Length}:");
        stringBuilder.AppendLine($"------------Plate ID: {target.PlateID}");
        stringBuilder.AppendLine($"------------Plate Name: {target.PlateName}");
        stringBuilder.AppendLine($"------------Location: {target.Location}");
        stringBuilder.AppendLine($"------------X: {target.X}");
        stringBuilder.AppendLine($"------------Y: {target.Y}");
        stringBuilder.AppendLine($"------------Result: {target.Result}");
    }
}

// If there were no pinnings add an entry to inform the user of this.
if (result.ProgramInformation.Pinnings.Length == 0)
    stringBuilder.AppendLine("-None");

// Display pinning header.
Console.WriteLine("Pinnings:");

// Display pinning information
Console.WriteLine(stringBuilder.ToString());

It is recommended that all plates should be removed from the PIXL when it finishes a workflow. After a plate has been removed call the PlateRemoved method on the PIXLClient to notify the PIXL of all plates that have been removed.

See Also

Getting Started

Reference

Managing Plates