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:
ActionListener,WindowListener,Runnable,EventListener
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 ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) class(package private) classNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescription(package private) String(package private) Vector<LSCM.Vertex> (package private) LSCM.Mesh(package private) StringFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublec_a(LSCM.HalfEdge c) c_s(LSCM.HalfEdge c) doubleintbooleandoublebooleanvoidproject()voidActually runs the algorithm.voidvoidsetc_s(LSCM.HalfEdge c, LSCM.Point p) voidvoidvoidsete_sharp(LSCM.Edge e, boolean b) voidsetf_touched(LSCM.Face f, boolean b) voidsetv_father(LSCM.Vertex v, LSCM.Vertex father) voidsetv_idx(LSCM.Vertex v, int i) voidsetv_touched(LSCM.Vertex v, boolean touched) voidsetv_uv(LSCM.Vertex v, LSCM.Point2 p2) voidsetv_valence(LSCM.Vertex v, int i) intv_idx(LSCM.Vertex v) booleanv_uv(LSCM.Vertex v) intMethods 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
m_mesh
LSCM.Mesh m_mesh -
inputFileName
String inputFileName -
outputFileName
String outputFileName -
m_fix_vertices
Vector<LSCM.Vertex> m_fix_vertices
-
-
Constructor Details
-
LSCM
-
-
Method Details
-
set_coefficients
public void set_coefficients() -
project
public void project() -
v_touched
-
setv_touched
-
v_father
-
setv_father
-
v_idx
-
setv_idx
-
v_valence
-
setv_valence
-
e_mark
-
sete_mark
-
e_l
-
sete_l
-
e_w
-
e_sharp
-
sete_sharp
-
e_string
-
c_next
-
c_prev
-
c_a
-
c_s
-
setc_s
-
v_uv
-
setv_uv
-
f_touched
-
setf_touched
-
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-