Microscopy Image Browser 2.91
MIB
Loading...
Searching...
No Matches
Lines3D Class Reference

class is responsible for keeping 3d lines and skeletons More...

Inheritance diagram for Lines3D:
Collaboration diagram for Lines3D:

Public Member Functions

 Lines3D (Gin, activeNodeId, options)
 Constructor for the class.
 
function  clearContents ()
 Set all elements of the class to default values.
 
function  replaceGraph (Graph)
 replace the current graph object with a new graph
 
function GraphcalculateLengthOfNodes (Graph, options)
 calculate length of nodes
 
function options = getOptions ()
 get options of the class
 
function  setOptions (options)
 update options of the class
 
function [ Graph , nodeIds , EdgesTable , NodesTable ] = getTree (treeId)
 [Graph, nodeIds, EdgesTable, NodesTable] = function getTree(obj, treeId) return graph with the tree specified in treeId
 
function treeNames = getTreeNames (index)
 return name of trees
 
function [ noTrees , nodeByTree ] = updateNumberOfTrees ()
 update number of trees in the graph and get array of nodes by tree index
 
function  deleteTree (treeId)
 delete tree from the graph
 
function  insertNode (nodeId, x, y, z)
 insert node to a tree after nodeId, the inserted node becomes an active node
 
function  updateNodeCoordinate (nodeId, x, y, z)
 update coordinate of the node
 
function  addNode (x, y, z, newTreeSwitch, options)
 add a new node(s) to the graph; when x,y,z are columns of coordinates they are considered to be connected with edges
 
function  connectNodes (s, t)
 make an edge between two nodes
 
function nodeId = findClosestNode (x, y, z, orientation)
 find the closest node to a point with coordinates x, y, z
 
function  setActiveNode (x, y, z, orientation)
 set active the node which is closest to a point with coordinates x, y, z as the active node
 
function  splitAtNode (x, y, z, orientation)
 split tree at the node that is closest to the point with coordinates x, y, z the node and its edges will be removed
 
function result = deleteNode (x, y, z, orientation)
 delete node that is closest to the point with coordinates x, y, z the previous and following nodes get connected after remove of the node
 
function  makeDummyGraph ()
 generate a dummy graph for developmental purposes
 
function  updateNodeStrel (nodeStrelSize)
 update strel element for showing nodes as circles
 
function [ edge , edgeIds ] = clipEdge (Box)
 clip the edge using the Box matrix
 
function [ nodes , indices ] = findSliceNodes (z, orientation)
 find nodes that are shown on the current slice
 
function img = addLinesToImage (img, Box, options)
 add lines to the image
 
function  saveToFile (filename, options)
 save Lines3D to a file
 

