Class SliceViewIterator

java.lang.Object
org.eclipse.dawnsci.analysis.dataset.slicer.SliceViewIterator
All Implemented Interfaces:
Iterator<org.eclipse.january.dataset.ILazyDataset>, ISliceViewIterator

public class SliceViewIterator extends Object implements ISliceViewIterator
Iteration over views of a (subsampled) ILazyDataset Used for iterating of images or XY data in a multidimensional dataset Views will contain SliceFromSeriesMetadata describing there location in the original ILazyDataset, as well as in the subsampled view. If the input ILazyDataset contains SliceFromSeriesMetadata with a SourceInformation object, the SourceInformation will be transfered to each view Wrapper for a SliceNDIterator, but iterating ILazyDatasets rather than slices, also adds extra metadata.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SliceViewIterator(org.eclipse.january.dataset.ILazyDataset lazyDataset, org.eclipse.january.dataset.SliceND sampling, int... axes)
    Construct a Slice View Iterator
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the number of the current ILazyDataset
    int[]
    Get the shape of the subsampled view
    int
    Get the total number of views to be iterated over
    boolean
    Check to see if there is another view
    org.eclipse.january.dataset.ILazyDataset
    Get the current view on the ILazyDataset
    void
     
    void
    Resets the iterator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Constructor Details

    • SliceViewIterator

      public SliceViewIterator(org.eclipse.january.dataset.ILazyDataset lazyDataset, org.eclipse.january.dataset.SliceND sampling, int... axes)
      Construct a Slice View Iterator
      Parameters:
      lazyDataset - - the full dataset
      sampling - - the specific part to iterate over
      axes - - the dimensions the correspond to data axes (i.e. length 1 for XY and 2 for an image)
  • Method Details

    • hasNext

      public boolean hasNext()
      Check to see if there is another view
      Specified by:
      hasNext in interface Iterator<org.eclipse.january.dataset.ILazyDataset>
      Returns:
      if there is another view
    • reset

      public void reset()
      Resets the iterator
      Specified by:
      reset in interface ISliceViewIterator
    • next

      public org.eclipse.january.dataset.ILazyDataset next()
      Get the current view on the ILazyDataset
      Specified by:
      next in interface Iterator<org.eclipse.january.dataset.ILazyDataset>
      Returns:
      lazyDataset
    • getTotal

      public int getTotal()
      Get the total number of views to be iterated over
      Returns:
      total;
    • getCurrent

      public int getCurrent()
      Get the number of the current ILazyDataset
      Returns:
      current
    • getShape

      public int[] getShape()
      Get the shape of the subsampled view
      Specified by:
      getShape in interface ISliceViewIterator
      Returns:
      shape
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<org.eclipse.january.dataset.ILazyDataset>