niftynet.evaluation.base_evaluations module

This module defines basic interfaces for NiftyNet evaluations

class BaseEvaluation(reader, app_param, eval_param)[source]

Bases: niftynet.layer.base_layer.Layer

Minimal interface for a NiftyNet evaluation


Returns aggregations to compute for the metric. Each aggregation is a callable that computes a list of DataFrames from a dictionary of metric dataframes (index by the DataFrame index). See BaseEvaluator.ScalarAggregator for an example.

Returns:list of aggregation callables
layer_op(subject_id, data)[source]

Perform one evaluation calculation for one subject :param subject_id: subject identifier string :param data: a data dictionary as built by ImageReader :return: a list of pandas.DataFrame objects

class CachedSubanalysisEvaluation(reader, app_param, eval_param)[source]

Bases: niftynet.evaluation.base_evaluations.BaseEvaluation

Interface for NiftyNet evaluations used with CachedSubanalysisEvaluator so that evaluations are run in a way that is friendly for caching intermediate computations. Each evaluation defines sub-analyses to run, and all subanalysis are run at the same time then the cache is cleared

subanalyses(subject_id, data)[source]

This function defines the sub-analyses to run. All evaluations with matching sub-analyses will be run in sequence, before clearing the cache :param subject_id: subject identifier string :param data: a data dictionary as built by ImageReader :return: list of dictionaries, each containing information specifyng the analysis to run. Elements will be passed to layer_op one at a time in a cache friendly order

layer_op(subject_id, data, subanalysis)[source]

Performs one sub-analysis

  • subject_id – subject identifier string
  • data – a data dictionary as built by ImageReader
  • subanalysis – dictionary containing information specifying the

analysis to run :return: a list of pandas.DataFrame objects