Skip to content

Commit

Permalink
Merge pull request qupath#101 from petebankhead/win-paths
Browse files Browse the repository at this point in the history
Fix paths on Windows
  • Loading branch information
petebankhead authored Oct 16, 2024
2 parents 03ca62c + 96552c9 commit d579e43
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/qupath/ext/instanseg/ui/InstanSegTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import qupath.ext.instanseg.core.InstanSegModel;
import qupath.ext.instanseg.core.InstanSegResults;
import qupath.fx.dialogs.Dialogs;
import qupath.lib.common.GeneralTools;
import qupath.lib.gui.QuPathGUI;
import qupath.lib.gui.TaskRunnerFX;
import qupath.lib.images.ImageData;
import qupath.lib.plugins.workflow.DefaultScriptableWorkflowStep;

import java.awt.image.BufferedImage;
import java.io.File;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -99,7 +101,7 @@ protected Void call() {
.build()
.detectObjects()
""",
path.get(),
modelPathToString(path.get()),
device,
InputChannelItem.toConstructorString(channels),
outputChannels.length == 0 ? "" : Arrays.stream(outputChannels)
Expand Down Expand Up @@ -127,4 +129,11 @@ protected Void call() {
return null;
}

private static String modelPathToString(Path path) {
if (GeneralTools.isWindows())
return path.toString().replaceAll("\\\\", "/");
else
return path.toString();
}

}

0 comments on commit d579e43

Please sign in to comment.