Class LoadImageConfiguration

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    LoadImageConfiguration

    @JsonObject("LoadImageConfiguration")
    public class LoadImageConfiguration
    extends java.lang.Object
    implements java.io.Serializable
    A DTO for transmitting information about how the images should be loaded. The parameters that can be controlled include image size, format (PNG or original), and the application of image transformations stored in openBIS.

    The default configuration is to retrieve images in their original size and format (i.e., not converted to PNG), without the openBIS image transformation applied.

    Providing a non-null desired size will instruct the image loader to return images that maintain the aspect ratio of the original and fit in the desired size.

    See Also:
    Serialized Form
    • Constructor Detail

      • LoadImageConfiguration

        public LoadImageConfiguration()
    • Method Detail

      • getDesiredImageSize

        public ImageSize getDesiredImageSize()
        The desired size of the image. Null if the original size is requested.

        The actual size of the returned image will have the same aspect ratio as the original, and thus might not be exactly the same as the desired size, but will fit in the desired size.

        Returns:
        The desired size of the image or null if the original size is to be returned.
      • setDesiredImageSize

        public void setDesiredImageSize​(ImageSize desiredImageSizeOrNull)
        Set the desired size of the image.

        The actual size of the returned image will have the same aspect ratio as the original, and thus might not be exactly the same as the desired size, but will fit in the desired size.

        Parameters:
        desiredImageSizeOrNull - Pass in the desired size or null if you want the image to have its original size.
      • isDesiredImageFormatPng

        public boolean isDesiredImageFormatPng()
        Should the image be converted from its original format to PNG?
        Returns:
        True if the image should be converted to PNG; false if it should be left in its original format.
      • setDesiredImageFormatPng

        public void setDesiredImageFormatPng​(boolean desiredImageFormatPng)
        Set whether the image should be converted from its original format to PNG.
        Parameters:
        desiredImageFormatPng - Pass in true if the image should be converted to PNG; false if it should be left in its original format.
      • isOpenBisImageTransformationApplied

        public boolean isOpenBisImageTransformationApplied()
        Should the image transformation stored in openBIS for a channel or merged channel be applied to the image?
        Returns:
        True if the image transformation should be applied; false if the original image should be returned.
      • setOpenBisImageTransformationApplied

        public void setOpenBisImageTransformationApplied​(boolean openBisImageTransformationApplied)
        Set whether the image transformation stored in openBIS for a channel or merged channel should be applied.
        Parameters:
        openBisImageTransformationApplied - Pass in true if the transformation should be applied; false otherwise.
      • getSingleChannelImageTransformationCode

        public java.lang.String getSingleChannelImageTransformationCode()
        Code of the transformation, which should be applied to the image. Can return null.
      • setSingleChannelImageTransformationCode

        public void setSingleChannelImageTransformationCode​(java.lang.String transformationCodeOrNull)
        Sets the code of the transformation, which should be applied to the image. This parameter will be ignored if isOpenBisImageTransformationApplied() is false. To keep backward compatibility if isOpenBisImageTransformationApplied() is true and no image transformation code is specified, then the transformation defined by the Color Adjustment tool will be applied.

        Transformation has to be assigned (usually during dataset registration) to the channel which will be fetched. Note that such transformations can be channel-specific. If merged channels image will be requested or the transformation does not exist then untransformed image will be returned.

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object