validate.core.analysis#

Create, read, or modify analysis.yaml, which contains the user configurations for an analysis.

analysis.yaml:

input:

start_from: dicom # dicom | nifti | nrrd | predictors data_dir: /data/cohort # null if start_from: predictors predictors_csv: null plan_structures_csv: null outcomes_csv: null

compute:

device: cpu # cpu | gpu

model:

name: Xerostomia (grade 2+) # ROE model name file: /path/to/Xerostomia (grade 2+).json # filled in automatically for built-in models

segment:

ai_models: [CT_HeadAndNeck_OARs] # AI models to run (cerr.ai_models names) install_dir: /models # required if ai_models is not empty

structures:

Parotids: {source: existing, name: Parotid_Total} Oral cavity: {source: derive}

Functions

analysisHash(path)

Return the SHA-256 of analysis.yaml's exact bytes, for run_log.yaml.

checkSettings(analysisDict)

Check analysis.yaml's contents.

readSettings(analysisDir)

Return the settings in analysisDir's analysis.yaml, or None if there are none yet.

saveSettings(analysisDict, analysisDir)

Write analysisDict to analysisDir's analysis.yaml, replacing any earlier settings.

tabSettings(analysisDict, tab)

The part of the settings a tab's results depend on (see TAB_SETTINGS).

toAnalysisDict(dataCapsule)

Returns the analysis-level fields of dataCapsule.

toDataCapsule(path)

Read and translate analysis.yaml into DataCapsule.

validate.core.analysis.checkSettings(analysisDict)[source]#

Check analysis.yaml’s contents.

validate.core.analysis.toAnalysisDict(dataCapsule)[source]#

Returns the analysis-level fields of dataCapsule.

validate.core.analysis.readSettings(analysisDir)[source]#

Return the settings in analysisDir’s analysis.yaml, or None if there are none yet.

validate.core.analysis.saveSettings(analysisDict, analysisDir)[source]#

Write analysisDict to analysisDir’s analysis.yaml, replacing any earlier settings.

Only called once the user has confirmed saving, and the settings have been checked.

Returns:

str – path to analysis.yaml.

validate.core.analysis.tabSettings(analysisDict, tab)[source]#

The part of the settings a tab’s results depend on (see TAB_SETTINGS).

Parameters:
  • analysisDict (dict) – the analysis settings.

  • tab (str) – “segment” or “model”.

Returns:

dict – {section: {key: value}} or {section: whole section}.

validate.core.analysis.toDataCapsule(path)[source]#

Read and translate analysis.yaml into DataCapsule.

validate.core.analysis.analysisHash(path)[source]#

Return the SHA-256 of analysis.yaml’s exact bytes, for run_log.yaml.