Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Sep 13, 2024
1 parent c94b29d commit a41f036
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
import org.janelia.saalfeldlab.n5.universe.N5Factory.StorageFormat;

import bdv.export.ExportMipmapInfo;
import bdv.export.ProposeMipmaps;
import fiji.util.gui.GenericDialogPlus;
import ij.gui.GenericDialog;
import mpicbg.spim.data.SpimDataException;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.sequence.FinalVoxelDimensions;
import mpicbg.spim.data.sequence.ViewDescription;
import mpicbg.spim.data.sequence.ViewId;
import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.Dimensions;
import net.imglib2.FinalDimensions;
import net.imglib2.FinalInterval;
import net.imglib2.Interval;
Expand Down Expand Up @@ -648,7 +653,7 @@ else if ( storageType == StorageType.N5 )

final double aniso = fusion.getAnisotropyFactor();
final Interval bb = fusion.getDownsampledBoundingBox();
final int[][] proposedDownsampling = N5ApiTools.estimateMultiResPyramid( new FinalDimensions( bb.dimensionsAsLongArray() ), aniso );
final int[][] proposedDownsampling = estimateMultiResPyramid( new FinalDimensions( bb.dimensionsAsLongArray() ), aniso );

final GenericDialog gdp = new GenericDialog( "Adjust downsampling options" );

Expand Down Expand Up @@ -682,6 +687,15 @@ else if ( storageType == StorageType.N5 )
return true;
}

public static int[][] estimateMultiResPyramid( final Dimensions dimensions, final double aniso )
{
final VoxelDimensions v = new FinalVoxelDimensions( "px", 1.0, 1.0, Double.isNaN( aniso ) ? 1.0 : aniso );
final BasicViewSetup setup = new BasicViewSetup(0, "fusion", dimensions, v );
final ExportMipmapInfo emi = ProposeMipmaps.proposeMipmaps( setup );

return emi.getExportResolutions();
}

private ViewId getViewIdForGroup(
final Group< ? extends ViewId > group,
final int splittingType )
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/net/preibisch/mvrecon/process/n5api/N5ApiTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;

import bdv.export.ExportMipmapInfo;
import bdv.export.ProposeMipmaps;
import mpicbg.spim.data.SpimData;
import mpicbg.spim.data.generic.AbstractSpimData;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;
import mpicbg.spim.data.sequence.FinalVoxelDimensions;
import mpicbg.spim.data.sequence.SetupImgLoader;
import mpicbg.spim.data.sequence.ViewDescription;
import mpicbg.spim.data.sequence.ViewId;
import mpicbg.spim.data.sequence.ViewSetup;
import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.Dimensions;
import net.imglib2.FinalInterval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.Img;
Expand Down Expand Up @@ -146,15 +141,6 @@ else if ( StorageType.HDF5.equals(storageType) )
}
}

public static int[][] estimateMultiResPyramid( final Dimensions dimensions, final double aniso )
{
final VoxelDimensions v = new FinalVoxelDimensions( "px", 1.0, 1.0, Double.isNaN( aniso ) ? 1.0 : aniso );
final BasicViewSetup setup = new BasicViewSetup(0, "fusion", dimensions, v );
final ExportMipmapInfo emi = ProposeMipmaps.proposeMipmaps( setup );

return emi.getExportResolutions();
}

public static class MultiResolutionLevelInfo implements Serializable
{
private static final long serialVersionUID = 5392269335394869108L;
Expand Down Expand Up @@ -455,34 +441,6 @@ else if ( dataType == DataType.FLOAT32 )
}
}

/*
public static ArrayList<long[][]> assembleJobs(
final Collection< ? extends ViewId > viewIds,
final Map< ViewId, MultiResolutionLevelInfo[] > viewIdToMrInfo,
final int level )
{
// all blocks (a.k.a. grids) across all ViewId's
final ArrayList<long[][]> allBlocks = new ArrayList<>();
viewIds.forEach( viewId -> allBlocks.addAll( assembleJobs( viewId, viewIdToMrInfo.get( viewId )[ level ] ) ) );
return allBlocks;
}
public static ArrayList<long[][]> assembleJobs(
final Collection< ? extends ViewId > viewIds,
final Map< ViewId, MultiResolutionLevelInfo[] > viewIdToMrInfo,
final int level,
final int[] computeBlockSize )
{
// all blocks (a.k.a. grids) across all ViewId's
final ArrayList<long[][]> allBlocks = new ArrayList<>();
viewIds.forEach( viewId -> allBlocks.addAll( assembleJobs( viewId, viewIdToMrInfo.get( viewId )[ level ], computeBlockSize ) ) );
return allBlocks;
}*/

public static ArrayList<long[][]> assembleJobs( final MultiResolutionLevelInfo mrInfo )
{
return assembleJobs( null, mrInfo );
Expand Down

0 comments on commit a41f036

Please sign in to comment.