generated from BrainLesion/brainles-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from BrainLesion/36-enhance-docs
36 enhance docs
- Loading branch information
Showing
13 changed files
with
158 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Abstract Base Class | ||
==================== | ||
|
||
The following class represents the abstract base class for BraTS algorithms. | ||
|
||
.. automodule:: brats.core.brats_algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Core | ||
======================== | ||
|
||
The following classes provide the top performing algorithms from several BraTS challenges. | ||
All algorithms can be used for a single subject inference (one set of MRI scans) or for a batch of multiple subjects. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Core Algorithms | ||
|
||
segmentation_algorithms | ||
inpainting_algorithms | ||
brats_algorithm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Inpainting Algorithms | ||
====================== | ||
|
||
The following classes provide inpainting algorithms from several BraTS challenges. | ||
|
||
.. automodule:: brats.core.inpainting_algorithms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Segmentation Algorithms | ||
======================== | ||
|
||
The following classes provide segmentation algorithms from several BraTS challenges. | ||
|
||
.. automodule:: brats.core.segmentation_algorithms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import re | ||
|
||
|
||
def preprocess_readme(input_file: str, output_file: str) -> None: | ||
"""Preprocess a README file to replace GitHub admonitions with Sphinx-style admonitions. | ||
Args: | ||
input_file (str): original README file | ||
output_file (str): processed README file | ||
""" | ||
with open(input_file, "r") as file: | ||
content = file.read() | ||
|
||
admonition_types = ["IMPORTANT", "NOTE", "TIP", "WARNING", "CAUTION"] | ||
|
||
for ad_type in admonition_types: | ||
# Replace > [!ad_type] with Sphinx admonition syntax | ||
content = re.sub( | ||
r"> \[!" | ||
+ ad_type | ||
+ "\]\s*\n((?:> .*\n)*)", # Match the > [!ad_type] and subsequent lines | ||
lambda m: "```{" | ||
+ ad_type | ||
+ "}\n" | ||
+ m.group(1).replace("> ", "").strip() | ||
+ "\n```", # Replace with MyST syntax | ||
content, | ||
) | ||
# Write the transformed content to the output file | ||
with open(output_file, "w") as file: | ||
file.write(content) | ||
|
||
|
||
if __name__ == "__main__": | ||
preprocess_readme("../../README.md", "../README_preprocessed.md") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Readme | ||
============== | ||
|
||
|
||
.. include:: ../README_preprocessed.md | ||
:parser: myst_parser.sphinx_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
Constants | ||
Utils | ||
======================== | ||
|
||
Constants used in the package | ||
Constants | ||
------------------------------ | ||
|
||
.. automodule:: brats.utils.constants | ||
:members: | ||
|
||
|
||
Exceptions | ||
------------------------------ | ||
|
||
.. automodule:: brats.utils.exceptions | ||
:members: |
Oops, something went wrong.