-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
144 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/org/embl/mobie/lib/table/DistanceComputer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.embl.mobie.lib.table; | ||
|
||
import ij.gui.GenericDialog; | ||
import org.embl.mobie.lib.annotation.Annotation; | ||
import org.embl.mobie.lib.select.SelectionModel; | ||
|
||
import java.util.Set; | ||
|
||
public class DistanceComputer | ||
{ | ||
public static < A extends Annotation > void showUI( AnnotationTableModel< A > tableModel, SelectionModel< A > selectionModel ) | ||
{ | ||
// show dialog | ||
// | ||
final GenericDialog gd = new GenericDialog( "" ); | ||
gd.addStringField( "Distance Columns RegEx", ".*" ); | ||
gd.addStringField( "Results Column Name", "distance" ); | ||
gd.showDialog(); | ||
if( gd.wasCanceled() ) return; | ||
final String columnsRegEx = gd.getNextChoice(); | ||
final String resultColumnName = gd.getNextString(); | ||
|
||
// TODO | ||
// tableModel.addNumericColumn( resultColumnName ); | ||
// | ||
// selectedColumns = tableModel.columnNames().stream() // TODO: select columns that match columnsRegEx | ||
// | ||
// // for all selected selectedColumns compute the average or median value | ||
// // of all selectedAnnotations | ||
// Set< A > selectedAnnotations = selectionModel.getSelected(); | ||
// for ( A annotation : selectedAnnotations ) | ||
// { | ||
// annotation.getNumber( column ) // TODO | ||
// } | ||
// | ||
// // for all annotations compute the Euclidean distance | ||
// // to the above computed average of the selected annotations | ||
// | ||
// tableModel.annotations() | ||
// tableModel.annotation( index ).setString( ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters