VideoIfdoReportGenerator
class VideoIfdoReportGenerator extends IfdoReportGenerator
Traits
Properties
Collection | $options | Options for this report. |
from ReportGenerator |
string | $name | Name of the report for use in text. |
|
string | $filename | Name of the report for use as (part of) a filename. |
|
string | $extension | File extension of the report file. |
from IfdoReportGenerator |
protected mixed | $source | Source this report belongs to (e.g. a volume). |
from ReportGenerator |
protected array | $tmpFiles | Temporary files that are created when generating a report. |
from ReportGenerator |
protected Collection | $labels | Labels that have been used in this volume. |
from IfdoReportGenerator |
protected AnnotationSession | $annotationSession | Cache for the annotation session the report may be restricted to. |
from VolumeReportGenerator |
protected PythonScriptRunner | $pythonScriptRunner | Object that runs the Python script to generate a report. |
from VolumeReportGenerator |
protected Collection | $users | Users that have been used in this volume. |
from IfdoReportGenerator |
protected array | $imageAnnotationLabels | All labels that should be contained in the iFDO. |
from IfdoReportGenerator |
protected array | $imageAnnotationCreators | All users that should be contained in the iFDO. |
from IfdoReportGenerator |
protected array | $imageSetItems | iFDO image-annotation arrays for each image of the volume. |
from IfdoReportGenerator |
protected LabelSource | $wormsLabelSource | Label source model for the WoRMS database. |
from IfdoReportGenerator |
Methods
Get the report generator for the given type.
Constructs a label name from the names of all parent labels and the label itself.
Get all labels that belong to the label tree of the given label.
Should this report separate the output files for different label trees?
Should this report separate the output files for different user?
Returns the array of label ids to which this report should be restricted.
Determines if this report is restricted to a subset of labels.
Set the Python script runner object.
Get all labels that are attached to the volume of this report (through project label trees).
Execute the external report parsing Python script.
Should this report be restricted an annotation session?
Returns the annotation session this report should be restricted to.
Get the name of the annotation session if it exists.
Determines if this report should take only the newest label of each annotation.
Callback to be used in a when
query statement that restricts the results to a specific subset of annotation labels.
Assemble a new DB query for the volume of this report.
Get all users who annotated in the volume.
Get all labels that were used in the volume.
Create the image-set-item entry for a video.
Determine if an iFDO item is a single object or an array of objects.
Merge an image-set-items item of the original iFDO with the item generated by this report.
Callback to be used in a when
query statement that restricts the results to the
newest annotation labels of each annotation.
Details
in
ReportGenerator at line 75
static ReportGenerator
get(string $sourceClass, ReportType $type, array $options = [])
Get the report generator for the given type.
in
VolumeReportGenerator at line 31
__construct(array $options = [])
Create a report generator instance.
in
ReportGenerator at line 116
string
generate(mixed $source)
Generate the report.
in
IfdoReportGenerator at line 75
generateReport(string $path)
Generate the report.
in
ReportGenerator at line 163
setSource(mixed $source)
Set the source.
in
ReportGenerator at line 173
string
getName()
Get the report name.
in
ReportGenerator at line 183
string
getFilename()
Get the report filename.
in
ReportGenerator at line 193
string
getFullFilename()
Get the filename with extension.
in
VolumeReportGenerator at line 55
string
expandLabelName(int $id)
Constructs a label name from the names of all parent labels and the label itself.
Example: Animalia > Annelida > Polychaeta > Buskiella sp
in
ReportGenerator at line 237
protected Collection
getSiblingLabels(int $id)
Get all labels that belong to the label tree of the given label.
in
ReportGenerator at line 253
protected bool
shouldSeparateLabelTrees()
Should this report separate the output files for different label trees?
in
ReportGenerator at line 263
protected bool
shouldSeparateUsers()
Should this report separate the output files for different user?
in
ReportGenerator at line 273
protected array
getOnlyLabels()
Returns the array of label ids to which this report should be restricted.
in
ReportGenerator at line 283
protected bool
isRestrictedToLabels()
Determines if this report is restricted to a subset of labels.
in
VolumeReportGenerator at line 42
setPythonScriptRunner(mixed $runner)
Set the Python script runner object.
in
VolumeReportGenerator at line 71
protected Collection
getVolumeLabels()
Get all labels that are attached to the volume of this report (through project label trees).
in
VolumeReportGenerator at line 93
protected
executeScript(string $scriptName, string $path)
Execute the external report parsing Python script.
in
VolumeReportGenerator at line 103
protected bool
isRestrictedToAnnotationSession()
Should this report be restricted an annotation session?
in
VolumeReportGenerator at line 113
protected AnnotationSession|null
getAnnotationSession()
Returns the annotation session this report should be restricted to.
in
VolumeReportGenerator at line 127
protected string
getAnnotationSessionName()
Get the name of the annotation session if it exists.
in
VolumeReportGenerator at line 139
protected bool
isRestrictedToNewestLabel()
Determines if this report should take only the newest label of each annotation.
in
VolumeReportGenerator at line 151
protected Builder
restrictToLabelsQuery(Builder $query, string $table)
Callback to be used in a when
query statement that restricts the results to a specific subset of annotation labels.
at line 36
protected Builder
query()
Assemble a new DB query for the volume of this report.
at line 71
protected Collection
getUsers()
Get all users who annotated in the volume.
at line 94
protected Collection
getLabels()
Get all labels that were used in the volume.
in
IfdoReportGenerator at line 182
protected bool
hasIfdo(Volume $source)
Determine if the volume has a iFDO metadata file.
at line 118
processFile(Video $video)
Create the image-set-item entry for a video.
in
IfdoReportGenerator at line 198
protected Ifdo|null
getIfdo(Volume $source)
Get the iFDO object of the volume if it has any.
in
IfdoReportGenerator at line 220
protected
writeIfdo(array $content, string $path)
Write the report JSON file.
in
IfdoReportGenerator at line 232
protected bool
shouldConvertWormsId(Label $label)
Determine if the label ID should be converted to a WoRMS URN.
in
IfdoReportGenerator at line 244
protected string
getWormsUrn(Label $label)
Get the WoRMS URN for a label (if it has one).
in
IfdoReportGenerator at line 257
protected bool
isArrayItem(array $item)
Determine if an iFDO item is a single object or an array of objects.
Both are allowed for images. Only the latter should be the case for videos.
in
IfdoReportGenerator at line 272
protected
mergeImageSetItem(string $key, array $ifdoItems)
Merge an image-set-items item of the original iFDO with the item generated by this report.
in
IfdoReportGenerator at line 305
protected string
getGeometryName(Annotation $annotation)
Get an iFDO geometry name string for an annotation.
in
RestrictsToNewestLabels at line 18
Builder
restrictToNewestLabelQuery(Builder $query, string $table)
Callback to be used in a when
query statement that restricts the results to the
newest annotation labels of each annotation.