Skip to content

Commit 3ae06fc

Browse files
authored
Merge pull request #143 from BrainLesion/138-feature-citation-reminder
138 feature citation reminder
2 parents ebf22e1 + 50e7ac6 commit 3ae06fc

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,25 @@ For further information please have a look at our [Jupyter Notebook tutorials](h
111111

112112

113113

114+
## Citation
114115

116+
> [!IMPORTANT]
117+
> If you use `brainles-preprocessing` in your research, please cite it to support the development!
115118
116-
<!-- TODO citation -->
119+
Kofler, F., Rosier, M., Astaraki, M., Möller, H., Mekki, I. I., Buchner, J. A., Schmick, A., Pfiffer, A., Oswald, E., Zimmer, L., Rosa, E. de la, Pati, S., Canisius, J., Piffer, A., Baid, U., Valizadeh, M., Linardos, A., Peeken, J. C., Shit, S., … Menze, B. (2025). *BrainLesion Suite: A Flexible and User-Friendly Framework for Modular Brain Lesion Image Analysis* [arXiv preprint arXiv:2507.09036](https://doi.org/10.48550/arXiv.2507.09036)
120+
121+
122+
```
123+
@misc{kofler2025brainlesionsuiteflexibleuserfriendly,
124+
title={BrainLesion Suite: A Flexible and User-Friendly Framework for Modular Brain Lesion Image Analysis},
125+
author={Florian Kofler and Marcel Rosier and Mehdi Astaraki and Hendrik Möller and Ilhem Isra Mekki and Josef A. Buchner and Anton Schmick and Arianna Pfiffer and Eva Oswald and Lucas Zimmer and Ezequiel de la Rosa and Sarthak Pati and Julian Canisius and Arianna Piffer and Ujjwal Baid and Mahyar Valizadeh and Akis Linardos and Jan C. Peeken and Surprosanna Shit and Felix Steinbauer and Daniel Rueckert and Rolf Heckemann and Spyridon Bakas and Jan Kirschke and Constantin von See and Ivan Ezhov and Marie Piraud and Benedikt Wiestler and Bjoern Menze},
126+
year={2025},
127+
eprint={2507.09036},
128+
archivePrefix={arXiv},
129+
primaryClass={cs.CV},
130+
url={https://arxiv.org/abs/2507.09036},
131+
}
132+
```
117133

118134
## Documentation
119135
We provide a (WIP) documentation. Have a look [here](https://brainles-preprocessing.readthedocs.io/en/latest/?badge=latest)

brainles_preprocessing/preprocessor/preprocessor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
)
2323
from brainles_preprocessing.registration import ANTsRegistrator
2424
from brainles_preprocessing.registration.registrator import Registrator
25+
from brainles_preprocessing.utils.citation_reminder import citation_reminder
2526
from brainles_preprocessing.utils.logging_utils import LoggingManager
2627

2728
logging_man = LoggingManager(name=__name__)
@@ -45,6 +46,7 @@ class BasePreprocessor(ABC):
4546
4647
"""
4748

49+
@citation_reminder
4850
def __init__(
4951
self,
5052
center_modality: CenterModality,

brainles_preprocessing/registration/ANTs/ANTs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def inverse_transform(
241241
fixed_image_path (str or Path): Path to the fixed image.
242242
moving_image_path (str or Path): Path to the moving image.
243243
transformed_image_path (str or Path): Path to the transformed image (output).
244-
matrix_path (str or Path or List[str | Path]): Path to the transformation matrix or a list of matrices.
244+
matrix_path (str or Path or List[str | Path]): Path to the transformation matrix or a list of matrices.
245245
log_file_path (str or Path): Path to the log file.
246246
interpolator (str): Interpolator to use for the transformation. Default is 'nearestNeighbor'.
247247
**kwargs: Additional transformation parameters to update the instantiated defaults.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import functools
2+
import os
3+
4+
from rich.console import Console
5+
6+
CITATION_LINK = "https://github.com/BrainLesion/preprocessing#citation"
7+
8+
9+
def citation_reminder(func):
10+
"""
11+
Decorator to remind users to cite brainles-preprocessing.
12+
13+
The reminder is shown when the environment variable
14+
`BRAINLES_PREPROCESSING_CITATION_REMINDER` is set to "true" (default).
15+
To disable the reminder, set the environment variable to "false".
16+
17+
Environment variable used:
18+
- BRAINLES_PREPROCESSING_CITATION_REMINDER: Controls whether the reminder is shown.
19+
"""
20+
21+
@functools.wraps(func)
22+
def wrapper(*args, **kwargs):
23+
if (
24+
os.environ.get("BRAINLES_PREPROCESSING_CITATION_REMINDER", "true").lower()
25+
== "true"
26+
):
27+
console = Console()
28+
console.rule("Thank you for using [bold]brainles-preprocessing[/bold]")
29+
console.print(
30+
"Please support our development by citing",
31+
justify="center",
32+
)
33+
console.print(
34+
f"{CITATION_LINK} -- Thank you!",
35+
justify="center",
36+
)
37+
console.rule()
38+
console.line()
39+
return func(*args, **kwargs)
40+
41+
return wrapper

0 commit comments

Comments
 (0)