public void transformDomainToTemplateWorld( double x, double y, double z, Point3d result ) { if( ! isTransformationValid() ) throw new RuntimeException( "Trying to use Bookstein_From_Landmarks.transformWorld() with an invalid transformation." ); p.x = x; p.y = y; p.z = z; domainToTemplate.apply( p ); result.x = domainToTemplate.x; result.y = domainToTemplate.y; result.z = domainToTemplate.z; }
public ImagePlus register( NamedPointSet points0, NamedPointSet points1 ) { generateTransformation( points0, points1 ); for( int x = 0; x < templateWidth; ++x ) { transformTemplateToDomain( x, y, z, result );
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 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 ); }
domainDepth = domain.getStackSize(); validateTransformation();
break; case BOOKSTEIN: r = new BooksteinFromLandmarks(); break; default:
public void transformTemplateToDomainWorld( double x, double y, double z, Point3d result ) { if( ! isTransformationValid() ) throw new RuntimeException( "Trying to use Bookstein_From_Landmarks.transformWorld() with an invalid transformation." ); p.x = x; p.y = y; p.z = z; templateToDomain.apply( p ); result.x = templateToDomain.x; result.y = templateToDomain.y; result.z = templateToDomain.z; }
public void transformTemplateToDomain( int x, int y, int z, RegistrationAlgorithm.ImagePoint result ) { if( ! isTransformationValid() ) throw new RuntimeException( "Trying to use Bookstein_From_Landmarks.transform() with an invalid transformation." ); p.x = x * xSpacingTemplate; p.y = y * ySpacingTemplate; p.z = z * zSpacingTemplate; templateToDomain.apply( p ); double dxd = templateToDomain.x / xSpacingDomain; double dyd = templateToDomain.y / ySpacingDomain; double dzd = templateToDomain.z / zSpacingDomain; result.x = (int)Math.round( dxd ); result.y = (int)Math.round( dyd ); result.z = (int)Math.round( dzd ); }
public void transformDomainToTemplate( int x, int y, int z, RegistrationAlgorithm.ImagePoint result ) { if( ! isTransformationValid() ) throw new RuntimeException( "Trying to use Bookstein_From_Landmarks.transform() with an invalid transformation." ); p.x = x * xSpacingDomain; p.y = y * ySpacingDomain; p.z = z * zSpacingDomain; domainToTemplate.apply( p ); double dxd = domainToTemplate.x / xSpacingTemplate; double dyd = domainToTemplate.y / ySpacingTemplate; double dzd = domainToTemplate.z / zSpacingTemplate; result.x = (int)Math.round( dxd ); result.y = (int)Math.round( dyd ); result.z = (int)Math.round( dzd ); }