Constructor and Description |
---|
MontageSharedState(Map<Path,BoundingBoxEnclosed> boxes,
Extent sizeCombined,
VoxelsResizer resizer,
ExecutionTimeRecorder executionTimeRecorder)
Create with a mapping from
Path s to boxes. |
Modifier and Type | Method and Description |
---|---|
void |
copyStackInto(CheckedSupplier<RGBStack,InputReadFailedException> source,
String identifier,
Path path,
Optional<String> label)
Copies a
Stack into a BoundingBox in the combined image, resizing if
necessary. |
void |
drawAllLabels(double ratioHeightForLabel,
BoxAligner aligner)
Draw all labels that have been queued during calls to
copyStackInto(org.anchoranalysis.core.functional.checked.CheckedSupplier<org.anchoranalysis.image.core.stack.RGBStack, org.anchoranalysis.io.input.InputReadFailedException>, java.lang.String, java.nio.file.Path, java.util.Optional<java.lang.String>) . |
RGBStack |
getStack()
The stack into which individual images are written.
|
public MontageSharedState(Map<Path,BoundingBoxEnclosed> boxes, Extent sizeCombined, VoxelsResizer resizer, ExecutionTimeRecorder executionTimeRecorder)
Path
s to boxes.public void copyStackInto(CheckedSupplier<RGBStack,InputReadFailedException> source, String identifier, Path path, Optional<String> label) throws JobExecutionException
Stack
into a BoundingBox
in the combined image, resizing if
necessary.
Any associated label is added to a queue, to be later drawn when drawAllLabels(double, org.anchoranalysis.image.bean.spatial.arrange.align.BoxAligner)
is
executed.
The Stack
is read only lazily, to try and prevent errors until BoundingBoxEnclosed
is retrieved, so that a label can always be written, even in the event
of copying failure.
source
- supplies the image to copy from, not necessarily matching the final destination
size. It is resized as necessary.identifier
- the unique identifier for the image, so it can be included in error
messages.path
- the corresponding path to identify the appropriate BoundingBox
to use in
the combined image.label
- if set, this label is drawn onto the bottom of the image. if not set, nothing
occurs.JobExecutionException
- if no matching bounding-box exists, or the input cannot be
successfully read, or copying otherwise fails.public void drawAllLabels(double ratioHeightForLabel, BoxAligner aligner) throws OperationFailedException
copyStackInto(org.anchoranalysis.core.functional.checked.CheckedSupplier<org.anchoranalysis.image.core.stack.RGBStack, org.anchoranalysis.io.input.InputReadFailedException>, java.lang.String, java.nio.file.Path, java.util.Optional<java.lang.String>)
.
Once called, this class is no longer usable, and no subsequent methods should be called.
ratioHeightForLabel
- how much of the average box height should the label approximately
be sized to.aligner
- how to align the label on its respective associated image.OperationFailedException
- if the labels cannot be successfully drawn.public RGBStack getStack()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.