Package bdv.img.hdf5

Class Partition


  • public class Partition
    extends Object
    Partition describes one partition file of a dataset that is split across multiple hdf5 files. An aggregating hdf5 linking the partition files can be created using the Partition information (without looking at the constituent files).
    Author:
    Tobias Pietzsch
    • Field Detail

      • path

        protected final String path
    • Constructor Detail

      • Partition

        public Partition​(String path,
                         int[] timepointIdsSequence,
                         int[] setupIdsSequence,
                         int[] timepointIdsPartition,
                         int[] setupIdsPartition)
        Create a new Partition description.
        Parameters:
        path - path to the hdf5 file for this partition
        timepointIdsSequence -
        setupIdsSequence -
        timepointIdsPartition -
        setupIdsPartition -
      • Partition

        public Partition​(String path,
                         Map<Integer,​Integer> timepointIdSequenceToPartition,
                         Map<Integer,​Integer> setupIdSequenceToPartition)
        Create a new Partition description.
        Parameters:
        path - path to the hdf5 file for this partition
        timepointIdSequenceToPartition -
        setupIdSequenceToPartition -
    • Method Detail

      • getPath

        public String getPath()
        Get the path to the hdf5 file for this partition.
        Returns:
        path to the hdf5 file for this partition.
      • getTimepointIdSequenceToPartition

        public Map<Integer,​Integer> getTimepointIdSequenceToPartition()
        Get a map from timepoint ids of the full sequence to timepoint ids of this partition.
      • getSetupIdSequenceToPartition

        public Map<Integer,​Integer> getSetupIdSequenceToPartition()
        Get a map from setup ids of the full sequence to setup ids of this partition.
      • contains

        public boolean contains​(mpicbg.spim.data.sequence.ViewId viewId)
        Does this partition contain the given view (timepoint-setup pair)?
        Parameters:
        viewId - view (timepoint and setup id wrt. the full sequence)
        Returns:
        whether this partition contains the given view.
      • split

        public static ArrayList<Partition> split​(List<mpicbg.spim.data.sequence.TimePoint> timepoints,
                                                 List<? extends mpicbg.spim.data.generic.sequence.BasicViewSetup> setups,
                                                 int timepointsPerPartition,
                                                 int setupsPerPartition,
                                                 String basename)
        Split a sequence into partitions, each containing a specified number of timepoints and setups.
        Parameters:
        timepoints - list of all TimePoints.
        setups - list of all BasicViewSetups.
        timepointsPerPartition - how many timepoints should each partition contain (if this is ≤0, put do not split timepoints across partitions).
        setupsPerPartition - how many setups should each partition contain (if this is ≤0, put do not split setups across partitions).
        basename - This is used to generate paths for the partitions. Partitions are named "basename-TT-SS.h5" where TT and SS are the index of the timepoint and setup batch, respectively.
        Returns:
        list of partitions.