Class SplittingTools

java.lang.Object
net.preibisch.mvrecon.process.splitting.SplittingTools

public class SplittingTools extends Object
  • Field Details

    • IMAGE_SPLITTING_NAME

      public static final String IMAGE_SPLITTING_NAME
      See Also:
    • roundMipmapResolutions

      public static boolean roundMipmapResolutions
  • Constructor Details

    • SplittingTools

      public SplittingTools()
  • Method Details

    • splitImages

      public static SpimData2 splitImages(SpimData2 spimData, SplitView splitting, boolean assingIlluminationsFromTileIds, Split_Views.InterestPointAdding ipAdding, double pointDensity, int minPoints, int maxPoints, double error, double excludeRadius)
    • defaultFakeLabel

      public static String defaultFakeLabel()
    • findFirstPresentViewId

      public static mpicbg.spim.data.sequence.ViewId findFirstPresentViewId(SpimData2 spimData, int setupId)
    • splitImages

      public static SpimData2 splitImages(SpimData2 spimData, SplitView splitting, boolean assingIlluminationsFromTileIds, Split_Views.InterestPointAdding ipAdding, double pointDensity, int minPoints, int maxPoints, double error, double excludeRadius, String fakeLabel, SplittingTools.InterestPointSaver saver, SplittingTools.CorrespondenceSaver corrSaver)
    • splitImages

      public static SpimData2 splitImages(SpimData2 spimData, SplitView splitting, boolean assingIlluminationsFromTileIds, Split_Views.InterestPointAdding ipAdding, double pointDensity, int minPoints, int maxPoints, double error, double excludeRadius, String fakeLabel, SplittingTools.InterestPointSaver saver, SplittingTools.CorrespondenceSaver corrSaver, Set<Integer> driveByChannelIds)
      Split all ViewSetups of the dataset, optionally driving the split geometry from a single channel.
      Parameters:
      driveByChannelIds - if non-null, only ViewSetups whose channel id is contained in this set are split based on their own correspondences/criterion. Every other ViewSetup reuses ("mirrors") the intervals of the matching (same angle/illumination/tile and equal dimensions) driving setup, so all channels are tiled identically - required for downstream fusion. null splits every setup independently (original behaviour). Typical use: only one channel was registered (e.g. multi-consensus RANSAC), so only that channel can drive the split, but all channels must be subdivided consistently.
    • processSetupStatic

      public static SplittingTools.SetupSplitResult processSetupStatic(mpicbg.spim.data.sequence.ViewSetup oldSetup, ArrayList<net.imglib2.Interval> intervals, int idRangeStart, int maxIntervalSpread, mpicbg.spim.data.sequence.TimePoints timepoints, mpicbg.spim.data.registration.ViewRegistrations oldRegistrations, SpimData2 spimData, boolean assingIlluminationsFromTileIds, Split_Views.InterestPointAdding ipAdding, String fakeLabel, double pointDensity, int minPoints, int maxPoints, double error, double excludeRadius, long rndSeed, String splittingDescription, SplittingTools.InterestPointSaver saver)
      Process a single ViewSetup's split intervals in isolation. Thread-safe: no shared mutable state, all parameters passed in, result returned. Can be called from parallel streams, ExecutorService, or Spark.
      Parameters:
      oldSetup - The original ViewSetup to process
      intervals - The split intervals for this setup
      idRangeStart - Pre-computed starting ID for this setup's new ViewSetups
      maxIntervalSpread - Maximum spread for tile ID calculation
      timepoints - All timepoints to process
      oldRegistrations - Original view registrations
      spimData - The SpimData2 for accessing interest points and missing views
      assingIlluminationsFromTileIds - Whether to use illumination attribute for old tiles
      ipAdding - Mode for adding fake interest points
      fakeLabel - Label for fake interest points
      pointDensity - Density for fake point generation
      minPoints - Minimum fake points per overlap
      maxPoints - Maximum fake points per overlap
      error - Error for fake point positions
      excludeRadius - Radius to exclude around existing points
      rndSeed - Seed for random number generator (per-setup for determinism)
      splittingDescription - Description of splitting method
      saver - Optional callback for on-the-fly saving of interest points (null to skip)
      Returns:
      SetupSplitResult containing all generated data for this setup
    • findMinStepSize

      public static long[] findMinStepSize(mpicbg.spim.data.generic.AbstractSpimData<?> data)
    • greatestCommonDivisor

      public static long greatestCommonDivisor(long a, long b)
    • lowestCommonMultiplier

      public static long lowestCommonMultiplier(long a, long b)
    • collectImageSizes

      public static net.imglib2.util.Pair<HashMap<String,Integer>,long[]> collectImageSizes(mpicbg.spim.data.generic.AbstractSpimData<?> data)
    • processCorrespondingInterestPointsStatic

      public static void processCorrespondingInterestPointsStatic(mpicbg.spim.data.sequence.ViewSetup oldSetup, int newSetupId, mpicbg.spim.data.sequence.TimePoint t, SpimData2 spimData, Map<Integer,? extends List<Integer>> old2NewSetups, Map<mpicbg.spim.data.sequence.ViewId,ViewInterestPointLists> newInterestpoints, AtomicInteger completed, int totalTasks, SplittingTools.CorrespondenceSaver corrSaver, Map<String,Map<Integer,InterestPoint>> ipMapCache)
      Process corresponding interest points for a single (oldSetup, newSetupId, timepoint) combination. Thread-safe: each call writes to a unique newViewId. Can be called from parallel streams, ExecutorService, or Spark.
      Parameters:
      oldSetup - The original ViewSetup
      newSetupId - The new setup ID after splitting
      t - The timepoint
      spimData - The SpimData2 for accessing original interest points
      old2NewSetups - Mapping from old setup IDs to list of new setup IDs
      newInterestpoints - Map of new ViewId to ViewInterestPointLists (modified in place)
      completed - Optional AtomicInteger for progress tracking (can be null)
      totalTasks - Total number of tasks for progress logging (ignored if completed is null)
      corrSaver - Optional callback for on-the-fly saving of correspondences (null to skip)
      ipMapCache - Optional caller-supplied cache of new-view interest point maps, keyed by "timepointId_setupId_label". Pass null to have this call create a fresh cache internally (single-call scope). Share a cache across calls that run on the same thread (e.g. a Spark task's newSetupId loop) to avoid reloading the same target-view IP copies; the supplied Map does NOT need to be thread-safe for that pattern. Do NOT share across concurrent threads unless the caller passes a thread-safe Map (e.g. ConcurrentHashMap).