Package gov.nih.mipav.model.algorithms
Class LSCM
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.LSCM
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class LSCM extends AlgorithmBase
Port of LSCM, Least squares conformal mapping This package includes the prototype code for implementing least squares conformal maps. LSCM requires at least two fixed vertices. Search in human.obj for "fix" and you will find two such fixed vertices having an additional trait "fix u v" after the xyz coordinates. In human.obj, these two vertices are somewhere at the two eyes. These two vertices will be mapped to (u,v). You can specify your own fixed vertices in the same way. ## References Gu, Xianfeng David. Computational conformal geometry. Edited by Shing-Tung Yau. Somerville, Mass, USA: International Press, 2008. Lévy, Bruno, Sylvain Petitjean, Nicolas Ray, and Jérome Maillot. "Least squares conformal maps for automatic texture atlas generation." In ACM transactions on graphics (TOG), vol. 21, no. 3, pp. 362-371. ACM, 2002. // Author : Mi, Liang // Email : icemiliang@gmail.com // Date : July 31st 2020 // License : MIT Copyright (C) 2018 Liang Mi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
LSCM.Boundary
(package private) class
LSCM.Edge
(package private) class
LSCM.EdgeKey
(package private) class
LSCM.EdgeTrait
(package private) class
LSCM.Face
(package private) class
LSCM.FaceEdgeIterator
(package private) class
LSCM.FaceHalfedgeIterator
(package private) class
LSCM.FaceTrait
(package private) class
LSCM.FaceVertexIterator
(package private) class
LSCM.FormTrait
(package private) class
LSCM.Graph
(package private) class
LSCM.HalfEdge
(package private) class
LSCM.HalfEdgeTrait
(package private) class
LSCM.Homology
(package private) class
LSCM.Loop
(package private) class
LSCM.Mesh
(package private) class
LSCM.MeshEdgeIterator
(package private) class
LSCM.MeshFaceIterator
(package private) class
LSCM.MeshHalfEdgeIterator
(package private) class
LSCM.MeshVertexIterator
(package private) class
LSCM.Parser
(package private) class
LSCM.Point
(package private) class
LSCM.Point2
(package private) class
LSCM.Token
(package private) class
LSCM.Trait
(package private) class
LSCM.Triplet
(package private) class
LSCM.Vertex
(package private) class
LSCM.VertexEdgeIterator
(package private) class
LSCM.VertexFaceIterator
(package private) class
LSCM.VertexInHalfedgeIterator
(package private) class
LSCM.VertexOutHalfedgeIterator
(package private) class
LSCM.VertexTrait
(package private) class
LSCM.VertexVertexIterator
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
inputFileName
(package private) java.util.Vector<LSCM.Vertex>
m_fix_vertices
(package private) LSCM.Mesh
m_mesh
(package private) java.lang.String
outputFileName
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description LSCM(java.lang.String inputFileName, java.lang.String outputFileName)
-
Method Summary
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
m_mesh
LSCM.Mesh m_mesh
-
inputFileName
java.lang.String inputFileName
-
outputFileName
java.lang.String outputFileName
-
m_fix_vertices
java.util.Vector<LSCM.Vertex> m_fix_vertices
-
-
Method Detail
-
set_coefficients
public void set_coefficients()
-
project
public void project()
-
v_touched
public boolean v_touched(LSCM.Vertex v)
-
setv_touched
public void setv_touched(LSCM.Vertex v, boolean touched)
-
v_father
public LSCM.Vertex v_father(LSCM.Vertex v)
-
setv_father
public void setv_father(LSCM.Vertex v, LSCM.Vertex father)
-
v_idx
public int v_idx(LSCM.Vertex v)
-
setv_idx
public void setv_idx(LSCM.Vertex v, int i)
-
v_valence
public int v_valence(LSCM.Vertex v)
-
setv_valence
public void setv_valence(LSCM.Vertex v, int i)
-
e_mark
public int e_mark(LSCM.Edge e)
-
sete_mark
public void sete_mark(LSCM.Edge e, int i)
-
e_l
public double e_l(LSCM.Edge e)
-
sete_l
public void sete_l(LSCM.Edge e, double value)
-
e_w
public double e_w(LSCM.Edge e)
-
e_sharp
public boolean e_sharp(LSCM.Edge e)
-
sete_sharp
public void sete_sharp(LSCM.Edge e, boolean b)
-
e_string
public java.lang.String e_string(LSCM.Edge e)
-
c_next
public LSCM.HalfEdge c_next(LSCM.HalfEdge c)
-
c_prev
public LSCM.HalfEdge c_prev(LSCM.HalfEdge c)
-
c_a
public double c_a(LSCM.HalfEdge c)
-
c_s
public LSCM.Point c_s(LSCM.HalfEdge c)
-
setc_s
public void setc_s(LSCM.HalfEdge c, LSCM.Point p)
-
v_uv
public LSCM.Point2 v_uv(LSCM.Vertex v)
-
setv_uv
public void setv_uv(LSCM.Vertex v, LSCM.Point2 p2)
-
f_touched
public boolean f_touched(LSCM.Face f)
-
setf_touched
public void setf_touched(LSCM.Face f, boolean b)
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
-