Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html report per subject #9

Merged
merged 16 commits into from
Aug 7, 2024
Merged
50 changes: 50 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This config was automatically generated from your source code
# Stacks detected: cicd:github-actions:.github/workflows,deps:python:.,package_manager:poetry:.,test:tox:.
version: 2.1
orbs:
python: circleci/python@2
jobs:
test-python:
# Install dependencies and run tests
docker:
- image: cimg/python:3.10-node
steps:
- checkout
- python/install-packages:
pkg-manager: poetry
- run:
name: Check
command: poetry run tox -e check -v
- run:
name: docs
command: poetry run tox -e docs -v
- run:
name: flake8
command: poetry run tox -e flake8 -v
- run:
name: tests
command: poetry run pytest
- run:
name: coverage
command: poetry run tox -e report -v
- store_test_results:
path: junit.xml
deploy:
# This is an example deploy job, not actually used by the workflow
docker:
- image: cimg/base:stable
steps:
# Replace this with steps to deploy to users
- run:
name: deploy
command: '#e.g. ./deploy.sh'
- run:
name: found github actions config
command: ':'
workflows:
build-and-test:
jobs:
- test-python
# - deploy:
# requires:
# - test-python
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Overview
* - docs
- |docs|
* - tests, CI & coverage
- |github-actions| |codecov| |codacy|
- |github-actions| |circleci| |codecov| |codacy|
* - codeclimate
- |codeclimate-maintainability| |codeclimate-testcoverage|
* - version
Expand All @@ -31,6 +31,10 @@ Overview
:alt: GitHub Actions Build Status
:target: https://github.com/GalKepler/keprep/actions

.. |circleci| image:: https://dl.circleci.com/status-badge/img/circleci/J6A3JWLZsHZMCMZ1aCKdXb/AVFefVDaX15sp62PZ8MpA9/tree/main.svg?style=svg
:alt: CircleCI Build Status
:target: https://dl.circleci.com/status-badge/redirect/circleci/J6A3JWLZsHZMCMZ1aCKdXb/AVFefVDaX15sp62PZ8MpA9/tree/main

.. |codecov| image:: https://codecov.io/github/GalKepler/keprep/graph/badge.svg?token=LO5CH471O4
:alt: Coverage Status
:target: https://app.codecov.io/github/GalKepler/keprep
Expand Down
1,523 changes: 1,074 additions & 449 deletions poetry.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ smriprep = "^0.12.1"
sdcflows = "^2.5.1"
tox = "^4.16.0"
doc8 = "^1.1.1"
flake8-pyproject = "^1.2.3"
pytest = "^8.3.2"
nireports = "^23.2.1"
setuptools = "^72.1.0"
dipy = "^1.9.0"

[tool.poetry.dev-dependencies]
coverage = "^7.5.4" # testing
Expand Down Expand Up @@ -88,3 +93,7 @@ source = [
omit = [
"tests/*"
]

[tool.flake8]
max-line-length = 88
per-file-ignores = ["src/keprep/config.py:E501", "src/keprep/workflows/dwi/descriptions/*.py:E501","src/keprep/interfaces/*.py:E501"]
24 changes: 23 additions & 1 deletion src/keprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class nipype(_Config):
memory_gb = None
"""Estimation in GB of the RAM this workflow can allocate at any given time."""
nprocs = os.cpu_count()
"""Number of processes (compute tasks) that can be run in parallel (multiprocessing only).""" # noqa: C0301
"""Number of processes (compute tasks) that can be run in parallel (multiprocessing only).""" # noqa: E501
omp_nthreads = None
"""Number of CPUs a single process can access for multithreaded execution."""
plugin = "MultiProc"
Expand Down Expand Up @@ -342,6 +342,8 @@ class execution(_Config):
"""FreeSurfer's subjects directory."""
layout = None
"""A :py:class:`~keprep.bids.layout.QSIPrepLayout` object, see :py:func:`init`."""
reportlets_dir = None
"""Path to a directory where reportlets will be stored."""
log_dir = None
"""The path to a directory that contains execution logs."""
log_level = 25
Expand Down Expand Up @@ -424,6 +426,9 @@ def init(cls):
cls.participant_label = cls.layout.get_subjects()
else:
cls.participant_label = list(cls.participant_label)
if cls.reportlets_dir is None:
cls.reportlets_dir = Path(cls.work_dir) / "reportlets"
cls.reportlets_dir.mkdir(exist_ok=True, parents=True) # type: ignore[union-attr]


# These variables are not necessary anymore
Expand All @@ -442,6 +447,10 @@ class workflow(_Config):

anat_only = False
"""Execute the anatomical preprocessing only."""
dwi2t1w_method = "epireg"
"""
Method to use for DWI-to-T1w coregistration. Either "epireg" (default) or "flirt"
"""
dwi2t1w_dof = 6
"""Degrees of freedom of the DWI-to-T1w registration steps."""
dwi2t1w_init = "register"
Expand All @@ -465,6 +474,19 @@ class workflow(_Config):
skull_strip_t1w = "force"
"""Skip brain extraction of the T1w image (default is ``force``, meaning that
*KePrep* will run brain extraction of the T1w)."""
denoise_method = "dwidenoise"
"""Image-based denoising method. Either "dwidenoise" (MRtrix), "patch2self" (DIPY)
or "none"."""
dwi_denoise_window = "auto"
"""Window size in voxels for image-based denoising, integer or "auto"."""
dwi_no_biascorr = False
"""DEPRECATED: see --b1-biascorrect-stage."""
eddy_config = "--fwhm=0 --flm='quadratic' --repol"
"""Configuration for running Eddy."""
hmc_model = "eddy"
"""Model used to generate target images for hmc."""
b0_threshold = 100
"""any value in the .bval file less than this will be considered a b=0 image."""


class loggers:
Expand Down
14 changes: 14 additions & 0 deletions src/keprep/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""fMRIPrep data files

.. autofunction:: load

.. automethod:: load.readable

.. automethod:: load.as_path

.. automethod:: load.cached
"""

from acres import Loader

load = Loader(__package__)
Loading