diff --git a/README.md b/README.md index 2aaa926..61d23c8 100644 --- a/README.md +++ b/README.md @@ -111,9 +111,25 @@ For further information please have a look at our [Jupyter Notebook tutorials](h +## Citation +> [!IMPORTANT] +> If you use `brainles-preprocessing` in your research, please cite it to support the development! - +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) + + +``` +@misc{kofler2025brainlesionsuiteflexibleuserfriendly, + title={BrainLesion Suite: A Flexible and User-Friendly Framework for Modular Brain Lesion Image Analysis}, + 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}, + year={2025}, + eprint={2507.09036}, + archivePrefix={arXiv}, + primaryClass={cs.CV}, + url={https://arxiv.org/abs/2507.09036}, +} +``` ## Documentation We provide a (WIP) documentation. Have a look [here](https://brainles-preprocessing.readthedocs.io/en/latest/?badge=latest) diff --git a/brainles_preprocessing/preprocessor/preprocessor.py b/brainles_preprocessing/preprocessor/preprocessor.py index 03e984b..b460185 100644 --- a/brainles_preprocessing/preprocessor/preprocessor.py +++ b/brainles_preprocessing/preprocessor/preprocessor.py @@ -22,6 +22,7 @@ ) from brainles_preprocessing.registration import ANTsRegistrator from brainles_preprocessing.registration.registrator import Registrator +from brainles_preprocessing.utils.citation_reminder import citation_reminder from brainles_preprocessing.utils.logging_utils import LoggingManager logging_man = LoggingManager(name=__name__) @@ -45,6 +46,7 @@ class BasePreprocessor(ABC): """ + @citation_reminder def __init__( self, center_modality: CenterModality, diff --git a/brainles_preprocessing/registration/ANTs/ANTs.py b/brainles_preprocessing/registration/ANTs/ANTs.py index 3e37f2b..a1a9ea1 100644 --- a/brainles_preprocessing/registration/ANTs/ANTs.py +++ b/brainles_preprocessing/registration/ANTs/ANTs.py @@ -241,7 +241,7 @@ def inverse_transform( fixed_image_path (str or Path): Path to the fixed image. moving_image_path (str or Path): Path to the moving image. transformed_image_path (str or Path): Path to the transformed image (output). - matrix_path (str or Path or List[str | Path]): Path to the transformation matrix or a list of matrices. + matrix_path (str or Path or List[str | Path]): Path to the transformation matrix or a list of matrices. log_file_path (str or Path): Path to the log file. interpolator (str): Interpolator to use for the transformation. Default is 'nearestNeighbor'. **kwargs: Additional transformation parameters to update the instantiated defaults. diff --git a/brainles_preprocessing/utils/citation_reminder.py b/brainles_preprocessing/utils/citation_reminder.py new file mode 100644 index 0000000..3ec2964 --- /dev/null +++ b/brainles_preprocessing/utils/citation_reminder.py @@ -0,0 +1,41 @@ +import functools +import os + +from rich.console import Console + +CITATION_LINK = "https://github.com/BrainLesion/preprocessing#citation" + + +def citation_reminder(func): + """ + Decorator to remind users to cite brainles-preprocessing. + + The reminder is shown when the environment variable + `BRAINLES_PREPROCESSING_CITATION_REMINDER` is set to "true" (default). + To disable the reminder, set the environment variable to "false". + + Environment variable used: + - BRAINLES_PREPROCESSING_CITATION_REMINDER: Controls whether the reminder is shown. + """ + + @functools.wraps(func) + def wrapper(*args, **kwargs): + if ( + os.environ.get("BRAINLES_PREPROCESSING_CITATION_REMINDER", "true").lower() + == "true" + ): + console = Console() + console.rule("Thank you for using [bold]brainles-preprocessing[/bold]") + console.print( + "Please support our development by citing", + justify="center", + ) + console.print( + f"{CITATION_LINK} -- Thank you!", + justify="center", + ) + console.rule() + console.line() + return func(*args, **kwargs) + + return wrapper