No BSD License
Highlights from
GeoML
-
GeoML: intro
-
ATE_EdgeDistance(varargin)
ATE_EDGEDISTANCE Computes the energy using the distance from edges.
-
ATE_GradientNorm(varargin)
ATE_GRADIENTNORM Computes the energy using the norm of gradient.
-
ATOptimize(img,model,free,Eex...
ATOPTIMIZE Optimizes a shape model over an image.
-
GeoMLConvertToTree(model,visi...
GEOMLCONVERTTOTREE Converts a tree containing a model.
-
GeoMLGenerateTree(model,visib...
GEOMLGENERATETREE Generates a tree containing a model.
-
GeoMLIterate(model,join,mode)
GEOMLITERATE Iterate on a model.
-
GeoMLParseModel(modelname)
GEOMLPARSEMODEL Parsing of a GeoML XML model description.
-
gauss(x, sigma, mu, norm)
GAUSS Return the monodimensional gaussian function
-
gaussianFilter(varargin)
GAUSSIANFILTER Filters an image using the gaussian derivative filter
-
impixels(img,P)
IMPIXELS Get the values of image pixels at defined points.
-
imscale(img, range)
IMSCALE Scale an image to fit the range
-
imtype(img, type)
IMTYPE Chenges the type of an image
-
plotpoints(X,symbol)
PLOTPOINTS This function allow to plot a series of points
-
plotshape(X, closed, symbol)
PLOTSHAPE This function allow to plot a single shape
-
points2dnormalize(Pi,mustRemo...
POINTS2DNORMALIZE Normalize 2d points
-
points2domogenize(Pi)
POINTS2DOMOGENIZE Enshure a 3-coords omogeneous set of points
-
View all files
from
GeoML
by Gabriele Lombardi
A general morphable template tool for image segmentation.
|
| GeoMLGenerateTree(model,visible) |
function tree = GeoMLGenerateTree(model,visible)
% GEOMLGENERATETREE Generates a tree containing a model.
%
% function tree = GeoMLGenerateTree(model,visible)
%
% This function generates a tree containing a model hierarchy using
% structs as group containers. Only groups are expanded, other compounds
% like parameters and transformations aren't expanded. This function does
% not convert entities in matlab objects, another function must be used to
% do this. Each structure describes a group and contain a field 'this' that
% contain the group entity that generates the group.
%
% Params
% ------
% IN:
% model = The GeoML model.
% visible = Only visible entities must be inserted? (def=true)
% OUT:
% tree = The model tree without groups.
%
% Pre
% ---
% - The model must be a GeoML valid model.
%
% Post
% - The tree contains all the model entities except the hidden ones if not
% required.
% - The tree order isn't the same of the XML file.
% Check params:
if nargin<1 error('A model must be given!'); end
if nargin<2 visible=true; end
% Check if the model is a group:
if ~isa(model,'com.dsi.libs.geoml.Group')
% Returning the model itself:
tree = model;
return;
end
% Preparing the struct:
tree = struct;
% Iterating on the model parts:
i = model.iterator;
while i.hasNext
% Getting an entity:
e = i.next;
% Check if we must insert this entity:
if e.isVisible || ~visible
% Checking the type of the component:
if isa(e,'com.dsi.libs.geoml.Group')
% This is a group:
tree = setfield(tree,char(e.getName),GeoMLGenerateTree(e,visible));
else
% This is another entity:
tree = setfield(tree,char(e.getName),e);
end
end
end
% Adding this to the tree:
tree = setfield(tree,'this',model);
|
|
Contact us at files@mathworks.com