class Volume extends Volume

Extends the base Biigle volume.

Traits

Constants

IMAGE_FILE_REGEX

Regular expression that matches the supported image file extensions.

This regex allows optional HTTP query parameters after the file names, too. Example "image.jpg?raw=1". This may be required for remote images with services like Dropbox.

VIDEO_FILE_REGEX

Regular expression that matches the supported video file extensions.

This regex allows optional HTTP query parameters after the file names, too. Example "video.mp4?raw=1". This may be required for remote files with services like Dropbox.

MIN_DELPHI_IMAGES

Minimum number of manually annotated images required for Delphi laser point detection.

Properties

protected array<int,string> $fillable

The attributes that are mass assignable.

from  Volume
protected array<int,string> $hidden

The attributes hidden from the model's JSON form.

from  Volume
protected array<string,string> $casts

The attributes that should be casted to native types.

from  Volume

Methods

setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

mixed
getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

string
getMetadataFileDisk()

Get the name of the disk to store metadata files.

bool
hasMetadata()

No description

void
saveMetadata(UploadedFile $file)

No description

VolumeMetadata|null
getMetadata()

No description

void
deleteMetadata(bool $noUpdate = false)

No description

static array
parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

from  Volume
Builder
scopeAccessibleBy(Builder $query, User $user)

Scope a query to all volumes that are accessible by a user.

from  Volume
User,$this>
creator()

The user that created the volume.

from  Volume
MediaType,$this>
mediaType()

The media type of this volume.

from  Volume
Image,$this>
images()

The images belonging to this volume.

from  Volume
Video,$this>
videos()

The videos belonging to this volume.

from  Volume
files()

The images or videos belonging to this volume.

from  Volume
orderedImages() deprecated

The images belonging to this volume ordered by filename (ascending).

from  Volume
orderedFiles()

The images belonging to this volume ordered by filename (ascending).

from  Volume
Builder
users()

Return a query for all users associated to this volume through projects.

from  Volume
Project,$this>
projects()

The project(s), this volume belongs to.

from  Volume
AnnotationSession,$this>
annotationSessions()

The annotation sessions of this volume.

from  Volume
AnnotationSession,$this>
activeAnnotationSession()

The active annotation sessions of this volume (if any).

from  Volume
getActiveAnnotationSession(User $user)

Returns the active annotation session of this volume for the given user.

from  Volume
bool
hasConflictingAnnotationSession(AnnotationSession $session)

Check if the given annotation session is in conflict with existing ones.

from  Volume
bool
isRemote()

Check if the images of this volume come from a remote URL.

from  Volume
Image|null
getThumbnailAttribute()

An image that can be used as unique thumbnail for this volume.

from  Volume
string|null
getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

from  Volume
Collection
getThumbnailsAttribute()

Several images or videos that can be used for the preview thumbnail of a volume.

from  Volume
Collection
getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

from  Volume
flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

from  Volume
bool
hasGeoInfo()

Check if the volume has some images with GPS coordinates.

from  Volume
flushGeoInfoCache()

Flush the cached information if this volume has images with GPS coordinates.

from  Volume
setUrlAttribute(string $value)

Set the url attribute of this volume.

from  Volume
setCreatingAsyncAttribute(bool $value)

Set the creating_async attribute of this volume.

from  Volume
bool
getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

from  Volume
bool
hasTiledImages()

Check if the there are tiled images in this volume.

from  Volume
bool
isImageVolume()

Specifies whether the volume is an image volume.

from  Volume
bool
isVideoVolume()

Specifies whether the volume is a video volume.

from  Volume
string
getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

from  Volume
string
getGeoInfoCacheKey()

Get the cache key for volume geo info.

from  Volume
Filtered
filterInvalidLaserPoints(Collection $annotations)

Removes items from the annotations array if the laser point annotations are invalid.

static Volume
convert(Volume $volume)

Converts a regular Biigle volume to a Laserpoints volume.

readyForDelphiDetection(Label $label)

Determines if the images of this volume can be processed with Delphi.

bool
hasDetectedLaserpoints()

Determines whether there are images with automatically detected laser points in this volume.

Details

in HasJsonAttributes at line 16
protected setJsonAttr(string $key, mixed $value, string $attrs = 'attrs')

Set a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $value

Value of the attribute in the JSON.

string $attrs

Name of the JSON column of the model.

in HasJsonAttributes at line 38
protected mixed getJsonAttr(string $key, mixed $default = null, string $attrs = 'attrs')

Get a dynamic JSON attribute.

Parameters

string $key

Key of the attribute in the JSON.

mixed $default

Default value.

string $attrs

Name of the JSON column of the model.

Return Value

mixed

in HasMetadataFile at line 18
abstract string getMetadataFileDisk()

Get the name of the disk to store metadata files.

Return Value

string

in HasMetadataFile at line 20
bool hasMetadata()

No description

Return Value

bool

in HasMetadataFile at line 25
void saveMetadata(UploadedFile $file)

No description

Parameters

UploadedFile $file

Return Value

void

in HasMetadataFile at line 35
VolumeMetadata|null getMetadata()

