Skip to content

Commit f3a2a67

Browse files
committed
merge the downsampled changes
2 parents fa6bd3b + 7daab28 commit f3a2a67

8 files changed

Lines changed: 33 additions & 25 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
<bigdataviewer-n5.version>1.0.2</bigdataviewer-n5.version>
104104

105105
<spim_data.version>2.3.5</spim_data.version>
106-
<multiview-reconstruction.version>8.0.1-SNAPSHOT</multiview-reconstruction.version>
106+
<multiview-reconstruction.version>8.1.2-SNAPSHOT</multiview-reconstruction.version>
107107
<BigStitcher.version>2.5.0</BigStitcher.version>
108108

109109
<n5-universe.version>2.3.0</n5-universe.version>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
package net.preibisch.bigstitcher.spark;
22

3-
public enum Compressions {Lz4, Gzip, Zstandard, Blosc, Bzip2, Xz, Raw}
3+
public enum Compressions {
4+
Lz4, Gzip, Zstandard, Blosc, Bzip2, Xz, Raw
5+
}

src/main/java/net/preibisch/bigstitcher/spark/CreateFusionContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class CreateFusionContainer extends AbstractBasic implements Callable<Voi
7777

7878
@Option(names = {"-c", "--compression"}, defaultValue = "Zstandard", showDefaultValue = CommandLine.Help.Visibility.ALWAYS,
7979
description = "Dataset compression")
80-
private Compressions compression = null;
80+
private Compressions compressionType = null;
8181

8282
@Option(names = {"-cl", "--compressionLevel" }, description = "compression level, if supported by the codec (default: gzip 1, Zstandard 3, xz 6)")
8383
private Integer compressionLevel = null;
@@ -240,9 +240,9 @@ else if ( numTimepoints > numTimepointsXML )
240240
System.out.println( "Fusion target: " + boundingBox.getTitle() + ": " + Util.printInterval( boundingBox ) + " with blocksize " + Util.printCoordinates( blockSize ) );
241241

242242
// compression and data type
243-
final Compression compression = N5Util.getCompression( this.compression, this.compressionLevel );
243+
final Compression compression = N5Util.getCompression( this.compressionType, this.compressionLevel );
244244

245-
System.out.println( "Compression: " + this.compression );
245+
System.out.println( "Compression: " + this.compressionType );
246246
System.out.println( "Compression level: " + ( compressionLevel == null ? "default" : compressionLevel ) );
247247

248248
final DataType dt;

src/main/java/net/preibisch/bigstitcher/spark/Solver.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ public Void call() throws Exception
289289
return null;
290290
}
291291

292-
final GlobalOptimizationParameters globalOptParameters = new GlobalOptimizationParameters(relativeThreshold, absoluteThreshold, globalOptType, false );
292+
final GlobalOptimizationParameters globalOptParameters = new GlobalOptimizationParameters(relativeThreshold, absoluteThreshold, globalOptType, false, false );
293293
final Collection< Pair< Group< ViewId >, Group< ViewId > > > removedInconsistentPairs = new ArrayList<>();
294294
final HashMap<ViewId, Tile > models;
295295
final Model<?> model = createModelInstance(transformationModel, regularizationModel, regularizationLambda);
@@ -299,7 +299,8 @@ public Void call() throws Exception
299299
final ConvergenceStrategy cs = new ConvergenceStrategy( maxError, maxIterations, maxPlateauwidth );
300300