Public Attributes

 G
 a graph with lines .Edges - a table containing information about edges of the graph .EndNodes - connectivity table [edgeId][Node1 Node2], each row defines an edge with indices of nodes that form the edge .Edges - matrix with coordinates of the edges, [edgeId][x1 y1 z1 x2 y2 z2], IN PHYSICAL UNITS .Weight - weights of edges .Length - length of nodes, IN PHYSICAL UNITS .Nodes - a table containing information about nodes of the graph .PointsXYZ - coordinates of nodes [NodeId][x, y, z] IN PHYSICAL UNITS to recalculate from pixels to the imaging units use mibImage.convertPixelsToUnits: .TreeName - a cell array where each nodes has name of tree to which the node belong, [NodeId]{TreeName} .NodeName - a cell array with names for the nodes, [NodeId]{NodeName} .Radius - a vector with radii of nodes .Properties.VariableUnits - a cell array with units for each variable, when coordinate are pixels, MIB suggest recompute them to image units .Properties.UserData.pixSize - a structure with pixSize of the underlying dataset .x - x resoulution, um/px .y - x resoulution, um/px .z - x resoulution, um/px .Properties.UserData.BoundingBox - a vector with the bounding box information [xmin, width, ymin, height, zmin, depth]
 
 activeNodeId = "[]"
 
 clipExtraThickness = 1
 index of the active node
 
 defaultNodeName = "Node"
 a number, extend clipping of the edges with additional thickness +/- this number sections default name for nodes
 
 defaultTreeName = "Tree"
 default name for trees
 
 edgeActiveColor = "[0.984, 0.549, 0.000]"
 
 edgeColor = "[1.000, 0.800, 0.502]"
 color of edges for the active tree [R, G, B], from 0 to 1
 
 edgeThickness = 2
 color of edges [R, G, B], from 0 to 1
 
 extraEdgeFields = "[]"
 thickness of edges
 
 extraEdgeFieldsNumeric = "[]"
 a cell array with names of additional fields in the Edges table of the graph object
 
 extraNodeFields = "[]"
 a vector with indicator whether the field in extraEdgeFields is numeric (1) or not (0)
 
 extraNodeFieldsNumeric = "[]"
 a cell array with names of additional fields in the Nodes table of the graph object
 
 filename = "[]"
 a vector with indicator whether the field in extraNodeFields is numeric (1) or not (0)
 
 nodeActiveColor = "[1.0000 0.0000 0]"
 filename of the Lines3D file
 
 nodeColor = "[1.0000 1.0000 0]"
 color of the active node [R, G, B], from 0 to 1
 
 nodeRadius = 5
 color of nodes [R, G, B], from 0 to 1
 
 nodeStrel
 radius of nodes
 
 noTrees = 0
 strel element for making nodes
 
 treeLengths
 number of trees of the graph total length of each tree, numeric array
 

Detailed Description

class is responsible for keeping 3d lines and skeletons

Constructor & Destructor Documentation

◆ Lines3D()

Lines3D.Lines3D ( Gin,
activeNodeId,
options )

Constructor for the class.

Constructor for the Lines3D class. Create a new instance of the class with default parameters

Parameters
Gin[optional] graph with 3d lines .Edges - a table containing information about edges of the graph .EndNodes - connectivity table [edgeId][Node1 Node2], each row defines an edge with indices of nodes that form the edge .Edges - matrix with coordinates of the edges, [edgeId][x1 y1 z1 x2 y2 z2] .Nodes - a table containing information about nodes of the graph .PointsXYZ - coordinates of nodes [NodeId][x, y, z] to recalculate from pixels to the imaging units use mibImage.convertPixelsToUnits .Properties.UserData.pixSize - pixSize structure .Properties.UserData.BoundingBox - bounding box [xmin, width, ymin, height, zmin, depth] .Properties.VariableUnits - a cell array with units for each variable, when coordinate are pixels, MIB suggest recompute them to image units
activeNodeId[optional] index of the active node, can be empty
options[optional] a structure with additional settings .edgeColor - color of edges [R, G, B], from 0 to 1 .edgeThickness - thickness of edges .nodeColor - color of nodes [R, G, B], from 0 to 1 .nodeActiveColor - color of the active node [R, G, B], from 0 to 1 .nodeRadius - radius of nodes

References activeNodeId.

Member Function Documentation

◆ addLinesToImage()

function img = Lines3D.addLinesToImage ( img,
Box,
options )

add lines to the image

Parameters
imgimage where lines should be added
Boxa vector with a clipping box [xmin xmax ymin ymax zmin zmax]
optionsan optional structure with additional parameters .orientation - a number that specifies desired orientation, 4-yx, 1-xz, 2-yz
Return values
imgan image with fused lines
Required fields of options:

References max, and min.

◆ addNode()

function Lines3D.addNode ( x,
y,
z,
newTreeSwitch,
options )

add a new node(s) to the graph; when x,y,z are columns of coordinates they are considered to be connected with edges

Parameters
xa column of x coordinates of nodes (in physical units)
ya column of y coordinates of nodes (in physical units)
za column of z coordinates of nodes (in physical units)
newTreeSwitchan optional switch to start a new tree
optionsa structure with optional parameters .pixSize - structure with pixel sizes of the dataset .BoundingBox - a vector with the bounding box information [xmin, width, ymin, height, zmin, depth]
Required fields of options:

◆ calculateLengthOfNodes()

