public class OutlinePreserveRelativeSize extends ThumbnailFromObjects
Preserves the relative-size between objects (i.e. they are all reduced by the same scale-factor) in the same batch.
If it's a z-stack, a maximum intensity projection is first applied.
All thumbnails are created with identical size. An error will occur if the background is ever smaller than the thumbnail size.
If no specific background-channel is set with setBackgroundChannelIndex(int)
then the
following scheme applies:
backgroundSource
has exactly zero channels, an empty zero-valued monochrome
background is used (unsigned 8 bit).
backgroundSource
has exactly one channel, it's used as a monochrome background
backgroundSource
has exactly three channels, it's used as a RGB background
backgroundSource
has any other number of channels, the first channel is used as
a background.
Constructor and Description |
---|
OutlinePreserveRelativeSize() |
Modifier and Type | Method and Description |
---|---|
static OutlinePreserveRelativeSize |
createToColorUnselectedObjects(Interpolator interpolator)
Alternative constructor that switches on the coloring of unselected objects by default.
|
int |
getBackgroundChannelIndex()
Uses only this channel (identified by an index in the stack) as the background, -1 disables.
|
RGBColorBean |
getColorUnselectedObjects()
Optionally outline the other (unselected for the thumbnail) objects in this particular color.
|
StackDisplayer |
getDisplayer()
How to convert an image so that it can be displayed.
|
Interpolator |
getInterpolator()
Interpolator used when scaling the background
|
int |
getOutlineWidth()
The width of the outline.
|
SizeXY |
getSize()
Size of all created thumbnails
|
boolean |
isOverlappingObjects()
Whether objects may overlap or not when unscaled.
|
void |
setBackgroundChannelIndex(int backgroundChannelIndex)
Uses only this channel (identified by an index in the stack) as the background, -1 disables.
|
void |
setColorUnselectedObjects(RGBColorBean colorUnselectedObjects)
Optionally outline the other (unselected for the thumbnail) objects in this particular color.
|
void |
setDisplayer(StackDisplayer displayer)
How to convert an image so that it can be displayed.
|
void |
setInterpolator(Interpolator interpolator)
Interpolator used when scaling the background
|
void |
setOutlineWidth(int outlineWidth)
The width of the outline.
|
void |
setOverlappingObjects(boolean overlappingObjects)
Whether objects may overlap or not when unscaled.
|
void |
setSize(SizeXY size)
Size of all created thumbnails
|
ThumbnailBatch<ObjectCollection> |
start(ObjectCollection objects,
StreamableCollection<BoundingBox> boundingBoxes,
Optional<Stack> backgroundSource,
ExecutionTimeRecorder executionTimeRecorder)
Initializes a batch to create thumbnails.
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public static OutlinePreserveRelativeSize createToColorUnselectedObjects(Interpolator interpolator)
They are colored in blue.
interpolator
- how to resize an image.OutlinePreserveRelativeSize
that colors
unselected objects, but otherwise uses defaults.public ThumbnailBatch<ObjectCollection> start(ObjectCollection objects, StreamableCollection<BoundingBox> boundingBoxes, Optional<Stack> backgroundSource, ExecutionTimeRecorder executionTimeRecorder) throws OperationFailedException
ThumbnailFromObjects
A batch is a set of objects which are calibrated together (to have the same scale etc.)
start
in class ThumbnailFromObjects
objects
- the entire set of objects in the batch (for which thumbnails may be
subsequently created)boundingBoxes
- bounding-boxes that minimally enclose all the inputs to feature rows
(e.g. a pair of objects or a single-object) and can be used for guessing scale-factors. A
supplier is used as the stream may be desired multiple times.backgroundSource
- a stack that will be used to form the background (or some part of may be
used)executionTimeRecorder
- TODOOperationFailedException
public SizeXY getSize()
public void setSize(SizeXY size)
public int getBackgroundChannelIndex()
public void setBackgroundChannelIndex(int backgroundChannelIndex)
public Interpolator getInterpolator()
public void setInterpolator(Interpolator interpolator)
public int getOutlineWidth()
public void setOutlineWidth(int outlineWidth)
public RGBColorBean getColorUnselectedObjects()
public void setColorUnselectedObjects(RGBColorBean colorUnselectedObjects)
public boolean isOverlappingObjects()
If they overlap, we scale them individually, not taking account of their neighbours.
If they may not overlap, we scale them collectively, as visually this gives tighter borders between neighbouring objects.
public void setOverlappingObjects(boolean overlappingObjects)
If they overlap, we scale them individually, not taking account of their neighbours.
If they may not overlap, we scale them collectively, as visually this gives tighter borders between neighbouring objects.
public StackDisplayer getDisplayer()
public void setDisplayer(StackDisplayer displayer)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.