Class InterestPointsN5
java.lang.Object
net.preibisch.mvrecon.fiji.spimdata.interestpoints.InterestPoints
net.preibisch.mvrecon.fiji.spimdata.interestpoints.InterestPointsN5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSerializable data container for interest points and correspondences. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcorrDataset(String n5dataset) static StringcreateN5datasetPath(int tpId, int vsId, String label) booleanbooleanstatic Stringprotected booleanprotected booleanLoad correspondences in v1.x format (3xN array: detectionId_A, detectionId_B, metadataId) Sets consensusSetId to -1 for all correspondences (single-consensus mode)protected booleanLoad correspondences in v2.x format (4xN array: detectionId_A, detectionId_B, metadataId, consensusSetId) Reads consensusSetId from 4th column, decoding 0xFFFFFFFFFFFFFFFF as -1protected booleanstatic booleansaveCorrespondencesStatic(URI baseDir, int timepointId, int setupId, String label, List<CorrespondingInterestPoints> list) Convenience overload that constructs n5path from timepoint/setup/label.static booleansaveCorrespondencesStatic(URI baseDir, String n5path, List<CorrespondingInterestPoints> list) Core static method for saving correspondences to N5.static booleansaveCorrespondencesStatic(org.janelia.saalfeldlab.n5.N5Writer n5Writer, String n5path, List<CorrespondingInterestPoints> list) Core static method for saving correspondences to N5 using an already-open N5Writer.booleansaveCorrespondingInterestPoints(boolean forceWrite) booleansaveCorrespondingInterestPoints(boolean forceWrite, org.janelia.saalfeldlab.n5.N5Writer n5Writer) Save correspondences using an already-open N5Writer, clearing the modified flag on success.static booleansaveInterestPointDataStatic(URI baseDir, InterestPointsN5.InterestPointData data) Static wrapper to save all data from an InterestPointData object.static booleansaveInterestPointDataStatic(org.janelia.saalfeldlab.n5.N5Writer n5Writer, InterestPointsN5.InterestPointData data) Static wrapper to save all data from an InterestPointData object using an already-open N5Writer.booleansaveInterestPoints(boolean forceWrite) booleansaveInterestPoints(boolean forceWrite, org.janelia.saalfeldlab.n5.N5Writer n5Writer) Save interest points using an already-open N5Writer, clearing the modified flag on success.static booleansaveInterestPointsStatic(URI baseDir, int timepointId, int setupId, String label, int[] ids, double[][] locations) Convenience overload that constructs n5path from timepoint/setup/label.static booleansaveInterestPointsStatic(URI baseDir, String n5path, int[] ids, double[][] locations) Core static method for saving interest points to N5.static booleansaveInterestPointsStatic(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.protected voidprotected voidsetInterestPointsLocal(Collection<InterestPoint> collection) Methods inherited from class net.preibisch.mvrecon.fiji.spimdata.interestpoints.InterestPoints
getBasePath, getParameters, hasModifiedCorrespondingInterestPoints, hasModifiedInterestPoints, instantiatefromXML, newInstance, setBasePath, setCorrespondingInterestPoints, setInterestPoints, setParameters
-
Field Details
-
defaultBlockSize
public static int defaultBlockSize -
baseN5
- See Also:
-
-
Constructor Details
-
InterestPointsN5
-
-
Method Details
-
getN5dataset
-
getXMLRepresentation
- Specified by:
getXMLRepresentationin classInterestPoints- Returns:
- a string to be stored in the XML, also used to instantiate this object (e.g. file path)
-
createN5datasetPath
-
getInterestPointsCopy
- Specified by:
getInterestPointsCopyin classInterestPoints- Returns:
- - a list of interest points (copied), tries to load from disc if null
-
getCorrespondingInterestPointsCopy
- Specified by:
getCorrespondingInterestPointsCopyin classInterestPoints- Returns:
- - the list of corresponding interest points (copied), tries to load from disc if null
-
setInterestPointsLocal
- Specified by:
setInterestPointsLocalin classInterestPoints
-
setCorrespondingInterestPointsLocal
- Specified by:
setCorrespondingInterestPointsLocalin classInterestPoints
-
ipDataset
-
corrDataset
-
ipDataset
-
corrDataset
-
saveInterestPoints
public boolean saveInterestPoints(boolean forceWrite) - Specified by:
saveInterestPointsin classInterestPoints
-
saveCorrespondingInterestPoints
public boolean saveCorrespondingInterestPoints(boolean forceWrite) - Specified by:
saveCorrespondingInterestPointsin classInterestPoints
-
saveInterestPoints
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:
loadInterestPointsin classInterestPoints
-
loadCorrespondences
protected boolean loadCorrespondences()- Specified by:
loadCorrespondencesin classInterestPoints
-
loadCorrespondencesV1
Load correspondences in v1.x format (3xN array: detectionId_A, detectionId_B, metadataId) Sets consensusSetId to -1 for all correspondences (single-consensus mode) -
loadCorrespondencesV2
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:
deleteInterestPointsin classInterestPoints
-
deleteCorrespondingInterestPoints
public boolean deleteCorrespondingInterestPoints()- Specified by:
deleteCorrespondingInterestPointsin classInterestPoints
-
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.n5n5path- Relative path within interestpoints.n5 (e.g., "tpId_0_viewSetupId_1/beads")ids- Array of detection IDslocations- 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, prefersaveInterestPointsStatic(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 IDslocations- 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.n5n5path- 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, prefersaveCorrespondencesStatic(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.n5data- 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, prefersaveInterestPointDataStatic(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
-