Opener op = new Opener(); ImagePlus imp = op.openImage("/MyImagePath/MyImage.tif"); int numberOfPaths = 10; int corridorSize = 1; int accumulatedDiversity = 20; Point2D.Double[] endPoints = new Point2D.Double[] { new Point2D.Double(firstEndPointX, firstEndPointY), new Point2D.Double(secondEndPointX, secondEndPointY) }; DiversePathsSDK dp = new DiversePathsSDK(DiversePathsSDK.VITERBI, Builder.wrap(imp), numberOfPaths, corridorSize, accumulatedDiversity, endPoints); double[] costs=dp.getCosts(); PolygonRoi[] paths=dp.getPaths();