ROIs from SVG files


Version: 2023

Type: Features

Category: Analysis

Subcategory: Image Processing

Jira: ORG-23789


1.LabTalk command to create a gr. object(only work for Graph):

draw -paths objName <pathname of .SVG file>

2.LabTalk command to create a gr. object, and initially set the rectangle of the created object (only work for Graph):

draw -paths -s MyPath "<path name of downloaded 100960033.svg>"

3.LabTalk command to create a gr. object, and support creating ROI from the path in graph object(work for Graph, Matrix, Image):

draw -paths -d MyPath "<path name of downloaded 100960033.svg>"

4.OC way to add/remove SVG file to a matrix layer and associate it with the active matrix object by index:

4.1.Compile following code and execute load_svg_to_matrix("<svg pathname>") to add SVG file to the active Matrix object of matrix layer.

void	load_svg_to_matrix(string strPathName)
{
	MatrixLayer			matlayer = Project.ActiveLayer();
	if (!matlayer)
	{
		out_str("Matrix must be active!");
		return;
	}
	
	LPCOSTR				lpcszPathName = strPathName;
	OLP					olpRet = matlayer.PathsObjectsManagement(PATHSMNG_ADD_PATHS_OBJ, lpcszPathName);
	if (olpRet <= 0)
	{
		out_str("Failed to add SVG!");
		return;
	}
}

4.2.Compile following code and execute remove_all_svgs_from_matrix() to remove all SVG files from active Matrix layer.

void	remove_all_svgs_from_matrix()
{
	MatrixLayer			matlayer = Project.ActiveLayer();
	if (!matlayer)
	{
		out_str("Matrix must be active!");
		return;
	}
	
	OLP					olpCountRemoved = matlayer.PathsObjectsManagement(PATHSMNG_REMOVE_ALL);
	out_int("Paths objects removed: ", olpCountRemoved);
}