-
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.
- Loading branch information
Showing
7 changed files
with
66 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
These results were generated with the BIDS app for Computational Anatomy Toolbox | ||
(BIDS app: {{version}}; CAT12: {{cat_version}}; MATLAB MCR: {{mcr_version}}) | ||
|
||
The following steps were followed. | ||
|
||
1. ... | ||
|
||
2. ... |
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 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,38 @@ | ||
"""Module responsible for generating method section.""" | ||
|
||
from pathlib import Path | ||
|
||
from _version import __version__ | ||
from defaults import CAT_VERSION, MCR_VERSION | ||
from jinja2 import Environment, FileSystemLoader, select_autoescape | ||
|
||
|
||
def generate_method_section( | ||
output_dir: Path, | ||
version: str = __version__, | ||
cat_version: str = CAT_VERSION, | ||
mcr_version: str = MCR_VERSION, | ||
batch: str = None, | ||
) -> None: | ||
"""Add a method section to the output dataset.""" | ||
env = Environment( | ||
loader=FileSystemLoader(Path(__file__).parent), | ||
autoescape=select_autoescape(), | ||
lstrip_blocks=True, | ||
trim_blocks=True, | ||
) | ||
|
||
template = env.get_template("data/methods/template.jinja") | ||
|
||
output_file = output_dir / "logs" / "CITATION.md" | ||
output_file.parent.mkdir(parents=True, exist_ok=True) | ||
|
||
data = { | ||
"version": version, | ||
"cat_version": cat_version, | ||
"mcr_version": mcr_version, | ||
"batch": batch, | ||
} | ||
|
||
with open(output_file, "w") as f: | ||
print(template.render(data=data), file=f) |
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,3 +1,4 @@ | ||
rich_argparse | ||
pybids | ||
nibabel | ||
jinja2 |
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