function Graph = Lines3D.calculateLengthOfNodes ( Graph,
options )

calculate length of nodes

Parameters
Grapha graph object
options[optional] - an optional structure with additional parameters .nodeId - ids of nodes that include edges that should be recalculated
Return values
Graphthe graph object with added/modified Length field
Required fields of Graph:
Required fields of options:
Generated fields of Graph:

◆ clearContents()

function Lines3D.clearContents ( )

Set all elements of the class to default values.

Examples:

obj.mibModel.I{obj.mibModel.Id}.Lines3D.clearContents();

◆ clipEdge()

function [ edge , edgeIds ] = Lines3D.clipEdge ( Box)

clip the edge using the Box matrix

Parameters
Boxa vector used for cliping the edges [xMin, xMax, yMin, yMax, zMin, zMax]
Return values
edgea matrix of edges shown inside the clipping box, [x1 y1 z1 x2 y2 z2]
edgeIdsindices of the returned edges

References clipEdge3d().

Here is the call graph for this function:

◆ connectNodes()

function Lines3D.connectNodes ( s,
t )

make an edge between two nodes

Parameters
sindex of the first node
tindex of the second node

References max.

◆ deleteNode()

function result = Lines3D.deleteNode ( x,
y,
z,
orientation )

delete node that is closest to the point with coordinates x, y, z the previous and following nodes get connected after remove of the node

Return value
results: type of the node that was deleted removed tree - the last node of a tree was removed, so the tree middle node - the removed node was in a middle of a tree multiple split - the node had more than 2 connections and as result multiple new trees were formed
Parameters
xx coordinate of a point next to the node, or index of the node (in this case, y and z should be empty)
yy coordinate of a point next to the node
zz coordinate of a point next to the node
orientation[optional] a number with orientation of the dataset, 4-yx, 1-xz, 2-yz, default 4

References N.

◆ deleteTree()

function Lines3D.deleteTree ( treeId)

delete tree from the graph

Parameters
treeIdindex of the tree to delete, or string with name of the tree

◆ findClosestNode()

function nodeId = Lines3D.findClosestNode ( x,
y,
z,
orientation )

find the closest node to a point with coordinates x, y, z

Parameters
xx coordinate of a point next to the node
yy coordinate of a point next to the node
zz coordinate of a point next to the node
orientation[optional] a number with orientation of the dataset, 4-yx, 1-xz, 2-yz, default 4

References distancePoints(), and min.

Here is the call graph for this function:

◆ findSliceNodes()

function [ nodes , indices ] = Lines3D.findSliceNodes ( z,
orientation )

find nodes that are shown on the current slice

Parameters
zZ-value to obtain the nodes
orientation[optional, default 4 for XY] a number that specifies desired orientation, 4-yx, 1-xz, 2-yz
Return values
nodesa matrix with coordinates of nodes [node; x, y, z]
indicesa vector with indices of returned nodes

◆ getOptions()

function options = Lines3D.getOptions ( )

get options of the class

Generated fields of options:

Referenced by mibLines3DController.saveBtn_Callback().

Here is the caller graph for this function:

◆ getTree()

function [ Graph , nodeIds , EdgesTable , NodesTable ] = Lines3D.getTree ( treeId)

[Graph, nodeIds, EdgesTable, NodesTable] = function getTree(obj, treeId) return graph with the tree specified in treeId

Parameters
treeIdindex of tree to get
Return values
Graphgraph object containing tree specified in treeId
nodeIdsindices of nodes belonging to this tree
EdgesTablea table with edges that belong to treeId
NodesTablea table with nodes that belong to treeId

◆ getTreeNames()

function treeNames = Lines3D.getTreeNames ( index)

return name of trees

Parameters
index[optional] indices of the trees
Return values
treeNamesa cell array with names of trees

◆ insertNode()

function Lines3D.insertNode ( nodeId,
x,
y,
z )

insert node to a tree after nodeId, the inserted node becomes an active node

Parameters
nodeIdindex of the node after which a new node should be inserted
xnew x coordinate
ynew y coordinate
znew z coordinate

