Class SplittingTools
java.lang.Object
net.preibisch.mvrecon.process.splitting.SplittingTools
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback for saving correspondences on-the-fly.static interfaceCallback for saving interest points (detections + correspondences) on-the-fly.static classResult of processing a single ViewSetup's split intervals. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.imglib2.util.Pair<HashMap<String, Integer>, long[]> static StringfindFirstPresentViewId(SpimData2 spimData, int setupId) static long[]static longgreatestCommonDivisor(long a, long b) static longlowestCommonMultiplier(long a, long b) static voidprocessCorrespondingInterestPointsStatic(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.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.static SpimData2splitImages(SpimData2 spimData, SplitView splitting, boolean assingIlluminationsFromTileIds, Split_Views.InterestPointAdding ipAdding, double pointDensity, int minPoints, int maxPoints, double error, double excludeRadius) static SpimData2splitImages(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) static SpimData2splitImages(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.
-
Field Details
-
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
-
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.nullsplits 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 processintervals- The split intervals for this setupidRangeStart- Pre-computed starting ID for this setup's new ViewSetupsmaxIntervalSpread- Maximum spread for tile ID calculationtimepoints- All timepoints to processoldRegistrations- Original view registrationsspimData- The SpimData2 for accessing interest points and missing viewsassingIlluminationsFromTileIds- Whether to use illumination attribute for old tilesipAdding- Mode for adding fake interest pointsfakeLabel- Label for fake interest pointspointDensity- Density for fake point generationminPoints- Minimum fake points per overlapmaxPoints- Maximum fake points per overlaperror- Error for fake point positionsexcludeRadius- Radius to exclude around existing pointsrndSeed- Seed for random number generator (per-setup for determinism)splittingDescription- Description of splitting methodsaver- Optional callback for on-the-fly saving of interest points (null to skip)- Returns:
- SetupSplitResult containing all generated data for this setup
-
findMinStepSize
-
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>, collectImageSizeslong[]> (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 ViewSetupnewSetupId- The new setup ID after splittingt- The timepointspimData- The SpimData2 for accessing original interest pointsold2NewSetups- Mapping from old setup IDs to list of new setup IDsnewInterestpoints- 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).
-