girder_large_image package



girder_large_image.constants module

class girder_large_image.constants.PluginSettings[source]

Bases: object

LARGE_IMAGE_AUTO_SET = 'large_image.auto_set'
LARGE_IMAGE_AUTO_USE_ALL_FILES = 'large_image.auto_use_all_files'
LARGE_IMAGE_CONFIG_FOLDER = 'large_image.config_folder'
LARGE_IMAGE_DEFAULT_VIEWER = 'large_image.default_viewer'
LARGE_IMAGE_ICC_CORRECTION = 'large_image.icc_correction'
LARGE_IMAGE_MAX_SMALL_IMAGE_SIZE = 'large_image.max_small_image_size'
LARGE_IMAGE_MAX_THUMBNAIL_FILES = 'large_image.max_thumbnail_files'
LARGE_IMAGE_NOTIFICATION_STREAM_FALLBACK = 'large_image.notification_stream_fallback'
LARGE_IMAGE_SHOW_EXTRA = 'large_image.show_extra'
LARGE_IMAGE_SHOW_EXTRA_ADMIN = 'large_image.show_extra_admin'
LARGE_IMAGE_SHOW_EXTRA_PUBLIC = 'large_image.show_extra_public'
LARGE_IMAGE_SHOW_ITEM_EXTRA = 'large_image.show_item_extra'
LARGE_IMAGE_SHOW_ITEM_EXTRA_ADMIN = 'large_image.show_item_extra_admin'
LARGE_IMAGE_SHOW_ITEM_EXTRA_PUBLIC = 'large_image.show_item_extra_public'
LARGE_IMAGE_SHOW_THUMBNAILS = 'large_image.show_thumbnails'
LARGE_IMAGE_SHOW_VIEWER = 'large_image.show_viewer'

girder_large_image.girder_tilesource module

class girder_large_image.girder_tilesource.GirderTileSource(item, *args, **kwargs)[source]

Bases: FileTileSource

Initialize the tile class. See the base class for other available parameters.


item – a Girder item document which contains [‘largeImage’][‘fileId’] identifying the Girder file to be used for the tile source.

extensionsWithAdjacentFiles = {}
static getLRUHash(*args, **kwargs)[source]

Return a string hash used as a key in the recently-used cache for tile sources.


a string hash value.


Return a string reflecting the state of the tile source. This is used as part of a cache key when hashing function return values.


a string hash value of the source state.

girderSource = True
mimeTypesWithAdjacentFiles = {}
girder_large_image.girder_tilesource.getGirderTileSource(item, file=None, *args, **kwargs)[source]

Get a Girder tilesource using the known sources.

  • item – a Girder item or an item id.

  • file – if specified, the Girder file object to use as the large image file; used here only to check extensions.


A girder tilesource for the item.

girder_large_image.girder_tilesource.getGirderTileSourceName(item, file=None, *args, **kwargs)[source]

Get a Girder tilesource name using the known sources. If tile sources have not yet been loaded, load them.

  • item – a Girder item.

  • file – if specified, the Girder file object to use as the large image file; used here only to check extensions.


The name of a tilesource that can read the Girder item.


Load all Girder tilesources from entrypoints and add them to the AvailableGiderTileSources dictionary.

girder_large_image.loadmodelcache module

girder_large_image.loadmodelcache.invalidateLoadModelCache(*args, **kwargs)[source]

Empty the LoadModelCache.

girder_large_image.loadmodelcache.loadModel(resource, model, plugin='_core', id=None, allowCookie=False, level=None)[source]

Load a model based on id using the current cherrypy token parameter for authentication, caching the results. This must be called in a cherrypy context.

  • resource – the resource class instance calling the function. Used for access to the current user and model importer.

  • model – the model name, e.g., ‘item’.

  • plugin – the plugin name when loading a plugin model.

  • id – a string id of the model to load.

  • allowCookie – true if the cookie authentication method is allowed.

  • level – access level desired.


the loaded model.

Module contents

class girder_large_image.LargeImagePlugin(entrypoint)[source]

Bases: GirderPlugin

CLIENT_SOURCE_PATH = 'web_client'

The path of the plugin’s web client source code. This path is given relative to the python package. This property is used to link the web client source into the staging area while building in development mode. When this value is None it indicates there is no web client component.

DISPLAY_NAME = 'Large Image'

This is the named displayed to users on the plugin page. Unlike the entrypoint name used internally, this name can be an arbitrary string.

girder_large_image.adjustConfigForUser(config, user)[source]

Given the current user, adjust the config so that only relevant and combined values are used. If the root of the config dictionary contains “access”: {“user”: <dict>, “admin”: <dict>}, the base values are updated based on the user’s access level. If the root of the config contains “group”: {<group-name>: <dict>, …}, the base values are updated for every group the user is a part of.

The order of update is groups in C-sort alphabetical order followed by access/user and then access/admin as they apply.


config – a config dictionary.


When copying an item, finish adjusting the largeImage fileId reference to the copied file.


When a file is first saved, mark its mime type based on its extension if we would otherwise just mark it as generic application/octet-stream.


When a file is removed, check if it is a largeImage fileId. If so, delete the largeImage record.


When certain settings are changed, clear the caches.

girder_large_image.metadataSearchHandler(query, types, user=None, level=None, limit=0, offset=0, models=None, searchModels=None, metakey='meta')[source]

Provide a substring search on metadata.


When copying an item, adjust the largeImage fileId reference so it can be matched to the to-be-copied file.

girder_large_image.yamlConfigFile(folder, name, user)[source]

Get a resolved named config file based on a folder and user.

  • folder – a Girder folder model.

  • name – the name of the config file.

  • user – the user that the response if adjusted for.


either None if no config file, or a yaml record.

girder_large_image.yamlConfigFileWrite(folder, name, user, yaml_config)[source]

If the user has appropriate permissions, create or modify an item in the specified folder with the specified name, storing the config value as a file.

  • folder – a Girder folder model.

  • name – the name of the config file.

  • user – the user that the response if adjusted for.

  • yaml_config – a yaml config string.