Skip to content

Commit

Permalink
Improve string concat, fixes #682
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed May 16, 2024
1 parent dab0f76 commit d30da85
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 47 deletions.
15 changes: 0 additions & 15 deletions _includes/string_concat/activities/string_concat.md

This file was deleted.

19 changes: 0 additions & 19 deletions _includes/string_concat/activities/string_concat_imagejmacro.ijm

This file was deleted.

13 changes: 0 additions & 13 deletions _includes/string_concat/activities/string_concat_python.py

This file was deleted.

4 changes: 4 additions & 0 deletions _includes/string_concat/creating_log_messages.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// create a log message
imageIndex = 11;
numImages = 100;
print("Analyzing image "+imageIndex+"/"+numImages+"...");
6 changes: 6 additions & 0 deletions _includes/string_concat/creating_log_messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h4 id="creating_logs"><a href="#creating_logs">Creating log messages</a></h4>
- Open a script editor
- Define two variables:
- index of the hypothetially currently processed image with value `11`
- the total number of images to be processed with value `100`.
- Using those two variables create the message: `"Analyzing image 11/100..."`.
1 change: 1 addition & 0 deletions _includes/string_concat/creating_log_messages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
5 changes: 5 additions & 0 deletions _includes/string_concat/manipulating_file_paths.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// manipulating file paths
tmpFolder = getDirectory("temp");
fileName = "nuclei.tif";
path = tmpFolder + File.separator + fileName;
print(path);
5 changes: 5 additions & 0 deletions _includes/string_concat/manipulating_file_paths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h4 id="manipulate_paths"><a href="#manipulate_paths">Manipulate file paths</a></h4>

In bioimage analysis, one very often opens one image and then needs to save a segmentation (label mask file) and segmented object measurements (a table file). To this end, it is useful if the output images have similar names than the input image, such that one knows that they belong to each other. Sometimes it is useful for those output files to be placed in the same folder as the input image, but often you want to specify a dedicated output folder.

To manage all these scenarios it is critical to learn how to manipulate file and folder paths in various ways and thereby construct the output paths from the input path and a given output directory.
1 change: 1 addition & 0 deletions _includes/string_concat/manipulating_file_paths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO

0 comments on commit d30da85

Please sign in to comment.