API Documentation¶
All modules above listed are under the “sct_dbtool” namespace.
Contents:
sct_dbtool.api – Server API¶
-
class
sct_dbtool.api.APIClient(user: str, password: str, hostname='tristano.neuro.polymtl.ca', port=80)[source]¶ The API client for the web management tool. This API client contains code only for retrieving the entire JSON dataset.
Parameters: - user – username for the web management.
- password – password for the web management.
- hostname – the hostname for the web management.
- port – the port of the web management.
sct_dbtool.sanity – Sanity Checks¶
-
class
sct_dbtool.sanity.CheckEmptyDemographics(db_path: str)[source]¶ This check will verify if the demographics field is present.
-
class
sct_dbtool.sanity.CheckFilesystemDB(db_path: str)[source]¶ This check will verify if all files in file system are present in the database.
-
class
sct_dbtool.sanity.CheckLabelVolumeConsistency(db_path: str)[source]¶ This check will verify if the label is consistent with the volume (shapes).
-
class
sct_dbtool.sanity.CheckLabelVolumePath(db_path: str)[source]¶ This check will verify if the label volume exists in the file system.
-
class
sct_dbtool.sanity.CheckMainVolumeNibabel(db_path: str)[source]¶ This check will verify if nibabel is able to open the main volume.
-
class
sct_dbtool.sanity.CheckMainVolumePath(db_path: str)[source]¶ This check will verify if the main volume exists in the file system.
-
class
sct_dbtool.sanity.Diagnostic(category: str, check_name: str, message: str, item: Dict)[source]¶ This is a data class to represent the diagnostics.
Parameters: - category – the diagnostic category (warning, error, info)
- check_name – the name of the check that generated the diagnostic.
- message – message generated by the check.
- item – the item related to the diagnostic.
-
class
sct_dbtool.sanity.SanityCheck(category: str, db_path: str)[source]¶ Extend this class to implement new sanity checks.
Parameters: - category – category of the check (warning, error or info).
- db_path – the path to the database.
-
add_diagnostic(msg: str, item: Dict)[source]¶ Add a new diagnostic message for the item.
Parameters: - msg – message with details about the diagnostic.
- item – item who generated the diagnostic.
-
check(item: Dict)[source]¶ Implement this function in the sub-classes to add the specific checks.
Parameters: item – each item of the database
sct_dbtool.setup – CLI setup entry-point¶
sct_dbtool.main – Main CLI entry-point¶
Naval Fate.
- Usage:
- sct_dbtool sanity <db_path> sct_dbtool setup sct_dbtool (-h | –help) sct_dbtool –version
- Options:
- -h –help Show this screen –version Show version