project_init
tit.project_init ¶
Project initialization helpers for TI-Toolbox.
Provides utilities for detecting new projects, scaffolding BIDS-compliant directory structures, and copying bundled example data into a fresh project.
initialize_project_structure ¶
initialize_project_structure(project_dir: Path) -> None
Scaffold a full BIDS-compliant directory structure for a new project.
Parameters¶
project_dir : Path Root directory of the new project. Directories, metadata files, README, and an initialization marker are created idempotently.
Source code in tit/project_init/initializer.py
is_new_project ¶
Return True if project_dir exists and contains no project data.
Parameters¶
project_dir : Path Root directory of the project.
Returns¶
bool
True when the directory is empty of project data and markers.
Source code in tit/project_init/initializer.py
load_project_status ¶
Read project_status.json and return its contents.
Returns an empty dict when the file is missing or unreadable. This function never writes to disk.
Parameters¶
project_dir : Path Root directory of the project.
Source code in tit/project_init/initializer.py
setup_example_data ¶
Copy bundled example data into project_dir.
Parameters¶
toolbox_root : Path Root of the TI-Toolbox installation (contains example data). project_dir : Path Target project directory.
Returns¶
bool
True on success, False on failure.
Source code in tit/project_init/initializer.py
update_project_status ¶
Merge updates into project_status.json and write back.
Performs a recursive (deep) merge so that nested keys such as
user_preferences.show_welcome can be updated without clobbering
sibling keys. Automatically sets last_updated.
If the file does not yet exist a warning is logged and the function
returns False — the file should have been created by
:func:initialize_project_status.
Parameters¶
project_dir : Path Root directory of the project. updates : dict Fields to merge into the existing status.
Returns¶
bool
True on success.