◆ makeDummyGraph()

function Lines3D.makeDummyGraph ( )

generate a dummy graph for developmental purposes

◆ replaceGraph()

function Lines3D.replaceGraph ( Graph)

replace the current graph object with a new graph

.Edges - a table containing information about edges of the graph .EndNodes - connectivity table [edgeId][Node1 Node2], each row defines an edge with indices of nodes that form the edge .Edges - [optional] a matrix with coordinates of the edges, [edgeId][x1 y1 z1 x2 y2 z2], (in physical units) .Weight - [optional] a vector of weights for each edge .Length - [optional] a vector of length for each edge (in physical units)

Parameters
Graphgraph object with a new graph, required fields (may have more) .Nodes - a table containing information about nodes of the graph .PointsXYZ - matrix with coordinates of nodes [nodeId](x, y, z) (in physical units) to recalculate from pixels to the imaging units use mibImage.convertPixelsToUnits .TreeName - [optional] a cell array where each entry contains name of the node's parant tree .NodeName - [optional] a cell array where each entry has name of the corresponding node .Radius - [optional] a vector with radius parameter for each node .[name_of_field] - [optional] optional fields as either array of vectors or cells .Properties.UserData.pixSize - a structure with pixSize of the underlying dataset .x - x resoulution, um/px .y - x resoulution, um/px .z - x resoulution, um/px .Properties.UserData.BoundingBox - a vector with the bounding box information [xmin, width, ymin, height, zmin, depth] .Properties.VariableUnits - a cell array with units for each variable, when coordinate are pixels, MIB suggest recompute them to image units
Required fields of Graph:

References convertPixelsToUnits(), and max.

Here is the call graph for this function:

◆ saveToFile()

function Lines3D.saveToFile ( filename,
options )

save Lines3D to a file

Parameters
filenamefull path to file
optionsa structure with optional paramters .format - a char string lines3d - MIB lines3d format amira-ascii - amira ascii amira-binary - amira binary excel - Microsoft Excel format .treeId - a number with index of a tree to save, when empty save all graph .NodeFieldName - [optional] name of variable for nodes to save, only for Amira .EdgeFieldName - [optional] name of variable for edges to save, only for Amira .showWaitbar - [optional] a number 1-show; 0-do not show the waitbar
Required fields of options:

References filename, graph2amiraSpatialGraph(), mibInputMultiDlg(), and xlswrite2().

Here is the call graph for this function:

◆ setActiveNode()

function Lines3D.setActiveNode ( x,
y,
z,
orientation )

set active the node which is closest to a point with coordinates x, y, z as the active node

Parameters
xx coordinate of a point next to the node
yy coordinate of a point next to the node
zz coordinate of a point next to the node
orientation[optional] a number with orientation of the dataset, 4-yx, 1-xz, 2-yz, default 4

◆ setOptions()

function Lines3D.setOptions ( options)

update options of the class

◆ splitAtNode()

function Lines3D.splitAtNode ( x,
y,
z,
orientation )

split tree at the node that is closest to the point with coordinates x, y, z the node and its edges will be removed

Parameters
xx coordinate of a point next to the node
yy coordinate of a point next to the node
zz coordinate of a point next to the node
orientation[optional] a number with orientation of the dataset, 4-yx, 1-xz, 2-yz, default 4

References min, and N.

◆ updateNodeCoordinate()

function Lines3D.updateNodeCoordinate ( nodeId,
x,
y,
z )

update coordinate of the node

Parameters
nodeIdindex of the node to update
xnew x coordinate
ynew y coordinate
znew z coordinate

◆ updateNodeStrel()

function Lines3D.updateNodeStrel ( nodeStrelSize)

update strel element for showing nodes as circles

◆ updateNumberOfTrees()

function [ noTrees , nodeByTree ] = Lines3D.updateNumberOfTrees ( )

update number of trees in the graph and get array of nodes by tree index

Return values
noTreestotal number of isolated trees of the graph
nodeByTreevector of nodes, where values indicate corresponding tree of the node

