Skip to content

Commit 0fcb441

Browse files
authored
Merge pull request imcf#146 from rohangirishrao/interactive-tests-fix
Add clear expected results for interactive Fiji-tests (Issue imcf#144)
2 parents e58e4c7 + f61b4ec commit 0fcb441

5 files changed

Lines changed: 45 additions & 54 deletions

File tree

tests/interactive-imagej/shading-test.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/interactive-imagej/save-script-parameters.py renamed to tests/interactive-imagej/test_save_script_parameters.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
#@ CommandService command
88
#@ LogService sjlog
99

10-
import os
10+
# Prerequisites before running this script in Fiji:
11+
#
12+
# - Drag and drop, and run this script in Fiji.
13+
# - Set parameters in the dialog box.
14+
#
15+
# Expected result: a file named "script_parameters.txt" is written to the
16+
# chosen output directory, with all parameters from the script.
1117

18+
import os
1219
import imcflibs.log
1320
from imcflibs.imagej import misc
1421

tests/interactive-imagej/send-notification-email.md renamed to tests/interactive-imagej/test_send_notification_email.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
# Test the send_notification_email function
1+
# Prerequisites before running this script in Fiji:
2+
#
3+
# Add the following lines to IJ_Prefs.txt:
4+
# Linux/Mac: ~/.imagej/IJ_Prefs.txt
5+
# Windows: C:\Users\<USERNAME>\.imagej\IJ_Prefs.txt
6+
#
7+
# .imcf.sender_email=imcf@unibas.ch
8+
# .imcf.smtpserver=smtp.unibas.ch
9+
#
10+
# Expected result: a mail is sent to nikolaus.ehrenfeuchter@unibas.ch from
11+
# imcf@unibas.ch, with a print statement in Fiji.
212

3-
```Python
413
from imcflibs.imagej.misc import send_notification_email
514

615
from imcflibs.log import LOG as log
716
from imcflibs.log import enable_console_logging
817
from imcflibs.log import set_loglevel
918

10-
11-
"""
12-
Usage:
13-
BEFORE starting Fiji, add to the IJ_Prefs.txt:
14-
15-
.imcf.sender_email=imcf@unibas.ch
16-
.imcf.smtpserver=smtp.unibas.ch
17-
18-
Linux/Mac: ~/.imagej/IJ_Prefs.txt
19-
Windows: C:\Users\<USERNAME>\.imagej\IJ_Prefs.txt
20-
"""
21-
22-
2319
enable_console_logging()
2420
set_loglevel(2)
2521

26-
2722
# see if logging works:
2823
log.warn("warn")
2924
log.debug("DEBUG")
@@ -36,4 +31,3 @@
3631
)
3732

3833
log.info("DONE")
39-
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Prerequisites before running this script in Fiji:
2+
#
3+
# - Open an image to test on (e.g. Shaded-blobs.png) in Fiji before running.
4+
# - Drag this script into Fiji and run it.
5+
#
6+
# Expected result: a new image titled "Result of blobs.gif" opens alongside
7+
# the original, showing a flatfield corrected version of the raw blobs.gif.
8+
9+
from imcflibs.imagej import shading
10+
import ij
11+
from ij import IJ
12+
13+
imp = IJ.getImage()
14+
15+
# Any other method in class shading also works
16+
imcf_shading = shading.simple_flatfield_correction(imp)
17+
imcf_shading.show()
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
# Testing the `imcflibs.imagej.trackmate` module
1+
# Prerequisites before running this script in Fiji:
2+
#
3+
# - Open the blobs image, e.g. using Ctrl + Shift + B.
4+
# - Drag and drop this script and run it in Fiji.
5+
#
6+
# Expected result: a label image named "LblImg_blobs.gif" opens next to the raw
7+
# blobs.gif with many segmented spots (LoG detector). With the Cellpose detector
8+
# the segmented blobs should be quite accurate; the LoG detector finds many spots
9+
# across the image.
210

3-
Instructions for *interactive* testing (i.e. manually running a script in Fiji's
4-
*Script Editor*) of the `imcflibs.imagej.trackmate` module.
5-
6-
## Testing instructions
7-
8-
1. An updated `python-imcflibs.jar` containing the changes to be tested has to
9-
be installed into Fiji already.
10-
1. Next, open the blobs image, e.g. using `Ctrl` + `Shift` + `B`.
11-
1. Then, launch the *Script Editor* using `Ctrl` + `Shift` + `N`, paste the
12-
following script and finally run it:
13-
14-
```Python
1511
from imcflibs.imagej import trackmate
1612
from ij import IJ
1713

@@ -33,8 +29,3 @@
3329

3430
res_img = trackmate.run_trackmate(imp, settings)
3531
res_img.show()
36-
```
37-
38-
## Expected behavior / results
39-
40-
FIXME!!

0 commit comments

Comments
 (0)