Class ImageTransformationBuffer
- java.lang.Object
-
- ch.systemsx.cisd.openbis.dss.etl.dto.api.transformations.ImageTransformationBuffer
-
- Direct Known Subclasses:
ImageTransformationBuffer
public class ImageTransformationBuffer extends java.lang.Object
Utility class to construct various kinds of image transformations.
-
-
Constructor Summary
Constructors Constructor Description ImageTransformationBuffer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImageTransformation
append(ImageTransformation transformation)
Appends a single transformation and returns it.void
appendAll(ImageTransformation... transformations)
Appends any specified transformations.ImageTransformation[]
appendAllBitShiftsFor12BitGrayscale()
Appends transformations which extracts a range of grayscale image colors by choosing 8 consecutive bits.ImageTransformation[]
appendAllBitShiftsFor16BitGrayscale()
Appends transformations which extracts a range of grayscale image colors by choosing 8 consecutive bits.ImageTransformation
appendAutoRescaleGrayscaleIntensity(float threshold)
Appends transformation which converts each single grayscale image to 8 bit color depth and rescales pixels intensities so that the darkest pixel will become black and the brightest will become white.ImageTransformation
appendAutoRescaleGrayscaleIntensity(float threshold, java.lang.String userFriendlyLabelOrNull)
ImageTransformation
appendGrayscaleBitShifting(int shiftBits)
Appends transformation which extracts a range of grayscale image colors by choosing 8 consecutive bits starting from the specified one.ImageTransformation
appendImageMagicConvert(java.lang.String convertCliArguments)
Allows to transform the images with ImageMagic convert tool (which has to be installed and accessible).ImageTransformation
appendImageMagicConvert(java.lang.String convertCliArguments, java.lang.String userFriendlyLabelOrNull)
ImageTransformation
appendRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity)
Appends transformation which converts grayscale image pixel intensities from the range [blackPointIntensity, whitePointIntensity] to 8 bit color depth.ImageTransformation
appendRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity, java.lang.String userFriendlyLabelOrNull)
static ImageTransformation
createRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity, java.lang.String userFriendlyLabelOrNull)
Creates a transformation which converts grayscale image pixel intensities from the range [blackPointIntensity, whitePointIntensity] to 8 bit color depth.ImageTransformation[]
getTransformations()
-
-
-
Method Detail
-
append
public ImageTransformation append(ImageTransformation transformation)
Appends a single transformation and returns it. Note that code of each added transformation should be unique.
-
appendAll
public void appendAll(ImageTransformation... transformations)
Appends any specified transformations. Note that code of each added transformation should be unique.
-
getTransformations
public ImageTransformation[] getTransformations()
-
appendAllBitShiftsFor12BitGrayscale
public ImageTransformation[] appendAllBitShiftsFor12BitGrayscale()
Appends transformations which extracts a range of grayscale image colors by choosing 8 consecutive bits. All shifts which make sense for 12 bit images will be appended (from 0 to 4).- Returns:
- appended transformations. They can be used to e.g. modify their label or description.
-
appendAllBitShiftsFor16BitGrayscale
public ImageTransformation[] appendAllBitShiftsFor16BitGrayscale()
Appends transformations which extracts a range of grayscale image colors by choosing 8 consecutive bits. All shifts which make sense for 16 bit images will be appended (from 0 to 8).- Returns:
- appended transformations. They can be used to e.g. modify their label or description.
-
appendGrayscaleBitShifting
public ImageTransformation appendGrayscaleBitShifting(int shiftBits)
Appends transformation which extracts a range of grayscale image colors by choosing 8 consecutive bits starting from the specified one.- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
appendRescaleGrayscaleIntensity
public ImageTransformation appendRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity)
Appends transformation which converts grayscale image pixel intensities from the range [blackPointIntensity, whitePointIntensity] to 8 bit color depth. Useful to compare images of higher color depth with each other when they do not use the whole range of available intensities.- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
appendRescaleGrayscaleIntensity
public ImageTransformation appendRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity, java.lang.String userFriendlyLabelOrNull)
SeeappendRescaleGrayscaleIntensity(int, int)
.Additionally sets the label of the transformation.
- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
createRescaleGrayscaleIntensity
public static ImageTransformation createRescaleGrayscaleIntensity(int blackPointIntensity, int whitePointIntensity, java.lang.String userFriendlyLabelOrNull)
Creates a transformation which converts grayscale image pixel intensities from the range [blackPointIntensity, whitePointIntensity] to 8 bit color depth.This method is useful when one wants to modify the default code, label or description afterwards.
- Parameters:
userFriendlyLabelOrNull
- label of the transformation. If null a default label is assigned.
-
appendAutoRescaleGrayscaleIntensity
public ImageTransformation appendAutoRescaleGrayscaleIntensity(float threshold)
Appends transformation which converts each single grayscale image to 8 bit color depth and rescales pixels intensities so that the darkest pixel will become black and the brightest will become white.Note that by default openBIS applies this transformation with threshold 0 if it deals with grayscale image where color depth is bigger then 8 bit. So calling this method with parameter 0 is not necessary.
- Parameters:
threshold
- value form 0 to 1, it specifies the percentage of darkest and brightest pixels which will be ignored (they will all become black or white).- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
appendAutoRescaleGrayscaleIntensity
public ImageTransformation appendAutoRescaleGrayscaleIntensity(float threshold, java.lang.String userFriendlyLabelOrNull)
SeeappendAutoRescaleGrayscaleIntensity(float)
.Additionally sets the label of the transformation.
- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
appendImageMagicConvert
public ImageTransformation appendImageMagicConvert(java.lang.String convertCliArguments)
Allows to transform the images with ImageMagic convert tool (which has to be installed and accessible). Convert will be called with the specified parameters.- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
appendImageMagicConvert
public ImageTransformation appendImageMagicConvert(java.lang.String convertCliArguments, java.lang.String userFriendlyLabelOrNull)
SeeappendImageMagicConvert(String)
.Additionally sets the label of the transformation.
- Returns:
- appended transformation. It can be used to e.g. modify its label or description.
-
-