dacapo.experiments.tasks.post_processors.threshold_post_processor
Classes
A post-processor that applies a threshold to the prediction. |
Module Contents
- class dacapo.experiments.tasks.post_processors.threshold_post_processor.ThresholdPostProcessor
A post-processor that applies a threshold to the prediction.
- prediction_array_identifier
The identifier of the prediction array.
- prediction_array
The prediction array.
- enumerate_parameters()
Enumerate all possible parameters of this post-processor.
- set_prediction()
Set the prediction array.
- process()
Process the prediction with the given parameters.
Note
This post-processor applies a threshold to the prediction. The threshold is used to define the segmentation. The prediction array is set using the set_prediction method.
- enumerate_parameters() Iterable[dacapo.experiments.tasks.post_processors.threshold_post_processor_parameters.ThresholdPostProcessorParameters]
Enumerate all possible parameters of this post-processor.
- Returns:
A generator of parameters.
- Return type:
Generator[ThresholdPostProcessorParameters]
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> for parameters in post_processor.enumerate_parameters(): ... print(parameters)
Note
This method should return a generator of instances of
ThresholdPostProcessorParameters.
- set_prediction(prediction_array_identifier)
Set the prediction array.
- Parameters:
prediction_array_identifier (LocalArrayIdentifier) – The identifier of the prediction array.
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> post_processor.set_prediction(prediction_array_identifier)
Note
This method should set the prediction array using the given identifier.
- process(parameters: dacapo.experiments.tasks.post_processors.threshold_post_processor_parameters.ThresholdPostProcessorParameters, output_array_identifier: dacapo.store.array_store.LocalArrayIdentifier, num_workers: int = 12, block_size: daisy.Coordinate = Coordinate((256, 256, 256))) dacapo.experiments.datasplits.datasets.arrays.zarr_array.ZarrArray
Process the prediction with the given parameters.
- Parameters:
parameters (ThresholdPostProcessorParameters) – The parameters to use for processing.
output_array_identifier (LocalArrayIdentifier) – The identifier of the output array.
num_workers (int) – The number of workers to use for processing.
block_size (Coordinate) – The block size to use for processing.
- Returns:
The output array.
- Return type:
- Raises:
NotImplementedError – If the method is not implemented.
Examples
>>> post_processor.process(parameters, output_array_identifier)
Note
This method should process the prediction with the given parameters and return the output array. The method uses the run_blockwise function from the dacapo.blockwise.scheduler module to run the blockwise post-processing. The output array is created using the ZarrArray.create_from_array_identifier function from the dacapo.experiments.datasplits.datasets.arrays module.