public final class HyperstackUtils extends Object
Doesn't copy the subspaces, rather provides HyperstackUtils.Subspace
objects, which
contain a RandomAccessibleInterval
that can be used to traverse a
certain subspace. Each HyperstackUtils.Subspace
also contains metadata, which locates
the subspace in the hyperspace.
The code works for now, but a refactor is in place if/when ImgPlus
API changes or is replaced by another metadata rich class.
If you want to split a hyperspace into {X, Y, T} subspaces, and the hyperspace has more than one time dimension, *all* of the time dimensions will be lumped into {X, Y, T1, T2, .. Tn} subspaces. That is, instead of {X, Y, T1}, {X, Y, T2}, .. {X, Y, Tn}.
Modifier and Type | Class and Description |
---|---|
static class |
HyperstackUtils.Subspace<T extends RealType<T> & NativeType<T>>
A class which stores a subspace interval of an n-dimensional hyperspace,
and metadata
|
Modifier and Type | Method and Description |
---|---|
static <T extends RealType<T> & NativeType<T>> |
split3DSubspaces(ImgPlus<T> hyperStack)
Splits the hyperstack into {X, Y, Z} subspaces.
|
static <T extends RealType<T> & NativeType<T>> |
splitSubspaces(ImgPlus<T> hyperStack,
Collection<AxisType> subspaceTypes)
Splits the hyperstack into subspaces defined by the given axes.
|
public static <T extends RealType<T> & NativeType<T>> Stream<HyperstackUtils.Subspace<T>> split3DSubspaces(ImgPlus<T> hyperStack)
T
- type of the elements in the image.hyperStack
- an N-dimensional image.splitSubspaces(ImgPlus, Collection)
public static <T extends RealType<T> & NativeType<T>> Stream<HyperstackUtils.Subspace<T>> splitSubspaces(ImgPlus<T> hyperStack, Collection<AxisType> subspaceTypes)
If all the given axis types are not found in the hyperstack, gives subspaces of the found types. If none of the types are found, returns an empty stream. For example, if you want to split a {X, Y, C, T} hyperstack into {X, Y, Z}, returns all the {X, Y} subspaces.
NB Assumes that the given ImgPlus
has the necessary metadata, i.e.
its CalibratedAxis
have AxisType
.
T
- type of the elements in the image.hyperStack
- an N-dimensional image.subspaceTypes
- the types of the axis in the desired subspace.Copyright © 2018–2022 BoneJ. All rights reserved.