niftynet.contrib.csv_reader.multitask_classifseg_application module

This module defines an image-level classification application that maps from images to scalar, multi-class labels.

This class is instantiated and initalized by the application_driver.

class MultiClassifSegApplication(net_param, action_param, action)[source]

Bases: niftynet.application.base_application.BaseApplication

This class defines an application for image-level classification problems mapping from images to scalar labels.

This is the application class to be instantiated by the driver and referred to in configuration files.

Although structurally similar to segmentation, this application supports different samplers/aggregators (because patch-based processing is not appropriate), and monitoring metrics.

REQUIRED_CONFIG_SECTION = 'SEGMENTATION'
initialise_dataset_loader(data_param=None, task_param=None, data_partitioner=None)[source]

Initialise the data loader both csv readers and image readers and specify preprocessing layers :param data_param: :param task_param: :param data_partitioner: :return:

initialise_uniform_sampler()[source]

Create the uniform sampler using information from readers :return:

initialise_weighted_sampler()[source]

Create the weighted sampler using the info from the csv_readers and image_readers and the configuration parameters :return:

initialise_resize_sampler()[source]

Define the resize sampler using the information from the configuration parameters, csv_readers and image_readers :return:

initialise_grid_sampler()[source]

Define the grid sampler based on the information from configuration and the csv_readers and image_readers specifications :return:

initialise_balanced_sampler()[source]

Define the balanced sampler based on the information from configuration and the csv_readers and image_readers specifications :return:

initialise_grid_aggregator()[source]

Define the grid aggregator used for decoding using configuration parameters :return:

initialise_resize_aggregator()[source]

Define the resize aggregator used for decoding using the configuration parameters :return:

initialise_sampler()[source]

Specifies the sampler used among those previously defined based on the sampling choice :return:

initialise_aggregator()[source]

Specifies the aggregator used based on the sampling choice :return:

initialise_network()[source]

Initialise the network and specifies the ordering of elements :return:

add_confusion_matrix_summaries_(outputs_collector, net_out, data_dict)[source]

This method defines several monitoring metrics that are derived from the confusion matrix

connect_data_and_network(outputs_collector=None, gradients_collector=None)[source]

Adding sampler output tensor and network tensors to the graph.

Parameters:
  • outputs_collector
  • gradients_collector
Returns:

interpret_output(batch_output)[source]

Specifies how the output should be decoded :param batch_output: :return:

initialise_evaluator(eval_param)[source]

Define the evaluator :param eval_param: :return:

add_inferred_output(data_param, task_param)[source]

Define how to treat added inferred output :param data_param: :param task_param: :return: