class PrepareExistingAnnotations extends PrepareAnnotationsJob

Traits

SerializesModels
Queueable
Dispatchable

Properties

protected MaiaJob $job

The job to use existing annotations for.

from  PrepareAnnotationsJob
protected bool $deleteWhenMissingModels

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

from  PrepareAnnotationsJob
protected bool $selectTrainingProposals

Set newly converted training proposals as selected.

from  PrepareAnnotationsJob

Methods

Builder
getExistingAnnotationsQuery(int $volumeId, array $restrictLabels = [])

Get the query for the annotations to convert.

__construct(MaiaJob $job)

Create a new isntance.

Builder
getAnnotationsQuery()

Get the query for the annotations to convert.

bool
hasAnnotations()

Determine if there are any annotations to convert.

convertAnnotations()

Convert all matching annotations to training proposals.

convertAnnotationChunk(Collection $chunk)

Convert a chunk of annotations to training proposals.

string
convertAnnotationPointsToCircle(ImageAnnotation $annotation)

Convert the points of an annotation to the points of a circle.

array
convertPolygonToCirlce(array $points)

Determine the points of a circle from the points of a polygon.

void
handle()

Execute the job.

Details

protected Builder getExistingAnnotationsQuery(int $volumeId, array $restrictLabels = [])

Get the query for the annotations to convert.

Parameters

int $volumeId
array $restrictLabels

Return Value

Builder

__construct(MaiaJob $job)

Create a new isntance.

Parameters

MaiaJob $job

at line 50
protected Builder getAnnotationsQuery()

Get the query for the annotations to convert.

Return Value

Builder

protected bool hasAnnotations()

Determine if there are any annotations to convert.

Return Value

bool

protected convertAnnotations()

Convert all matching annotations to training proposals.

convertAnnotationChunk(Collection $chunk)

Convert a chunk of annotations to training proposals.

Must be public to be used as callable.

Parameters

Collection $chunk

protected string convertAnnotationPointsToCircle(ImageAnnotation $annotation)

Convert the points of an annotation to the points of a circle.

Parameters

ImageAnnotation $annotation

Return Value

string

JSON encoded points array.

protected array convertPolygonToCirlce(array $points)

Determine the points of a circle from the points of a polygon.

Parameters

array $points

Return Value

array

at line 18
void handle()

Execute the job.

Return Value

void