Skip to content

Commit

Permalink
updated path manipulation, ijm
Browse files Browse the repository at this point in the history
Updated with composing of new file names based on the python ex.

Also removed use of File.separator as getDirectory already returns a
trailing separator (at least on mac).
  • Loading branch information
k-dominik committed May 28, 2024
1 parent b3179f1 commit a405c3b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion _includes/string_concat/manipulating_file_paths.ijm
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
// manipulating file paths
tmpFolder = getDirectory("temp");
print(tmpFolder);
fileName = "nuclei.tif";
path = tmpFolder + File.separator + fileName;
path = tmpFolder + fileName;
print(path);

// Let's create a file name for a label image derived from the nuclei.tif
// such the file name will be nuclei_labels.tif.
filenameWithoutExtension = File.getNameWithoutExtension(path);
print(filenameWithoutExtension)
labelsPath = tmpFolder + filenameWithoutExtension + "_labels.tif";
print(labelsPath);

// Now we want to create a file name for a .csv file, that shares the
// file name up to the extension.
csvPath = tmpFolder + filenameWithoutExtension + ".csv";
print(csvPath);

0 comments on commit a405c3b

Please sign in to comment.