Skip to content

Commit

Permalink
Merge pull request #63 from neuronflow/add-segmentor-deprecation-notice
Browse files Browse the repository at this point in the history
Add segmentor update notice
  • Loading branch information
neuronflow authored Sep 26, 2024
2 parents b1555e3 + e8a068d commit 0cd322f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 2 additions & 1 deletion brats_toolkit/segmentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +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
from .util.citation_reminder import citation_reminder, new_segmentor_note


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

@new_segmentor_note
@citation_reminder
def __init__(
self,
Expand Down
22 changes: 21 additions & 1 deletion 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 segmentation and 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 @@ -48,3 +49,22 @@ def wrapper(*args, **kwargs):
func(*args, **kwargs)

return wrapper


def new_segmentor_note(func):
def wrapper(*args, **kwargs):
console = Console()
console.rule("[bold cyan]New segmentor package[/bold cyan]")
console.print(
"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(
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.rule()
console.line()
func(*args, **kwargs)

return wrapper

0 comments on commit 0cd322f

Please sign in to comment.