Class TimeSeries
Object
org.anchoranalysis.image.io.stack.time.TimeSeries
public class TimeSeries extends Object implements Iterable<Stack>
An ordered collection of
Stacks, each representing a frame in a time-series.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description TimeSeries(Stream<Stack> frames)Creates aTimeSeriesfrom a stream of frames.TimeSeries(Stack frame)Creates aTimeSeriescontaining a single frame only. -
Method Summary
Modifier and Type Method Description booleanallChannelsHaveType(org.anchoranalysis.image.voxel.datatype.VoxelDataType voxelDataType)Whether allChannels in all frames in the times-series have a particular voxel-data type?StackgetFrame(int index)Gets a frame in the time-series.booleanisEmpty()Whether the series contains no frames?Iterator<Stack>iterator()intsize()The number of frames in the time-series.
-
Constructor Details
-
TimeSeries
Creates aTimeSeriescontaining a single frame only.- Parameters:
frame- the single frame.
-
TimeSeries
Creates aTimeSeriesfrom a stream of frames.- Parameters:
frames- the frames.
-
-
Method Details
-
getFrame
Gets a frame in the time-series.- Parameters:
index- the index of the frame, beginning at 0.- Returns:
- the corresponding frame.
- Throws:
IndexOutOfBoundsException- if no frame exists atindex.
-
isEmpty
public boolean isEmpty()Whether the series contains no frames?- Returns:
- true if no frames exist in the series. false if at least one frame exists.
-
size
public int size()The number of frames in the time-series.- Returns:
- the number of frames.
-
allChannelsHaveType
public boolean allChannelsHaveType(org.anchoranalysis.image.voxel.datatype.VoxelDataType voxelDataType)Whether allChannels in all frames in the times-series have a particular voxel-data type?- Parameters:
voxelDataType- the voxel data-type to match.- Returns:
- true iff all frames have this data-type.
-
iterator
-