public static NamedPointSet forImage( String imageFilename ) throws PointsFileException { return forImage( null, imageFilename ); }
public ImagePlus register() { NamedPointSet points0 = null; NamedPointSet points1 = null; try { points0 = NamedPointSet.forImage(sourceImages[0]); } catch( NamedPointSet.PointsFileException e ) { throw new RuntimeException( "No corresponding .points file found "+ "for image: \""+sourceImages[0].getTitle()+"\"" ); } try { points1 = NamedPointSet.forImage(sourceImages[1]); } catch( NamedPointSet.PointsFileException e ) { throw new RuntimeException( "No corresponding .points file found "+ "for image: \""+sourceImages[1].getTitle()+"\"" ); } return register( points0, points1 ); }
public void generateTransformation( ) { NamedPointSet points0 = null; NamedPointSet points1 = null; try { points0 = NamedPointSet.forImage(sourceImages[0]); } catch( NamedPointSet.PointsFileException e ) { throw new RuntimeException( "No corresponding .points file found "+ "for image: \""+sourceImages[0].getTitle()+"\"" ); } try { points1 = NamedPointSet.forImage(sourceImages[1]); } catch( NamedPointSet.PointsFileException e ) { throw new RuntimeException( "No corresponding .points file found "+ "for image: \""+sourceImages[1].getTitle()+"\"" ); } generateTransformation( points0, points1 ); }
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 boolean useTemplate( String possibleTemplateImageFilename ) { if( possibleTemplateImageFilename == null ) { // Then unset the template: templateImageFilename = null; templateImage = null; templatePoints = null; return true; } File possibleTemplateImageFile = new File( possibleTemplateImageFilename ); if( ! possibleTemplateImageFile.exists() ) { IJ.error( "The file " + possibleTemplateImageFilename + " doesn't exist."); return false; } templateImageFilename = possibleTemplateImageFilename; templateImage = null; NamedPointSet newTemplatePointSet = null; try { newTemplatePointSet = NamedPointSet.forImage(templateImageFilename); } catch( NamedPointSet.PointsFileException e ) { IJ.error( "Warning: Couldn't load a points file corresponding to this template: " + e ); return true; } templatePoints = newTemplatePointSet; return true; }
public ImagePlus register() { NamedPointSet points0 = null; NamedPointSet points1 = null; try { points0 = NamedPointSet.forImage(sourceImages[0]); } catch( NamedPointSet.PointsFileException e ) { IJ.error("No corresponding .points file found "+ "for image: \""+sourceImages[0].getTitle()+"\""); System.out.println("for 0 in Rigid_From_Landmarks.register()"); return null; } try { points1 = NamedPointSet.forImage(sourceImages[1]); } catch( NamedPointSet.PointsFileException e ) { IJ.error("No corresponding .points file found "+ "for image: \""+sourceImages[1].getTitle()+"\""); System.out.println("for 1 in Rigid_From_Landmarks.register()"); return null; } return register( points0, points1 ); }
public ImagePlus register() { NamedPointSet points0 = null; NamedPointSet points1 = null; try { points0 = NamedPointSet.forImage( sourceImages[0] ); } catch( NamedPointSet.PointsFileException e ) { IJ.error( "Failed to find a corresponding points file for: "+sourceImages[0].getTitle() ); } try { points1 = NamedPointSet.forImage( sourceImages[1] ); } catch( NamedPointSet.PointsFileException e ) { IJ.error( "Failed to find a corresponding points file for: "+sourceImages[1].getTitle() ); } return register( points0, points1 ); }
newNamedPoints = NamedPointSet.forImage(imp); } catch( NamedPointSet.PointsFileException e ) { return false;
points = NamedPointSet.forImage(imp); } catch( NamedPointSet.PointsFileException e ) { IJ.error("Couldn't load points file for image '"+imp.getTitle()+"': " + e ) ;
if( templateImageFile != null && templateImageFile.exists() ) { try { templatePoints = NamedPointSet.forImage( templateImageFilename ); } catch( NamedPointSet.PointsFileException e ) { IJ.error("Couldn't load points file for template image. The error was: " + e );