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

[REF] Function create_scans_dict from bids_utils is highly inefficient, may be replaceable #1326

Open
1 of 2 tasks
AliceJoubert opened this issue Oct 10, 2024 · 1 comment
Assignees

Comments

@AliceJoubert
Copy link
Contributor

AliceJoubert commented Oct 10, 2024

The function create_scans_dict used for AIBL and OASIS converters :

def create_scans_dict(
clinical_data_dir: Path,
study_name: StudyName,
clinical_specifications_folder: Path,
bids_ids: list[str],
name_column_ids: str,
name_column_ses: str,
ses_dict: dict,
) -> pd.DataFrame:

can be very much improved.

  • It uses inefficient arguments. For example, ses_dict is the whole sessions dict used elsewhere to write sessions.tsv but is only used in this function to get sessions numbers :

# Init the dictionary with the subject ids
for bids_id in bids_ids:
scans_dict[bids_id] = dict()
for session_id in {"ses-" + key for key in ses_dict[bids_id].keys()}:

  • In general, this function lasts 100+ lines when it is supposed to produce a simple scans dict indicating the files found in a category folder (ex : anat). It is probable that it can be replaced by another function already existing.

  • OASIS

  • AIBL

Copy link

This issue is considered stale because it has not received further activity for the last 14 days. You may remove the inactive label or add a comment, otherwise it will be closed after the next 14 days.

@github-actions github-actions bot added the inactive Issue or request has gone stale label Jan 15, 2025
@AliceJoubert AliceJoubert removed the inactive Issue or request has gone stale label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant