public double evaluate( double[] argument ) { RegistrationResult r = NamePoints.mapImageWith( croppedTemplate, newImage, templatePoint, guessedPoint, argument, cubeSide, similarityMeasure, ""); if( listener != null ) listener.fineTuneNewBestResult( r ); return r.score; }
public NamedPointSet transformPointsWith( OrderedTransformations o ) { NamedPointSet result = new NamedPointSet(); Iterator i0; for( i0 = pointsWorld.listIterator(); i0.hasNext(); ) { NamedPointWorld p = (NamedPointWorld)i0.next(); NamedPointWorld transformed = p.transformWith(o); result.add( transformed ); } return result; }
void delete(int i) { String name = points.get(i).getName(); YesNoCancelDialog d = new YesNoCancelDialog( IJ.getInstance(), "Really delete?", "Do you really want to delete the point \""+name+"\"?" ); if( d.yesPressed() ) { points.delete(i); dialog.recreatePointsPanel(); dialog.pack(); } }
void addNewPoint() { NamedPointWorld npw = points.addNewPoint(); dialog.recreatePointsPanel(); dialog.pack(); }
boolean fineTune( NamedPointWorld p ) { int index = points.getIndexOfPoint( p.getName() ); return fineTune( p, index ); }
synchronized public NamedPointWorld addNewPoint( ) { int i = pointsWorld.size(); boolean nameTaken = true; String newName = null; while( nameTaken ) { newName = "Named Point (" + i + ")"; nameTaken = get( newName ) != null; ++ i; } NamedPointWorld toAdd = new NamedPointWorld( newName ); pointsWorld.add( toAdd ); return toAdd; }
public static NamedPointSet forImage( ImagePlus imagePlus ) throws PointsFileException { FileInfo info = imagePlus.getOriginalFileInfo(); if( info == null ) throw new PointsFileException( "Could not find original file for the image: " + imagePlus.getTitle() ); String fileName = info.fileName; String url = info.url; String directory = info.directory; File f = new File( directory, fileName ); return NamedPointSet.forImage( imagePlus, f.getAbsolutePath() ); }
public static NamedPointSet forImage( String imageFilename ) throws PointsFileException { return forImage( null, imageFilename ); }
public static NamedPointSet fromFile( String pointsFilename, ImagePlus imagePlus, String imageFilename ) throws PointsFileException { File f = new File( pointsFilename ); if( ! f.exists() ) { throw new PointsFileException( "File not found: " + pointsFilename ); } return fromFile( f, imagePlus, imageFilename ); }
public String toIGS() { return "landmark {\n\tname \""+escape(name)+"\"\n\tlocation "+ x+" "+y+" "+z+"\n}"; } }
public void useFineTuneResult( ) { useFineTuneResult( bestSoFar ); }
public static NamedPointSet fromFile( File f ) throws PointsFileException { return fromFile( f, null, null ); }
public static NamedPointSet fromString( String s ) { return fromString( s ); }
public ArrayList<String> namesSharedWith( NamedPointSet other ) { return namesSharedWith( other, false ); }
public void fineTuneNewBestResult( RegistrationResult result ) { if( progressWindow != null ) progressWindow.offerNewResult( result ); }