Skip to content

Commit

Permalink
Fix info message
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRosier committed Aug 6, 2024
1 parent 87b65cf commit e8a068d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions brats_toolkit/segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
from . import fusionator
from .util import filemanager as fm
from .util import own_itk as oitk
from .util.citation_reminder import citation_reminder, deprecated_segmentor
from .util.citation_reminder import citation_reminder, new_segmentor_note


class Segmentor(object):
"""
Now does it all!
"""

@deprecated_segmentor
@new_segmentor_note
@citation_reminder
def __init__(
self,
Expand Down
16 changes: 6 additions & 10 deletions brats_toolkit/util/citation_reminder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from rich.console import Console

CITATION_LINK = "https://github.com/neuronflow/BraTS-Toolkit#citation"
BRATS_LINK = "https://github.com/BrainLesion/BraTS/"


def citation_reminder(func):
Expand Down Expand Up @@ -31,7 +32,7 @@ def wrapper(*args, **kwargs):
justify="center",
)
console.print(
"Please note that this deprecation does not impact the fusion module, which will continue to receive maintenance and support.",
"Please note that this deprecation does not impact the segmentor and fusion module, which will continue to receive maintenance and support.",
justify="center",
)
console.print(
Expand All @@ -50,23 +51,18 @@ def wrapper(*args, **kwargs):
return wrapper


def deprecated_segmentor(func):
def new_segmentor_note(func):
def wrapper(*args, **kwargs):
console = Console()
console.rule("[bold red]Deprecation note[/bold red]")
console.rule("[bold cyan]New segmentor package[/bold cyan]")
console.print(
"Deprecation Notice: Support for the BraTS Toolkit's segmentor is now deprecated, although it is expected to remain functional.",
"We developed a new segmentation tool that provides the latest BraTS algorithms (2023 and later) along with various improvements and features.",
justify="center",
)
console.print(
"Please note that this deprecation does not impact the fusion module, which will continue to receive maintenance and support.",
f"While the BraTS Toolkit segementation module will remain functional for the old models we recommend transitioning to the new BraTS package available at: {BRATS_LINK} to get the latest models and features.",
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)
Expand Down

0 comments on commit e8a068d

Please sign in to comment.