Class InterestPointsN5

java.lang.Object
net.preibisch.mvrecon.fiji.spimdata.interestpoints.InterestPoints
net.preibisch.mvrecon.fiji.spimdata.interestpoints.InterestPointsN5

public class InterestPointsN5 extends InterestPoints
  • Field Details

  • Constructor Details

    • InterestPointsN5

      public InterestPointsN5(URI basePath, String n5dataset)
  • Method Details

    • getN5dataset

      public String getN5dataset()
    • getXMLRepresentation

      public String getXMLRepresentation()
      Specified by:
      getXMLRepresentation in class InterestPoints
      Returns:
      a string to be stored in the XML, also used to instantiate this object (e.g. file path)
    • createN5datasetPath

      public static String createN5datasetPath(int tpId, int vsId, String label)
    • getInterestPointsCopy

      public Map<Integer,InterestPoint> getInterestPointsCopy()
      Specified by:
      getInterestPointsCopy in class InterestPoints
      Returns:
      - a list of interest points (copied), tries to load from disc if null
    • getCorrespondingInterestPointsCopy

      public Collection<CorrespondingInterestPoints> getCorrespondingInterestPointsCopy()
      Specified by:
      getCorrespondingInterestPointsCopy in class InterestPoints
      Returns:
      - the list of corresponding interest points (copied), tries to load from disc if null
    • setInterestPointsLocal

      protected void setInterestPointsLocal(Collection<InterestPoint> collection)
      Specified by:
      setInterestPointsLocal in class InterestPoints
    • setCorrespondingInterestPointsLocal

      protected void setCorrespondingInterestPointsLocal(Collection<CorrespondingInterestPoints> list)
      Specified by:
      setCorrespondingInterestPointsLocal in class InterestPoints
    • ipDataset

      public String ipDataset()
    • corrDataset

      public String corrDataset()
    • ipDataset

      public static String ipDataset(String n5dataset)
    • corrDataset

      public static String corrDataset(String n5dataset)
    • saveInterestPoints

      public boolean saveInterestPoints(boolean forceWrite)
      Specified by:
      saveInterestPoints in class InterestPoints
    • saveCorrespondingInterestPoints

      public boolean saveCorrespondingInterestPoints(boolean forceWrite)
      Specified by:
      saveCorrespondingInterestPoints in class InterestPoints
    • saveInterestPoints

      public boolean saveInterestPoints(boolean forceWrite, org.janelia.saalfeldlab.n5.N5Writer n5Writer)
      Save interest points using an already-open N5Writer, clearing the modified flag on success. Use when saving many views to avoid per-view open/close overhead.
    • saveCorrespondingInterestPoints

      public boolean saveCorrespondingInterestPoints(boolean forceWrite, org.janelia.saalfeldlab.n5.N5Writer n5Writer)
      Save correspondences using an already-open N5Writer, clearing the modified flag on success. Use when saving many views to avoid per-view open/close overhead.
    • loadInterestPoints

      protected boolean loadInterestPoints()
      Specified by:
      loadInterestPoints in class InterestPoints
    • loadCorrespondences

      protected boolean loadCorrespondences()
      Specified by:
      loadCorrespondences in class InterestPoints
    • loadCorrespondencesV1

      protected boolean loadCorrespondencesV1(org.janelia.saalfeldlab.n5.N5Reader n5, String dataset)
      Load correspondences in v1.x format (3xN array: detectionId_A, detectionId_B, metadataId) Sets consensusSetId to -1 for all correspondences (single-consensus mode)
    • loadCorrespondencesV2

      protected boolean loadCorrespondencesV2(org.janelia.saalfeldlab.n5.N5Reader n5, String dataset)
      Load correspondences in v2.x format (4xN array: detectionId_A, detectionId_B, metadataId, consensusSetId) Reads consensusSetId from 4th column, decoding 0xFFFFFFFFFFFFFFFF as -1
    • deleteInterestPoints

      public boolean deleteInterestPoints()
      Specified by:
      deleteInterestPoints in class InterestPoints
    • deleteCorrespondingInterestPoints

      public boolean deleteCorrespondingInterestPoints()
      Specified by:
      deleteCorrespondingInterestPoints in class InterestPoints
    • saveInterestPointsStatic

      public static boolean saveInterestPointsStatic(org.janelia.saalfeldlab.n5.N5Writer n5Writer, String n5path, int[] ids, double[][] locations)
      Core static method for saving interest points to N5 using an already-open N5Writer. The caller is responsible for opening and closing the writer. Use this overload when saving many views to avoid the per-view open/close overhead (e.g. in BigStitcher-Spark interest point detection).
      Parameters:
      n5Writer - an already-open N5Writer for interestpoints.n5
      n5path - Relative path within interestpoints.n5 (e.g., "tpId_0_viewSetupId_1/beads")
      ids - Array of detection IDs
      locations - Array of coordinates (numPoints x numDimensions)
      Returns:
      true if successful
    • saveInterestPointsStatic

      public static boolean saveInterestPointsStatic(URI baseDir, String n5path, int[] ids, double[][] locations)
      Core static method for saving interest points to N5. Opens and closes its own N5Writer. For saving many views, prefer saveInterestPointsStatic(N5Writer, String, int[], double[][]) with a shared writer to avoid the per-view open/close overhead.
      Parameters:
      baseDir - Base URI for N5 storage (parent of interestpoints.n5)
      n5path - Relative path within interestpoints.n5 (e.g., "tpId_0_viewSetupId_1/beads")
      ids - Array of detection IDs
      locations - Array of coordinates (numPoints x numDimensions)
      Returns:
      true if successful
    • saveInterestPointsStatic

      public static boolean saveInterestPointsStatic(URI baseDir, int timepointId, int setupId, String label, int[] ids, double[][] locations)
      Convenience overload that constructs n5path from timepoint/setup/label. Suitable for Spark where ViewId is not available.
    • saveCorrespondencesStatic

      public static boolean saveCorrespondencesStatic(org.janelia.saalfeldlab.n5.N5Writer n5Writer, String n5path, List<CorrespondingInterestPoints> list)
      Core static method for saving correspondences to N5 using an already-open N5Writer. The caller is responsible for opening and closing the writer. Use this overload when saving many views to avoid the per-view open/close overhead (e.g. in BigStitcher-Spark interest point detection).
      Parameters:
      n5Writer - an already-open N5Writer for interestpoints.n5
      n5path - Relative path within interestpoints.n5 (e.g., "tpId_0_viewSetupId_1/beads")
      list - List of corresponding interest points (can be empty, not null)
      Returns:
      true if successful
    • saveCorrespondencesStatic

      public static boolean saveCorrespondencesStatic(URI baseDir, String n5path, List<CorrespondingInterestPoints> list)
      Core static method for saving correspondences to N5. Works directly with List<CorrespondingInterestPoints> (the native internal format). Opens and closes its own N5Writer. For saving many views, prefer saveCorrespondencesStatic(N5Writer, String, List) with a shared writer to avoid the per-view open/close overhead.
      Parameters:
      baseDir - Base URI for N5 storage (parent of interestpoints.n5)
      n5path - Relative path within interestpoints.n5 (e.g., "tpId_0_viewSetupId_1/beads")
      list - List of corresponding interest points (can be empty, not null)
      Returns:
      true if successful
    • saveCorrespondencesStatic

      public static boolean saveCorrespondencesStatic(URI baseDir, int timepointId, int setupId, String label, List<CorrespondingInterestPoints> list)
      Convenience overload that constructs n5path from timepoint/setup/label. Suitable for Spark where ViewId is not available.
    • saveInterestPointDataStatic

      public static boolean saveInterestPointDataStatic(org.janelia.saalfeldlab.n5.N5Writer n5Writer, InterestPointsN5.InterestPointData data)
      Static wrapper to save all data from an InterestPointData object using an already-open N5Writer. The caller is responsible for opening and closing the writer. Use this overload when saving many views to avoid the per-view open/close overhead (e.g. in BigStitcher-Spark interest point detection).
      Parameters:
      n5Writer - an already-open N5Writer for interestpoints.n5
      data - InterestPointData containing all data
      Returns:
      true if successful
    • saveInterestPointDataStatic

      public static boolean saveInterestPointDataStatic(URI baseDir, InterestPointsN5.InterestPointData data)
      Static wrapper to save all data from an InterestPointData object. Suitable for Spark RDD.foreach() operations. Opens and closes its own N5Writer. For saving many views, prefer saveInterestPointDataStatic(N5Writer, InterestPointData) with a shared writer to avoid the per-view open/close overhead.
      Parameters:
      baseDir - Base URI for N5 storage (parent of interestpoints.n5)
      data - InterestPointData containing all data
      Returns:
      true if successful