301301
models = (HashMap)GlobalOpt.computeTiles(
302-
(Model)(Object)model,
302+
(Model)model,
303+
globalOptParameters.preAlign,
303304
pmc,
304305
cs,
305306
fixedViewIds,
@@ -308,7 +309,8 @@ public Void call() throws Exception
308309
else if ( globalOptParameters.method == GlobalOptType.ONE_ROUND_ITERATIVE )
309310
{
310311
models = (HashMap)GlobalOptIterative.computeTiles(
311-
(Model)(Object)model,
312+
(Model)model,
313+
globalOptParameters.preAlign,
312314
pmc,
313315
new SimpleIterativeConvergenceStrategy( Double.MAX_VALUE, maxIterations, maxPlateauwidth, globalOptParameters.relativeThreshold, globalOptParameters.absoluteThreshold ),
314316
new MaxErrorLinkRemoval(),
@@ -322,7 +324,8 @@ else if ( globalOptParameters.method == GlobalOptType.ONE_ROUND_ITERATIVE )
322324
globalOptParameters.relativeThreshold = globalOptParameters.absoluteThreshold = Double.MAX_VALUE;
323325

324326
models = (HashMap)GlobalOptTwoRound.computeTiles(
325-
(Model & Affine3D)(Object)model,
327+
(Model & Affine3D)model,
328+
globalOptParameters.preAlign,
326329
pmc,
327330
new SimpleIterativeConvergenceStrategy( Double.MAX_VALUE, maxIterations, maxPlateauwidth, globalOptParameters.relativeThreshold, globalOptParameters.absoluteThreshold ), // if it's simple, both will be Double.MAX
328331
new MaxErrorLinkRemoval(),
@@ -512,18 +515,18 @@ public static InterestPointMatchCreator setupPointMatchesFromInterestPoints(
512515
pairResult.setLabelA( labelA );
513516
pairResult.setLabelB( labelB );
514517

515-
final List<CorrespondingInterestPoints> cpA = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vA ).getInterestPointList( labelA ).getCorrespondingInterestPointsCopy();
518+
final Collection<CorrespondingInterestPoints> cpA = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vA ).getInterestPointList( labelA ).getCorrespondingInterestPointsCopy();
516519
//List<CorrespondingInterestPoints> cpB = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vB ).getInterestPointList( label ).getCorrespondingInterestPointsCopy();
517520

518-
final List<InterestPoint> ipListA = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vA ).getInterestPointList( labelA ).getInterestPointsCopy();
519-
final List<InterestPoint> ipListB = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vB ).getInterestPointList( labelB ).getInterestPointsCopy();
521+
final Map<Integer, InterestPoint> ipMapA = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vA ).getInterestPointList( labelA ).getInterestPointsCopy();
522+
final Map<Integer, InterestPoint> ipMapB = dataGlobal.getViewInterestPoints().getViewInterestPointLists( vB ).getInterestPointList( labelB ).getInterestPointsCopy();
520523

521524
for ( final CorrespondingInterestPoints p : cpA )
522525
{
523526
if ( p.getCorrespodingLabel().equals( labelB ) && p.getCorrespondingViewId().equals( vB ) )
524527
{
525-
InterestPoint ipA = ipListA.get( p.getDetectionId() );
526-
InterestPoint ipB = ipListB.get( p.getCorrespondingDetectionId() );
528+
InterestPoint ipA = ipMapA.get( p.getDetectionId() );
529+
InterestPoint ipB = ipMapB.get( p.getCorrespondingDetectionId() );
527530

528531
// we need to copy the array because it might not be bijective
529532
// (some points in one list might correspond with the same point in the other list)

src/main/java/net/preibisch/bigstitcher/spark/SparkGeometricDescriptorMatching.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.net.URI;
2525
import java.util.ArrayList;
2626
import java.util.Arrays;
27+
import java.util.Collection;
2728
import java.util.HashMap;
2829
import java.util.HashSet;
2930
import java.util.List;
@@ -283,7 +284,7 @@ else if ( ransacIterations == null )
283284
} );
284285

285286
// load & transform all interest points
286-
final Map< ViewId, HashMap< String, List< InterestPoint > > > interestpoints =
287+
final Map< ViewId, HashMap< String, Collection< InterestPoint > > > interestpoints =
287288
TransformationTools.getAllTransformedInterestPoints(
288289
views,
289290
data.getViewRegistrations().getViewRegistrations(),
@@ -299,8 +300,8 @@ else if ( ransacIterations == null )
299300
interestpoints, groups, data.getViewRegistrations().getViewRegistrations(), data.getSequenceDescription().getViewDescriptions() );
300301

301302
System.out.println( Group.pvid( task.vA ) + " (" + task.labelA + ") <=> " + Group.pvid( task.vB ) + " (" + task.labelB + "): Remaining interest points for alignment: " );
302-
for ( final Entry< ViewId, HashMap< String, List< InterestPoint > > > element: interestpoints.entrySet() )
303-
for ( final Entry< String, List< InterestPoint > > subElement : element.getValue().entrySet() )
303+
for ( final Entry< ViewId, HashMap< String, Collection< InterestPoint > > > element: interestpoints.entrySet() )
304+
for ( final Entry< String, Collection< InterestPoint > > subElement : element.getValue().entrySet() )
304305
System.out.println( Group.pvid( element.getKey() ) + ", '" + subElement.getKey() + "' : " + subElement.getValue().size() );
305306
}
306307

@@ -390,7 +391,7 @@ else if ( ransacIterations == null )
390391
} );
391392

