From 87b65cf8e5e08f031d5acc6cc5a66c23f3285d27 Mon Sep 17 00:00:00 2001 From: Marcel Rosier Date: Mon, 5 Aug 2024 21:35:17 +0200 Subject: [PATCH] Add segmentor deprecation notice --- brats_toolkit/segmentor.py | 3 ++- brats_toolkit/util/citation_reminder.py | 26 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/brats_toolkit/segmentor.py b/brats_toolkit/segmentor.py index 5a5ecb7..c744fe0 100644 --- a/brats_toolkit/segmentor.py +++ b/brats_toolkit/segmentor.py @@ -24,7 +24,7 @@ from . import fusionator from .util import filemanager as fm from .util import own_itk as oitk -from .util.citation_reminder import citation_reminder +from .util.citation_reminder import citation_reminder, deprecated_segmentor class Segmentor(object): @@ -32,6 +32,7 @@ class Segmentor(object): Now does it all! """ + @deprecated_segmentor @citation_reminder def __init__( self, diff --git a/brats_toolkit/util/citation_reminder.py b/brats_toolkit/util/citation_reminder.py index f2075af..32671fc 100644 --- a/brats_toolkit/util/citation_reminder.py +++ b/brats_toolkit/util/citation_reminder.py @@ -31,7 +31,7 @@ def wrapper(*args, **kwargs): justify="center", ) console.print( - "Please note that this deprecation does not impact the segmentation and fusion module, which will continue to receive maintenance and support.", + "Please note that this deprecation does not impact the fusion module, which will continue to receive maintenance and support.", justify="center", ) console.print( @@ -48,3 +48,27 @@ def wrapper(*args, **kwargs): func(*args, **kwargs) return wrapper + + +def deprecated_segmentor(func): + def wrapper(*args, **kwargs): + console = Console() + console.rule("[bold red]Deprecation note[/bold red]") + console.print( + "Deprecation Notice: Support for the BraTS Toolkit's segmentor is now deprecated, although it is expected to remain functional.", + justify="center", + ) + console.print( + "Please note that this deprecation does not impact the fusion module, which will continue to receive maintenance and support.", + justify="center", + ) + console.print( + "We recommend transitioning to the BrainLes segmentor tool available at: https://github.com/BrainLesion/BraTS for segmentation tasks.", + justify="center", + ) + + console.rule() + console.line() + func(*args, **kwargs) + + return wrapper