No description

Return Value

VolumeMetadata|null

in HasMetadataFile at line 67
void deleteMetadata(bool $noUpdate = false)

No description

Parameters

bool $noUpdate

Do not set metadata_file_path to null.

Return Value

void

in Volume at line 83
static array parseFilesQueryString(string $string)

Parses a comma separated list of filenames to an array.

Parameters

string $string

Return Value

array

in Volume at line 97
Builder scopeAccessibleBy(Builder $query, User $user)

Scope a query to all volumes that are accessible by a user.

Parameters

Builder $query
User $user

Return Value

Builder

in Volume at line 117
User,$this> creator()

The user that created the volume.

Return Value

User,$this>

in Volume at line 127
MediaType,$this> mediaType()

The media type of this volume.

Return Value

MediaType,$this>

in Volume at line 137
Image,$this> images()

The images belonging to this volume.

Return Value

Image,$this>

in Volume at line 147
Video,$this> videos()

The videos belonging to this volume.

Return Value

Video,$this>

in Volume at line 157
files()

The images or videos belonging to this volume.

in Volume at line 172
orderedImages() deprecated

deprecated Use `orderedFiles` instead.

The images belonging to this volume ordered by filename (ascending).

in Volume at line 182
orderedFiles()

The images belonging to this volume ordered by filename (ascending).

in Volume at line 192
Builder users()

Return a query for all users associated to this volume through projects.

Return Value

Builder

in Volume at line 211
Project,$this> projects()

The project(s), this volume belongs to.

Return Value

Project,$this>

in Volume at line 221
AnnotationSession,$this> annotationSessions()

The annotation sessions of this volume.

Return Value

AnnotationSession,$this>

in Volume at line 231
AnnotationSession,$this> activeAnnotationSession()

The active annotation sessions of this volume (if any).

Return Value

AnnotationSession,$this>

in Volume at line 251
AnnotationSession|null getActiveAnnotationSession(User $user)

Returns the active annotation session of this volume for the given user.

An annotation session may be active for a volume but it is only also active for a user, if the user belongs to the set of restricted users of the annotation session.

Parameters

User $user

Return Value

AnnotationSession|null

in Volume at line 271
bool hasConflictingAnnotationSession(AnnotationSession $session)

Check if the given annotation session is in conflict with existing ones.

A conflict exists if the active time period of two sessions overlaps.

Parameters

AnnotationSession $session

The annotation session to check

Return Value

bool

in Volume at line 298
bool isRemote()

Check if the images of this volume come from a remote URL.

Return Value

bool

in Volume at line 308
Image|null getThumbnailAttribute()

An image that can be used as unique thumbnail for this volume.

Return Value

Image|null

in Volume at line 320
string|null getThumbnailUrlAttribute()

URL to the thumbnail image of this volume.

Return Value

string|null

in Volume at line 330
Collection getThumbnailsAttribute()

Several images or videos that can be used for the preview thumbnail of a volume.

Return Value

Collection

in Volume at line 354
Collection getThumbnailsUrlAttribute()

URLs to the thumbnail images of this volume.

Return Value

Collection

in Volume at line 362
flushThumbnailCache()

Flush the cache that stores the volume thumbnail.

in Volume at line 372
bool hasGeoInfo()

Check if the volume has some images with GPS coordinates.

Return Value

bool

in Volume at line 380
flushGeoInfoCache()

Flush the cached information if this volume has images with GPS coordinates.

in Volume at line 393
setUrlAttribute(string $value)

Set the url attribute of this volume.

Parameters

string $value

in Volume at line 408
setCreatingAsyncAttribute(bool $value)

Set the creating_async attribute of this volume.

Parameters

bool $value

in Volume at line 420
bool getCreatingAsyncAttribute()

Get the creating_async attribute of this volume.

Return Value

bool

in Volume at line 430
bool hasTiledImages()

Check if the there are tiled images in this volume.

Return Value

bool

in Volume at line 441
bool isImageVolume()

Specifies whether the volume is an image volume.

Return Value

bool

in Volume at line 451
bool isVideoVolume()

Specifies whether the volume is a video volume.

Return Value

bool

in Volume at line 469
protected string getThumbnailsCacheKey()

Get the cache key for volume thumbnails.

Return Value

string

in Volume at line 479
protected string getGeoInfoCacheKey()

Get the cache key for volume geo info.

Return Value

string

Filtered filterInvalidLaserPoints(Collection $annotations)

Removes items from the annotations array if the laser point annotations are invalid.

Parameters

Collection $annotations

Annotations grouped by image

Return Value

Filtered

points array

at line 34
static Volume convert(Volume $volume)

Converts a regular Biigle volume to a Laserpoints volume.

Parameters

Volume $volume

Regular Biigle volume instance

Return Value

Volume

at line 50
readyForDelphiDetection(Label $label)

Determines if the images of this volume can be processed with Delphi.

Parameters

Label $label

The laser point label.

Exceptions

Exception

at line 91
bool hasDetectedLaserpoints()

Determines whether there are images with automatically detected laser points in this volume.

Return Value

bool