392393
// load & transform all interest points
393-
final Map< ViewId, HashMap< String, List< InterestPoint > > > interestpoints =
394+
final Map< ViewId, HashMap< String, Collection< InterestPoint >> > interestpoints =
394395
TransformationTools.getAllTransformedInterestPoints(
395396
views,
396397
data.getViewRegistrations().getViewRegistrations(),
@@ -410,12 +411,12 @@ else if ( ransacIterations == null )
410411
TransformationTools.filterForOverlappingInterestPoints( interestpoints, groups, data.getViewRegistrations().getViewRegistrations(), data.getSequenceDescription().getViewDescriptions() );
411412

412413
System.out.println( task.vA + " (" + task.labelA + ") <=> " + task.vB + " (" + task.labelB + "): Remaining interest points for alignment: " );
413-
for ( final Entry< ViewId, HashMap< String, List< InterestPoint > > > element: interestpoints.entrySet() )
414-
for ( final Entry< String, List< InterestPoint > > subElement : element.getValue().entrySet() )
414+
for ( final Entry< ViewId, HashMap< String, Collection< InterestPoint > > > element: interestpoints.entrySet() )
415+
for ( final Entry< String, Collection< InterestPoint > > subElement : element.getValue().entrySet() )
415416
System.out.println( Group.pvid( element.getKey() ) + ", '" + subElement.getKey() + "' : " + subElement.getValue().size() );
416417
}
417418

418-
final Map< Group< ViewId >, HashMap< String, List< GroupedInterestPoint< ViewId > > > > groupedInterestpoints = new HashMap<>();
419+
final Map< Group< ViewId >, HashMap< String, Collection< GroupedInterestPoint< ViewId > > > > groupedInterestpoints = new HashMap<>();
419420

420421
final InterestPointGroupingMinDistance< ViewId > ipGrouping
421422
= new InterestPointGroupingMinDistance<>( interestPointMergeDistance, interestpoints );

src/main/java/net/preibisch/bigstitcher/spark/SparkResaveN5.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class SparkResaveN5 extends AbstractBasic implements Callable<Void>, Seri
9595

9696
@Option(names = {"-c", "--compression"}, defaultValue = "Zstandard", showDefaultValue = CommandLine.Help.Visibility.ALWAYS,
9797
description = "Dataset compression")
98-
private Compressions compression = null;
98+
private Compressions compressionType = null;
9999

100100
@Option(names = {"-cl", "--compressionLevel" }, description = "compression level, if supported by the codec (default: gzip 1, Zstandard 3, xz 6)")
101101
private Integer compressionLevel = null;
@@ -138,7 +138,7 @@ public Void call() throws Exception
138138
}
139139

140140
final URI n5PathURI = URITools.toURI( this.n5PathURIString == null ? URITools.appendName( URITools.getParentURI( xmlOutURI ), (useN5 ? "dataset.n5" : "dataset.ome.zarr") ) : n5PathURIString );
141-
final Compression compression = N5Util.getCompression( this.compression, this.compressionLevel );
141+
final Compression compression = N5Util.getCompression( this.compressionType, this.compressionLevel );
142142

143143
final int[] blockSize = Import.csvStringToIntArray(blockSizeString);
144144
final int[] blockScale = Import.csvStringToIntArray(blockScaleString);
@@ -150,7 +150,7 @@ public Void call() throws Exception
150150

151151
final N5Writer n5Writer = URITools.instantiateN5Writer( useN5 ? StorageFormat.N5 : StorageFormat.ZARR, n5PathURI );
152152

153-
System.out.println( "Compression: " + this.compression );
153+
System.out.println( "Compression: " + this.compressionType );
154154
System.out.println( "Compression level: " + ( compressionLevel == null ? "default" : compressionLevel ) );
155155
System.out.println( "N5 block size=" + Util.printCoordinates( blockSize ) );
156156
System.out.println( "Compute block size=" + Util.printCoordinates( computeBlockSize ) );

src/main/java/net/preibisch/bigstitcher/spark/SplitDatasets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class SplitDatasets extends AbstractBasic
4141
private boolean disableOptimization = false;
4242

4343
@Option(names = { "-fip", "--fakeInterestPoints" }, description = "add fake interest points to overlapping regions of split images/views")
44-
private boolean fakeInterestPoints = false;
44+
private Split_Views.InterestPointAdding fakeInterestPoints = Split_Views.InterestPointAdding.NONE;
4545

4646
@Option(names = { "--fipDensity" }, description = "density of fake interest points; number of points per 100x100x100 px volume (default: 100.0)")
4747
private double fipDensity = 100.0;

src/main/java/net/preibisch/bigstitcher/spark/abstractcmdline/AbstractBasic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
public abstract class AbstractBasic extends AbstractInfrastructure implements Callable<Void>, Serializable
3838
{
39+
static { net.preibisch.legacy.io.IOFunctions.printIJLog = false; }
40+
3941
private static final long serialVersionUID = -4916959775650710928L;
4042

4143
@Option(names = { "-x", "--xml" }, required = true, description = "Path to the existing BigStitcher project xml, e.g. -x /home/project.xml or -x s3://mybucket/data/dataset.xml or -x file:/home/project.xml")

0 commit comments

Comments
 (0)