References max, and noTrees.

Member Data Documentation

◆ activeNodeId

◆ clipExtraThickness

Lines3D.clipExtraThickness = 1

index of the active node


Default: 1

◆ defaultNodeName

Lines3D.defaultNodeName = "Node"

a number, extend clipping of the edges with additional thickness +/- this number sections default name for nodes


Default: "Node"

◆ defaultTreeName

Lines3D.defaultTreeName = "Tree"

default name for trees


Default: "Tree"

◆ edgeActiveColor

Lines3D.edgeActiveColor = "[0.984, 0.549, 0.000]"

◆ edgeColor

Lines3D.edgeColor = "[1.000, 0.800, 0.502]"

color of edges for the active tree [R, G, B], from 0 to 1


Default: "[1.000, 0.800, 0.502]"

◆ edgeThickness

Lines3D.edgeThickness = 2

color of edges [R, G, B], from 0 to 1


Default: 2

◆ extraEdgeFields

Lines3D.extraEdgeFields = "[]"

thickness of edges


Default: "[]"

◆ extraEdgeFieldsNumeric

Lines3D.extraEdgeFieldsNumeric = "[]"

a cell array with names of additional fields in the Edges table of the graph object


Default: "[]"

◆ extraNodeFields

Lines3D.extraNodeFields = "[]"

a vector with indicator whether the field in extraEdgeFields is numeric (1) or not (0)


Default: "[]"

◆ extraNodeFieldsNumeric

Lines3D.extraNodeFieldsNumeric = "[]"

a cell array with names of additional fields in the Nodes table of the graph object


Default: "[]"

◆ filename

Lines3D.filename = "[]"

a vector with indicator whether the field in extraNodeFields is numeric (1) or not (0)


Default: "[]"

Referenced by mibLines3DController.loadBtn_Callback(), and saveToFile().

◆ G

Lines3D.G

a graph with lines .Edges - a table containing information about edges of the graph .EndNodes - connectivity table [edgeId][Node1 Node2], each row defines an edge with indices of nodes that form the edge .Edges - matrix with coordinates of the edges, [edgeId][x1 y1 z1 x2 y2 z2], IN PHYSICAL UNITS .Weight - weights of edges .Length - length of nodes, IN PHYSICAL UNITS .Nodes - a table containing information about nodes of the graph .PointsXYZ - coordinates of nodes [NodeId][x, y, z] IN PHYSICAL UNITS to recalculate from pixels to the imaging units use mibImage.convertPixelsToUnits: .TreeName - a cell array where each nodes has name of tree to which the node belong, [NodeId]{TreeName} .NodeName - a cell array with names for the nodes, [NodeId]{NodeName} .Radius - a vector with radii of nodes .Properties.VariableUnits - a cell array with units for each variable, when coordinate are pixels, MIB suggest recompute them to image units .Properties.UserData.pixSize - a structure with pixSize of the underlying dataset .x - x resoulution, um/px .y - x resoulution, um/px .z - x resoulution, um/px .Properties.UserData.BoundingBox - a vector with the bounding box information [xmin, width, ymin, height, zmin, depth]

Referenced by mibLines3DController.loadBtn_Callback(), and mibLines3DController.saveBtn_Callback().

◆ nodeActiveColor

Lines3D.nodeActiveColor = "[1.0000 0.0000 0]"

filename of the Lines3D file


Default: "[1.0000 0.0000 0]"

◆ nodeColor

Lines3D.nodeColor = "[1.0000 1.0000 0]"

color of the active node [R, G, B], from 0 to 1


Default: "[1.0000 1.0000 0]"

◆ nodeRadius

Lines3D.nodeRadius = 5

color of nodes [R, G, B], from 0 to 1


Default: 5

◆ nodeStrel

Lines3D.nodeStrel

radius of nodes

◆ noTrees

Lines3D.noTrees = 0

strel element for making nodes


Default: 0

Referenced by updateNumberOfTrees().

◆ treeLengths

Lines3D.treeLengths

number of trees of the graph total length of each tree, numeric array


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