abstract class DetectionJob implements ShouldQueue

Traits

Queueable

Properties

protected bool $deleteWhenMissingModels

Ignore this job if the MAIA job does not exist any more.

protected string $tmpDir

Temporary directory for files of this job.

Methods

__construct(MaiaJob $job)

Create a new instance

void
failed(Exception $exception)

The job failed to process.

array
getGenericImages()

Create GenericImage instances for the images of this job.

cleanup()

Clean up temporary data produced by this job.

dispatchFailure(Exception $e)

Dispatch the job to notify the BIIGLE instance of a failure.

createTmpDir()

Create the temporary directory for this request.

ensureDirectory(string $path)

Creates the specified directory if it does not exist.

string
getTmpDirPath()

Get the path to the temporary directory.

string
python(string $command, string $log = 'log.txt')

Execute a Python command and return the path to a file containing the output.

array
parseAnnotations(array $images)

Parse the output JSON files to get the array of annotations for each image.

array
parseAnnotationsFile(GenericImage $image)

Parse the output JSON file of a single image.

createMaiaAnnotations(array $annotations)

Create MAIA annotations from the training proposals.

array
createMaiaAnnotation(array $annotation)

Create an insert array for a MAIA annotation.

insertAnnotationChunk(array $chunk)

Insert one chunk of the MAIA annotations that should be created into the database.

updateJobState()

Update the state of the MAIA job after processing the response.

Details

at line 37
__construct(MaiaJob $job)

Create a new instance

Parameters

MaiaJob $job

at line 49
void failed(Exception $exception)

The job failed to process.

Parameters

Exception $exception

Return Value

void

at line 61
protected array getGenericImages()

Create GenericImage instances for the images of this job.

Return Value

array

at line 77
protected cleanup()

Clean up temporary data produced by this job.

at line 87
abstract protected dispatchFailure(Exception $e)

Dispatch the job to notify the BIIGLE instance of a failure.

Parameters

Exception $e

at line 92
protected createTmpDir()

Create the temporary directory for this request.

at line 107
protected ensureDirectory(string $path)

Creates the specified directory if it does not exist.

Parameters

string $path

at line 119
protected string getTmpDirPath()

Get the path to the temporary directory.

Return Value

string

at line 133
protected string python(string $command, string $log = 'log.txt')

Execute a Python command and return the path to a file containing the output.

Parameters

string $command
string $log

Name of the log file to write any output to.

Return Value

string

Exceptions

Exception

at line 157
protected array parseAnnotations(array $images)

Parse the output JSON files to get the array of annotations for each image.

Parameters

array $images

GenericImage instances.

Return Value

array

at line 189
protected array parseAnnotationsFile(GenericImage $image)

Parse the output JSON file of a single image.

Parameters

GenericImage $image

Return Value

array

at line 214
protected createMaiaAnnotations(array $annotations)

Create MAIA annotations from the training proposals.

Parameters

array $annotations

at line 236
protected array createMaiaAnnotation(array $annotation)

Create an insert array for a MAIA annotation.

Parameters

array $annotation

Return Value

array

at line 256
abstract protected insertAnnotationChunk(array $chunk)

Insert one chunk of the MAIA annotations that should be created into the database.

Parameters

array $chunk

at line 261
abstract protected updateJobState()

Update the state of the MAIA job after processing the response.