public class Compare extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Compare.CATAParameters
Compare all to all parameters.
|
static class |
Compare.Chain
Represents a list of concatenated pipes, where each pipe is parent of the next within the ProjectTree.
|
Modifier and Type | Field and Description |
---|---|
static int |
AVG_PHYS_DIST |
static int |
COMBINED |
static int |
COMBINED_SCORE_INDICES |
static int |
CUM_PHYST_DIST |
static int |
DISSIMILARITY |
static int |
LEVENSHTEIN |
static int |
MEDIAN_PHYS_DIST |
static int |
PROXIMITY |
static int |
PROXIMITY_MUT |
static int |
STD_DEV |
static int |
STD_DEV_ALL |
static int |
TRANS_ROT |
static int |
TRANS_ROT_SCALE |
static int |
TRANS_ROT_SCALE_SHEAR |
static double[] |
W |
Modifier and Type | Method and Description |
---|---|
static Bureaucrat |
compareAllToAll(boolean to_file,
String regex,
String[] ignore,
Project[] projects) |
static Bureaucrat |
compareAllToAll(boolean to_file,
String regex,
String[] ignore,
Project[] projects,
boolean crop,
boolean from_end,
int max_n_elements,
String outgroup)
Gets pipes for all open projects, and generates a matrix of dissimilarities, which gets passed on to the Worker thread and also to a file, if desired.
|
static VectorString3D |
condense(Compare.CATAParameters cp,
VectorString3D[] vs,
Worker worker)
Do an all-to-all distance matrix of the given vs, then do a neighbor joining, do a weighted merge of the two VectorString3D being merged, and then finally output the resulting condensed unique VectorString3D with its source array full with all points that make each point in it.
|
static Vector3d[] |
createOrigin(VectorString3D x,
VectorString3D y,
VectorString3D z,
int transform_type)
Returns an array of 4 Vector3d: the three unit vectors in the same order as the vector strings, and the origin of coordinates.
|
static Vector3d[] |
createOrigin(VectorString3D x,
VectorString3D y,
VectorString3D z,
int transform_type,
Vector3d[] o_ref) |
static ArrayList<Compare.Chain> |
createPipeChains(ProjectThing root_pt,
LayerSet ls)
For a given pipe, create a VectorString3D for each possible path, as determined by the Project Tree structure and the parent/child relationships.
|
static ArrayList<Compare.Chain> |
createPipeChains(ProjectThing root_pt,
LayerSet ls,
String regex_exclude) |
static Transform3D |
createTransform(Vector3d[] o)
Creates a transform with the 4 given vectors: X, Y, Z and translation of origin.
|
static Map<String,Tuple3d> |
extractPoints(ProjectThing fiducial)
Extracts the list of fiduciary points from the fiducial parent and, if their name is different than "ball", adds their title as key and their first ball as a fiduciary point value of the returned map.
|
protected static Object[] |
findBestMatch(VectorString3D vs1,
VectorString3D vs2,
double delta,
boolean skip_ends,
int max_mut,
float min_chunk) |
protected static Object[] |
findBestMatch(VectorString3D vs1,
VectorString3D vs2,
double delta,
boolean skip_ends,
int max_mut,
float min_chunk,
int distance_type,
boolean direct,
boolean substring_matching)
Since comparing two sequences starting from one end or starting from the other
is not the same at all, this method performs the match starting first from one
end and then from the other.
|
static Object[] |
findBestMatch(VectorString3D vs1,
VectorString3D vs2,
double delta,
boolean skip_ends,
int max_mut,
float min_chunk,
int distance_type,
boolean direct,
boolean substring_matching,
double wi,
double wd,
double wm) |
static Object[] |
gatherChains(Project[] p,
Compare.CATAParameters cp) |
static Object[] |
gatherChains(Project[] p,
Compare.CATAParameters cp,
String[] ignore)
Gather chains for all projects considering the cp.regex, and transforms all relative to the reference Project p[0].
|
static double[] |
makeEnvelope(Compare.CATAParameters cp,
VectorString3D c)
From a condensed VectorString3D, create the radius at each point.
|
static Plot |
makePlot(Compare.CATAParameters cp,
String name,
VectorString3D c) |
static Object[] |
obtainOrigin(Line3D[] axes,
int transform_type,
Vector3d[] o_ref)
Generate calibrated origin of coordinates.
|
static Bureaucrat |
reliabilityAnalysis(String[] ignore)
Reliability analysis of pipe comparisons: compares all to all,
recording the score position of homonimous pipes in other projects.
|
static Bureaucrat |
reliabilityAnalysis(String[] ignore,
boolean output_arff,
boolean weka_classify,
boolean show_dialog,
double delta,
double wi,
double wd,
double wm) |
static Bureaucrat |
reliabilityAnalysisSpaceExploration(String[] ignore) |
static double |
score(double seq_sim,
double levenshtein,
double median_phys_dist,
double[] w) |
static float[][] |
scoreAllToAll(VectorString3D[] vs,
int distance_type,
double delta,
boolean skip_ends,
int max_mut,
float min_chunk,
boolean direct,
boolean substring_matching,
Worker worker)
Returns the half matrix of scores, with values copied from one half matrix to the other, and a diagonal of zeros.
|
static void |
testCreateOrigin(LayerSet ls,
VectorString3D vs1,
VectorString3D vs2,
VectorString3D vs3) |
static List<VectorString3D> |
transferVectorStrings(List<VectorString3D> vs,
List<Tuple3d> source,
List<Tuple3d> target,
Class<AffineModel3D> model_class)
Transform all points of all VectorString3D in vs using a Moving Least Squares Transform defined by the pairing of points in source to those in target.
|
static List<VectorString3D> |
transferVectorStrings(List<VectorString3D> vs,
Map<String,Tuple3d> source,
Map<String,Tuple3d> target)
Transfer vs via a moving least squares transform by matching source named points into equally named target named points.
|
static List<VectorString3D> |
transferVectorStrings(List<VectorString3D> vs,
ProjectThing source_fiduciary,
ProjectThing target_fiduciary) |
static Bureaucrat |
variabilityAnalysis(Project reference_project,
String regex,
String[] ignore,
boolean show_cata_dialog,
boolean generate_plots,
boolean show_plots,
String plot_dir_,
boolean show_3D,
boolean show_condensed_3D,
boolean show_sources_3D,
Map<Project,Color> sources_color_table,
boolean show_envelope_3D,
float envelope_alpha,
double delta_envelope,
int envelope_type,
boolean show_axes_3D,
boolean heat_map,
Map<String,VectorString3D> map_condensed,
Project[] projects) |
public static final int TRANS_ROT
public static final int TRANS_ROT_SCALE
public static final int TRANS_ROT_SCALE_SHEAR
public static final int LEVENSHTEIN
public static final int DISSIMILARITY
public static final int AVG_PHYS_DIST
public static final int MEDIAN_PHYS_DIST
public static final int CUM_PHYST_DIST
public static final int STD_DEV
public static final int COMBINED
public static final int PROXIMITY
public static final int PROXIMITY_MUT
public static final int STD_DEV_ALL
public static final int COMBINED_SCORE_INDICES
public static final double[] W
public static Object[] obtainOrigin(Line3D[] axes, int transform_type, Vector3d[] o_ref)
public static Vector3d[] createOrigin(VectorString3D x, VectorString3D y, VectorString3D z, int transform_type)
public static Vector3d[] createOrigin(VectorString3D x, VectorString3D y, VectorString3D z, int transform_type, Vector3d[] o_ref)
public static void testCreateOrigin(LayerSet ls, VectorString3D vs1, VectorString3D vs2, VectorString3D vs3)
public static ArrayList<Compare.Chain> createPipeChains(ProjectThing root_pt, LayerSet ls) throws Exception
Exception
public static ArrayList<Compare.Chain> createPipeChains(ProjectThing root_pt, LayerSet ls, String regex_exclude) throws Exception
Exception
protected static final Object[] findBestMatch(VectorString3D vs1, VectorString3D vs2, double delta, boolean skip_ends, int max_mut, float min_chunk)
protected static final Object[] findBestMatch(VectorString3D vs1, VectorString3D vs2, double delta, boolean skip_ends, int max_mut, float min_chunk, int distance_type, boolean direct, boolean substring_matching)
direct
- Whether to test vs1 against vs2 only, or to try all 4 possible combinations of reversed versus non-reversed and pick the best.
Uses 1.1 weights for costs of insertion and deletion, as proven better by the parameter exploration.
Uses weight of 1 for cost of mutation.public static final Object[] findBestMatch(VectorString3D vs1, VectorString3D vs2, double delta, boolean skip_ends, int max_mut, float min_chunk, int distance_type, boolean direct, boolean substring_matching, double wi, double wd, double wm)
public static final double score(double seq_sim, double levenshtein, double median_phys_dist, double[] w)
public static final Object[] gatherChains(Project[] p, Compare.CATAParameters cp) throws Exception
Exception
public static final Object[] gatherChains(Project[] p, Compare.CATAParameters cp, String[] ignore) throws Exception
Exception
public static Bureaucrat compareAllToAll(boolean to_file, String regex, String[] ignore, Project[] projects)
public static Bureaucrat compareAllToAll(boolean to_file, String regex, String[] ignore, Project[] projects, boolean crop, boolean from_end, int max_n_elements, String outgroup)
to_file
- Whether to save the results to a file and popup a save dialog for it or not. In any case the results are stored in the worker's load, which you can retrieve like:
Bureaucrat bu = Compare.compareAllToAll(true, null, null); Object result = bu.getWorker().getResult(); float[][] scores = (float[][])result[0]; ArrayList<Compare.Chain> chains = (ArrayList<Compare.Chain>)result[1];
public static float[][] scoreAllToAll(VectorString3D[] vs, int distance_type, double delta, boolean skip_ends, int max_mut, float min_chunk, boolean direct, boolean substring_matching, Worker worker)
distance_type
- ranges from 0 to 5, and includes: 0=Levenshtein, 1=Dissimilarity, 2=Average physical distance, 3=Median physical distance, 4=Cummulative physical distance and 5=Standard deviation.public static Transform3D createTransform(Vector3d[] o)
public static Bureaucrat variabilityAnalysis(Project reference_project, String regex, String[] ignore, boolean show_cata_dialog, boolean generate_plots, boolean show_plots, String plot_dir_, boolean show_3D, boolean show_condensed_3D, boolean show_sources_3D, Map<Project,Color> sources_color_table, boolean show_envelope_3D, float envelope_alpha, double delta_envelope, int envelope_type, boolean show_axes_3D, boolean heat_map, Map<String,VectorString3D> map_condensed, Project[] projects)
reference_project
- If null, then the first one found in the Project.getProjects() lists is used.regex
- A String (can be null) to filter objects by, to limit what gets processed.
If regex is not null, then only ProjectThing nodes with the matching regex are analyzed (shallow: none of their children are questioned, but pipes will be built from them all).generate_plots
- Whether to generate the variability plots at all.show_plots
- If generate_plots, whether to show the plots in a stack image window or to save them.show_3D
- Whether to show any 3D data.show_condensed_3D
- If show_3D, whether to show the condensed vector strings, i.e. the "average" pipes.show_sources_3D
- If show_3D, whether to show the source pipes from which the condensed vector string was generated.sources_color_table
- Which colors to give to the pipes of which Project.show_envelope_3D
- If show_3D, whether to generate the variability envelope.envelope_alpha
- If show_envelope_3D, the envelope takes an alpha value between 0 (total transparency) and 1 (total opacity)delta_envelope
- The delta to resample the envelope to. When smaller than or equal to 1, no envelope resampling occurs.show_axes_3D
- If show_3D, whether to display the reference axes as well.heat_map
- If show_3D, whether to color the variability with a Fire LUT.
If not show_condensed_3D, then the variability is shown in color-coded 3D spheres placed at the entry point to the neuropile.map_condensed
- If not null, all VectorString3D are put into this map.projects
- The projects to use.public static Plot makePlot(Compare.CATAParameters cp, String name, VectorString3D c)
public static double[] makeEnvelope(Compare.CATAParameters cp, VectorString3D c)
public static VectorString3D condense(Compare.CATAParameters cp, VectorString3D[] vs, Worker worker) throws Exception
Exception
public static List<VectorString3D> transferVectorStrings(List<VectorString3D> vs, List<Tuple3d> source, List<Tuple3d> target, Class<AffineModel3D> model_class) throws Exception
Exception
public static List<VectorString3D> transferVectorStrings(List<VectorString3D> vs, Map<String,Tuple3d> source, Map<String,Tuple3d> target) throws Exception
Exception
public static List<VectorString3D> transferVectorStrings(List<VectorString3D> vs, ProjectThing source_fiduciary, ProjectThing target_fiduciary) throws Exception
Exception
public static Map<String,Tuple3d> extractPoints(ProjectThing fiducial)
public static final Bureaucrat reliabilityAnalysis(String[] ignore)
public static final Bureaucrat reliabilityAnalysis(String[] ignore, boolean output_arff, boolean weka_classify, boolean show_dialog, double delta, double wi, double wd, double wm)
public static final Bureaucrat reliabilityAnalysisSpaceExploration(String[] ignore)
Copyright © 2015–2021 Fiji. All rights reserved.