Skip to content

Commit

Permalink
[REF] Refactor converters (#1140)
Browse files Browse the repository at this point in the history
* refactor converters (unfinished)

* some fixes

* some more fixes

* some more fixes 2

* some improvements

* some improvements 2

* try fixing oasis issues

* try fixing oasis issues again

* fix adni to bids and simplify genfi to bids

* work on API

* make API more uniform

* fix remaining bugs and continue uniformizing API

* finish refactoring

* fix call to find_image_path in adni_fmap

* warn when n_procs or subjects options are not implemented

* continue refactoring

* fix bad merge

* refine adni converter interface

* post rebase fixes

* fix bad rebase

* fix errors introduced while rebasing

* expose convert
  • Loading branch information
NicolasGensollen authored Jun 10, 2024
1 parent b94af6c commit 1a8508e
Show file tree
Hide file tree
Showing 77 changed files with 4,534 additions and 4,141 deletions.
374 changes: 175 additions & 199 deletions clinica/iotools/bids_utils.py

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions clinica/iotools/converter_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
from os import PathLike
from typing import List, Optional

__all__ = ["replace_sequence_chars"]


def replace_sequence_chars(sequence_name: str) -> str:
"""Replace special characters in the sequence by underscores (as done for corresponding folder names in ADNI).
Args:
sequence_name: sequence to process
Returns: the new string
"""
import re

return re.sub("[ /;*()<>:]", "_", sequence_name)


class MissingModsTracker:
"""Class used for tracking the number of missing modalities in a database.
Expand Down
3 changes: 3 additions & 0 deletions clinica/iotools/converters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .factory import convert

__all__ = ["convert"]
3 changes: 3 additions & 0 deletions clinica/iotools/converters/adni_to_bids/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .adni_to_bids import convert

__all__ = ["convert"]
Loading

0 comments on commit 1a8508e

Please sign in to comment.