public class LandmarkTableModel extends AbstractTableModel implements TransformListener<InvertibleRealTransform>
listenerList
Constructor and Description |
---|
LandmarkTableModel(int ndims) |
Modifier and Type | Method and Description |
---|---|
void |
activateRow(int index) |
boolean |
add(double[] pt,
boolean isMoving) |
boolean |
add(double[] pt,
boolean isMoving,
RealTransform xfm) |
void |
clear() |
void |
clearPt(int row,
boolean isMoving) |
void |
computeWarpedPoint(int i,
InvertibleRealTransform xfm)
Given an row in this table, updates the warped point position if
necessary.
|
static double[] |
copy(double[] in) |
void |
copyLandmarks(double[][] movingLandmarks,
double[][] targetLandmarks) |
void |
copyLandmarks(int tableIndex,
double[][] movingLandmarks,
double[][] targetLandmarks) |
void |
deleteRow(int i) |
void |
deleteRowHelper(int i) |
protected void |
exportTransformation(File ffwd,
File finv) |
protected void |
firePointUpdated(int row,
boolean isMoving) |
int |
getActiveIndex(int tableIndex) |
int |
getActiveRowCount() |
ArrayList<Boolean> |
getChangedSinceWarp() |
Class<?> |
getColumnClass(int col) |
int |
getColumnCount() |
String |
getColumnName(int col) |
Double[] |
getFixedPoint(int index) |
int |
getIndexNearestTo(double[] pt,
boolean isMoving) |
int |
getIndexNearestTo(RealLocalizable pt,
boolean isMoving) |
boolean |
getIsActive(int row) |
Double[] |
getMovingPoint(int index) |
ArrayList<String> |
getNames() |
int |
getNextRow(boolean isMoving)
Returns the next row to be updated for the moving or target columns.
|
int |
getNumdims() |
double[] |
getPendingPoint() |
Double[] |
getPoint(boolean isMoving,
int index) |
ArrayList<Double[]> |
getPoints(boolean moving) |
int |
getRowCount() |
ThinPlateR2LogRSplineKernelTransform |
getTransform() |
LandmarkUndoManager |
getUndoManager() |
Object |
getValueAt(int rowIndex,
int columnIndex) |
ArrayList<Double[]> |
getWarpedPoints() |
protected void |
importTransformation(File ffwd,
File finv) |
void |
initTransformation() |
LandmarkTableModel |
invert()
Returns a new LandmarkTableModel but makes the moving points fixed and vice versa.
|
boolean |
isActive(int i) |
boolean |
isCellEditable(int row,
int col)
Only allow editing of the first ("Name") and
second ("Active") column
|
boolean |
isFixedPoint(int index) |
boolean |
isFixedPoint(int index,
boolean isMoving) |
boolean |
isModifiedSinceSave() |
boolean |
isMovingPoint(int index) |
boolean |
isPointUpdatePending() |
boolean |
isPointUpdatePendingMoving() |
boolean |
isRowUnpaired(int i)
Returns true if the ith row is unpaired - i.e.,
if either of the moving or target points are unset.
|
boolean |
isUpdatePending()
Returns true if any row is unpaired.
|
Boolean |
isWarped(int i) |
void |
load(File f) |
void |
load(File f,
boolean invert)
Loads this table from a file
|
int |
numActive() |
boolean |
pointEdit(int index,
double[] pt,
boolean forceAdd,
boolean isMoving,
boolean isWarped,
boolean isUndoable,
RealTransform xfm) |
boolean |
pointEdit(int index,
double[] pt,
boolean forceAdd,
boolean isMoving,
double[] warpedPt,
boolean isUndoable)
Changes a point's position, or adds a new point.
|
static String |
print(Double[] d) |
void |
printDistances() |
void |
printState() |
void |
printWarpedPoints() |
void |
resetLastPoint() |
void |
resetNeedsInverse() |
void |
resetUpdated() |
void |
resetWarpedPoint(int i) |
void |
resetWarpedPoints() |
void |
restorePendingUpdate() |
boolean |
rowNeedsWarning(int row) |
void |
save(File f)
Saves the table to a file
|
void |
setColumnName(int row,
String name) |
void |
setInverseThreshold(double inverseThreshold) |
void |
setIsActive(int row,
boolean isActive) |
void |
setLastPoint(int i,
boolean isMoving) |
void |
setMaxInverseIterations(int maxIters) |
void |
setMessage(BigWarpMessageAnimator message) |
void |
setNeedsInverse(int i) |
void |
setNextRow(boolean isMoving,
int row) |
void |
setPoint(int row,
boolean isMoving,
double[] pt,
boolean isUndoable,
RealTransform xfm) |
void |
setPoint(int row,
boolean isMoving,
double[] pt,
RealTransform xfm) |
void |
setTableListener() |
void |
setValueAt(Object value,
int row,
int col) |
double |
squaredDistance(Double[] p,
double[] q) |
double |
squaredDistance(Double[] p,
RealLocalizable q) |
static double[] |
toPrimitive(Double[] in) |
String |
toString() |
void |
transferUpdatesToModel() |
void |
transformChanged(InvertibleRealTransform transform) |
void |
updateAllWarpedPoints(InvertibleRealTransform xfm)
Looks through the table for points where there is a point in moving space but not fixed space.
|
void |
updateNextRows(int lastAddedIndex) |
void |
updateWarpedPoint(int i,
double[] pt) |
boolean |
validateTransformPoints() |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public static final int NAMECOLUMN
public static final int ACTIVECOLUMN
public static Color WARNINGBGCOLOR
public static Color DEFAULTBGCOLOR
protected int ndims
protected int numCols
protected int numRows
protected int nextRowP
protected int nextRowQ
protected int numActive
protected boolean pointUpdatePending
protected boolean pointUpdatePendingMoving
protected Double[] pointToOverride
protected boolean elementDeleted
protected ThinPlateR2LogRSplineKernelTransform estimatedXfm
protected int maxInverseIterations
protected double inverseThreshold
protected double[] lastPoint
protected double[] tmp
protected LandmarkUndoManager undoRedoManager
protected BigWarpMessageAnimator message
protected boolean modifiedSinceLastSave
public final org.apache.log4j.Logger logger
public void setMessage(BigWarpMessageAnimator message)
public int getNumdims()
public double[] getPendingPoint()
public ThinPlateR2LogRSplineKernelTransform getTransform()
public void printDistances()
public void printState()
public boolean validateTransformPoints()
public void setTableListener()
public boolean isModifiedSinceSave()
protected void importTransformation(File ffwd, File finv) throws IOException
IOException
protected void exportTransformation(File ffwd, File finv) throws IOException
IOException
public boolean isPointUpdatePending()
public boolean isPointUpdatePendingMoving()
public void restorePendingUpdate()
public int getColumnCount()
getColumnCount
in interface TableModel
public int getRowCount()
getRowCount
in interface TableModel
public int getActiveRowCount()
public String getColumnName(int col)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public void setColumnName(int row, String name)
public boolean getIsActive(int row)
public void setIsActive(int row, boolean isActive)
public int getActiveIndex(int tableIndex)
public Class<?> getColumnClass(int col)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public boolean isActive(int i)
public void clear()
public void deleteRow(int i)
public void deleteRowHelper(int i)
public boolean isRowUnpaired(int i)
i
- row indexpublic boolean isUpdatePending()
public void setNextRow(boolean isMoving, int row)
public void updateNextRows(int lastAddedIndex)
public int getNextRow(boolean isMoving)
isMoving
- isMovingpublic Boolean isWarped(int i)
public void updateWarpedPoint(int i, double[] pt)
public void printWarpedPoints()
public void resetWarpedPoint(int i)
public void resetWarpedPoints()
public void resetNeedsInverse()
public void setNeedsInverse(int i)
public boolean rowNeedsWarning(int row)
protected void firePointUpdated(int row, boolean isMoving)
public void clearPt(int row, boolean isMoving)
public boolean add(double[] pt, boolean isMoving)
public boolean add(double[] pt, boolean isMoving, RealTransform xfm)
public void setPoint(int row, boolean isMoving, double[] pt, RealTransform xfm)
public void setPoint(int row, boolean isMoving, double[] pt, boolean isUndoable, RealTransform xfm)
public boolean pointEdit(int index, double[] pt, boolean forceAdd, boolean isMoving, boolean isWarped, boolean isUndoable, RealTransform xfm)
public boolean pointEdit(int index, double[] pt, boolean forceAdd, boolean isMoving, double[] warpedPt, boolean isUndoable)
index
- The index into this table that this edit will affect ( a value of -1 will add a new point )pt
- the point positionforceAdd
- force addition of a new point at the specified indexisMoving
- is this point in the moving image spacewarpedPt
- position of the warped pointisUndoable
- is this action undo-ablepublic void setLastPoint(int i, boolean isMoving)
public void resetLastPoint()
public void updateAllWarpedPoints(InvertibleRealTransform xfm)
xfm
- the new transformationpublic void computeWarpedPoint(int i, InvertibleRealTransform xfm)
An action is taken if, for the input row if:
If these conditions are satisfied, the position of the moving point in target space by iteratively estimating the inverse of the thin plate spline transformation.
i
- the row in the tablexfm
- the invertible transformationpublic void setMaxInverseIterations(int maxIters)
public void setInverseThreshold(double inverseThreshold)
public int getIndexNearestTo(double[] pt, boolean isMoving)
public double squaredDistance(Double[] p, double[] q)
public int getIndexNearestTo(RealLocalizable pt, boolean isMoving)
public double squaredDistance(Double[] p, RealLocalizable q)
public Double[] getPoint(boolean isMoving, int index)
public Double[] getMovingPoint(int index)
public Double[] getFixedPoint(int index)
public boolean isMovingPoint(int index)
public boolean isFixedPoint(int index)
public boolean isFixedPoint(int index, boolean isMoving)
public void activateRow(int index)
public void resetUpdated()
public void transferUpdatesToModel()
public void load(File f) throws IOException
IOException
public void load(File f, boolean invert) throws IOException
f
- the fileinvert
- invert the moving and target point setsIOException
- an exceptionpublic int numActive()
public void copyLandmarks(int tableIndex, double[][] movingLandmarks, double[][] targetLandmarks)
public void copyLandmarks(double[][] movingLandmarks, double[][] targetLandmarks)
public void initTransformation()
public void save(File f) throws IOException
f
- the fileIOException
- an exceptionpublic void setValueAt(Object value, int row, int col)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
public boolean isCellEditable(int row, int col)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public LandmarkTableModel invert()
public LandmarkUndoManager getUndoManager()
public static double[] copy(double[] in)
public static double[] toPrimitive(Double[] in)
public void transformChanged(InvertibleRealTransform transform)
transformChanged
in interface TransformListener<InvertibleRealTransform>
Copyright © 2015–2021 Fiji. All rights reserved.