girder_large_image package

Subpackages

Submodules

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_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.

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.

Returns

a string hash value.

getState()[source]

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

Returns

a string hash value of the source state.

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

Get a Girder tilesource using the known sources.

Parameters
  • 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.

Returns

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.

Parameters
  • item – a Girder item.

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

Returns

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

girder_large_image.girder_tilesource.loadGirderTileSources()[source]

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.

Parameters
  • 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.

Returns

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.

load(info)[source]
girder_large_image.checkForLargeImageFiles(event)[source]
girder_large_image.handleCopyItem(event)[source]

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

girder_large_image.handleFinalizeUploadBefore(event)[source]

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

girder_large_image.handleRemoveFile(event)[source]

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

girder_large_image.prepareCopyItem(event)[source]

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

girder_large_image.removeThumbnails(event)[source]
girder_large_image.unbindGirderEventsByHandlerName(handlerName)[source]
girder_large_image.validateBoolean(doc)[source]
girder_large_image.validateBooleanOrAll(doc)[source]
girder_large_image.validateDefaultViewer(doc)[source]
girder_large_image.validateDictOrJSON(doc)[source]
girder_large_image.validateFolder(doc)[source]
girder_large_image.validateNonnegativeInteger(doc)[source]