Skip to content

Commit 9dae485

Browse files
committed
Merge branch 'devel' into fix/119-listdir-matching-tests
2 parents fad0e28 + 85f0c98 commit 9dae485

16 files changed

Lines changed: 436 additions & 232 deletions

File tree

β€Ž.github/workflows/lint.ymlβ€Ž

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
1-
name: Code Linting πŸ”Žβš‘
1+
name: Linting πŸ“‘πŸ”Žβš‘
22

33
on:
44
push:
55
pull_request:
66
workflow_dispatch:
77

88
jobs:
9-
10-
lint:
9+
ruff:
1110
name: Ruff βš‘πŸ•΅
1211

1312
runs-on: ubuntu-latest
1413

1514
steps:
16-
1715
- name: πŸ“₯ Checkout repo
1816
uses: actions/checkout@v4
1917

2018
- name: Run Ruff checks ⚑
2119
uses: astral-sh/ruff-action@v3
2220
with:
2321
args: check
22+
23+
markdownlint:
24+
name: Markdownlint πŸ“‘πŸ•΅
25+
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: πŸ“₯ Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Run markdownlint-cli2-action πŸ“‘
32+
uses: DavidAnson/markdownlint-cli2-action@v22
33+
with:
34+
globs: |
35+
*.md
36+
!test/*.md

β€Ž.vscode/settings.jsonβ€Ž

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,56 @@
1515
"bdvp",
1616
"bigstitcher",
1717
"biop",
18+
"clij",
19+
"Dscijava",
20+
"flatfield",
21+
"Fluo",
22+
"IJPB",
1823
"imageplus",
24+
"imarisconvert",
1925
"imglib",
26+
"imgplus",
2027
"interestpoint",
2128
"intermodes",
2229
"javax",
30+
"keyvalue",
2331
"Kheops",
32+
"labelimage",
33+
"listdir",
2434
"micrometa",
35+
"Morpholib",
2536
"multiresolution",
37+
"olefile",
38+
"omerotools",
39+
"ordereddict",
2640
"otsu",
2741
"pathtools",
42+
"phmax",
2843
"Prefs",
44+
"processingoptions",
2945
"PTBIOP",
3046
"PYENV",
3147
"pylint",
3248
"ransac",
3349
"renyi",
3450
"repartitions",
51+
"resultstable",
3552
"RETVAL",
53+
"roimanager",
54+
"rois",
55+
"rollingball",
3656
"scijava",
3757
"shanbhag",
3858
"sjlogging",
59+
"smtpserver",
3960
"spimdata",
61+
"stardist",
62+
"stdv",
4063
"strtools",
4164
"subfolders",
4265
"subsampling",
66+
"TESTDATA",
67+
"thresholding",
4368
"trackmate",
4469
"virtualenv",
4570
"virtualfish"

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
# Changelog 🧾
44

5+
## 2.0.0
6+
7+
### Changed
8+
9+
* Minimum required version for [python-micrometa] increased to `15.2.3`.
10+
511
## 1.5.0
612

713
This release brings a lot of additions, not all changes and functions are
@@ -271,3 +277,5 @@ Utilities for filtering and thresholding.
271277
* `imcflibs.pathtools.listdir_matching` now has an additional optional argument
272278
`sort` (defaulting to `False`) to request the resulting list to be sorted.
273279
* Many improvements / clarifications in function docstrings.
280+
281+
[python-micrometa]: https://pypi.org/project/python-micrometa/

β€ŽDESC.mdβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
<!-- markdownlint-disable MD041 (first-line-heading) -->
2+
13
:snake::coffee::nut_and_bolt::wrench:
24
A collection of commonly used Python helper functions.

β€ŽDEVELOPMENT.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ RELEASE_TAG=$(git tag -l "python-imcflibs-*" | tail -n 1)
3030
git push origin $RELEASE_TAG
3131
```
3232

33-
**IMPORTANT 2**: in case a **pre-releaes** was created, the last commit needs to
33+
**IMPORTANT 2**: in case a **pre-release** was created, the last commit needs to
3434
be discarded as the *release-script* places a wrong version / snapshot
3535
combination in the `pom.xml`:
3636

β€ŽREADME.mdβ€Ž

Lines changed: 66 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,81 @@
1010
[![DOI](https://zenodo.org/badge/156891364.svg)][doi]
1111

1212
This package contains a diverse collection of Python functions dealing with
13-
paths, I/O (file handles, ...), strings etc. and tons of [Fiji][fiji] /
14-
[ImageJ2][imagej] convenience wrappers to simplify scripting and reduce
15-
cross-script redundanciees.
13+
paths, I/O (file handles, ...), strings etc. and tons of [Fiji] / [ImageJ2]
14+
convenience wrappers to simplify scripting and reduce cross-script redundancies.
1615

1716
Initially this has been a multi-purpose package where a substantial part had
18-
been useful in **CPython** as well. However, since the latest Jython
19-
release is still based on Python 2.7 (see the [Jython 3 roadmap][jython3] for
20-
more info), *imcflibs* is now basically limited to the **Fiji / ImageJ2
21-
ecosystem**.
17+
been useful in **CPython** as well. However, since the latest Jython release is
18+
still based on Python 2.7 (see the [Jython 3 roadmap][jython3] for more info),
19+
*imcflibs* is now basically limited to the **Fiji / ImageJ2 ecosystem**.
2220

2321
Releases are made through Maven and published to the [SciJava Maven
2422
repository][sj_maven]. The easiest way to use the lib is by adding the **`IMCF
2523
Uni Basel`** [update site][imcf_updsite] to your ImageJ installation.
2624

2725
The [`pip install`able package][pypi] is probably only useful for two cases:
2826
running `pytest` (where applicable) and rendering [HTML-based API docs][apidocs]
29-
using [`pdoc`][pdoc]. Let us know in case you're having another use case πŸŽͺ for
30-
it.
27+
using [pdoc]. Let us know in case you're having another use case πŸŽͺ for it.
3128

3229
Developed and provided by the [Imaging Core Facility (IMCF)][imcf] of the
3330
Biozentrum, University of Basel, Switzerland.
3431

32+
## Installation Instructions
33+
34+
Two ways of installing the `imcflibs` package are described here, the "*easy*"
35+
one through the *Fiji Update Sites* and the "*manual*" method using packages
36+
explicitly downloaded from [SciJava Maven][sj_maven].
37+
38+
### 🧿 Default: Installation via Update Sites
39+
40+
After a fresh install of [Fiji], navigate to *Help* -> *Update* and in the
41+
resulting window, press *Manage Update Sites*. Here, search for and tick the
42+
following necessary update sites for this package.
43+
44+
- ImageJ
45+
- Fiji
46+
- 3D ImageJ-Suite
47+
- clij2
48+
- IJPB-plugins
49+
- IMCF Uni Basel
50+
- StarDist
51+
- CALM
52+
- TrackMate-Cellpose
53+
- TrackMate-Helper
54+
- TrackMate-StarDist
55+
- TrackMate-Weka
56+
- TrackMate-MorpholibJ
57+
58+
The **`IMCF Uni Basel`** update-site will always provide the latest compatible
59+
combination of *official*`.jar` file to use this package.
60+
61+
### πŸ— Alternative: SciJava Maven Package πŸ‘·
62+
63+
πŸ’‘ **IMPORTANT:** πŸ’‘ same as for the *default* installation previously
64+
described, you will need to enable **all Update Sites listed above** in your
65+
Fiji as well when using the method described here!
66+
67+
The most up-to-date `.jar` (or any other published version, including
68+
pre-releases) for this package can be always found on the [Scijava Maven
69+
repository][sj_maven]. Navigate to the `python-imcflibs` folder, pick the
70+
desired version (can also be a pre-release) and download the contained `.jar`
71+
file, e.g. `python-imcflibs-2.0.0.jar`.
72+
73+
Then simply place that file in the `jars` folder of your Fiji installation, e.g
74+
`D:\Development\Fiji.app\jars\` or `/opt/Fiji.app/jars/`, possibly removing
75+
other versions of the same package from that folder - then (re-)start Fiji.
76+
77+
If you'd prefer to use the cutting-edge version from GitHub, look into the
78+
[development instructions](DEVELOPMENT.md) for details.
79+
80+
### Installation Testing
81+
82+
To check the package's correct installation in Fiji, search for *Script
83+
Interpreter* in the Search bar, and type `:lang python`, followed by e.g.
84+
`import imcflibs.imagej.misc`. If no errors are shown, the installation was
85+
successful. Alternatively, you can scroll in the sidebar of the Interpreter to
86+
search for imcflibs.
87+
3588
## Example usage
3689

3790
### Shading correction / projection
@@ -50,17 +103,17 @@ correct_and_project(raw_image, out_path, model, "Maximum", ".ics")
50103

51104
### Split TIFFs by channels and slices
52105

53-
* See the [Split_TIFFs_By_Channels_And_Slices.py][script_split] script.
106+
- See the [Split_TIFFs_By_Channels_And_Slices.py][script_split] script.
54107

55108
### Use status and progress bar updates
56109

57-
* See the [FluoView_OIF_OIB_OIR_Simple_Stitcher.py][script_fvstitch] script.
110+
- See the [FluoView_OIF_OIB_OIR_Simple_Stitcher.py][script_fvstitch] script.
58111

59112
[imcf]: https://www.biozentrum.unibas.ch/imcf
60-
[imagej]: https://imagej.net
113+
[imagej2]: https://imagej.net
61114
[fiji]: https://fiji.sc
62115
[jython3]: https://www.jython.org/jython-3-roadmap
63-
[sj_maven]: https://maven.scijava.org/#nexus-search;gav~ch.unibas.biozentrum.imcf~~~~
116+
[sj_maven]: https://maven.scijava.org/service/rest/repository/browse/releases/ch/unibas/biozentrum/imcf/
64117
[imcf_updsite]: https://imagej.net/list-of-update-sites/
65118
[script_split]: https://github.com/imcf/imcf-fiji-scripts/blob/master/src/main/resources/scripts/Plugins/IMCF_Utilities/Convert/Split_TIFFs_By_Channels_And_Slices.py
66119
[script_fvstitch]: https://github.com/imcf/imcf-fiji-scripts/blob/master/src/main/resources/scripts/Plugins/IMCF_Utilities/Stitching_Registration/FluoView_OIF_OIB_OIR_Simple_Stitcher.py

β€ŽTESTING.mdβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Testing πŸ§ͺ🧫 in Fiji / ImageJ2
22

3-
## Using `pytest` πŸπŸ”¬ and Python 3 for plain Python code
3+
## Using pytest πŸπŸ”¬ and Python 3 for plain Python code
44

55
Those parts of the package that do not interact / depend on ImageJ objects can
66
be tested via [`pytest`][pytest] up to a certain level, some (most?) of them
77
should even work in a Python 3 environment.
88

9-
To perform those tests, the packges otherwise provided by ImageJ need to be
10-
mocked using the `imcf-fiji-mocks` package. For seting up a *venv* use the steps
11-
described here:
9+
To perform those tests, the packages otherwise provided by ImageJ need to be
10+
mocked using the `imcf-fiji-mocks` package. For setting up a *venv* use the
11+
steps described here:
1212

1313
```bash
1414
# check if we're "inside" the repo already, otherwise clone it here:
@@ -44,7 +44,7 @@ specific tests, use e.g.
4444
pytest tests/bdv/test_processingoptions.py
4545
```
4646

47-
## Using `pytest` πŸπŸ”¬ and Python 2 for plain Python code
47+
## Using pytest πŸπŸ”¬ and Python 2 for plain Python code
4848

4949
For running [`pytest`][pytest] in a C-Python 2 environment, things are slightly
5050
more complicated than the approach described for Python 3 above as `pip` for
@@ -84,7 +84,7 @@ some basic, semi-interactive tests the following conventions are being used:
8484
* Any *interactive* test script should start with a header similar to the one
8585
described below. Paths to input data *inside* the test scripts **has** to be
8686
relative to the location of the `sample-data` repository mentioned above. This
87-
will allow for a fairly okayish testing workflow like this:
87+
will allow for a fairly okay-ish testing workflow like this:
8888
* Make your changes in VS Code, then trigger a build by pressing `Shift` +
8989
`Ctrl` + `B`. If things are configured as described in the *DEVELOPMENT*
9090
document, the resulting `.jar` file will be automatically placed in Fiji's

0 commit comments

Comments
Β (0)