Skip to content

Commit

Permalink
allow hack to assing old tile id's as illumination id in split dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed May 10, 2024
1 parent 91993ed commit d815f8a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

public class SplittingTools
{
public static boolean assingIlluminationsFromTileIds = false;

public static SpimData2 splitImages( final SpimData2 spimData, final long[] overlapPx, final long[] targetSize, final long[] minStepSize, final boolean optimize )
{
final TimePoints timepoints = spimData.getSequenceDescription().getTimePoints();
Expand Down Expand Up @@ -101,6 +103,11 @@ public static SpimData2 splitImages( final SpimData2 spimData, final long[] over
// so each new one has to be the same across channel & illumination!
final int maxIntervalSpread = maxIntervalSpread( oldSetups, overlapPx, targetSize, minStepSize, optimize );

// check that there is only one illumination
if ( assingIlluminationsFromTileIds )
if ( spimData.getSequenceDescription().getAllIlluminationsOrdered().size() > 1 )
throw new IllegalArgumentException( "Cannot SplittingTools.assingIlluminationsFromTileIds because more than one Illumination exists." );

for ( final ViewSetup oldSetup : oldSetups )
{
final int oldID = oldSetup.getId();
Expand Down Expand Up @@ -139,7 +146,8 @@ public static SpimData2 splitImages( final SpimData2 spimData, final long[] over
final int newTileId = oldTile.getId() * maxIntervalSpread + localNewTileId;
localNewTileId++;
final Tile newTile = new Tile( newTileId, Integer.toString( newTileId ), location );
final ViewSetup newSetup = new ViewSetup( newId, null, newDim, voxDim, newTile, channel, angle, illum );
final Illumination newIllum = assingIlluminationsFromTileIds ? new Illumination( oldTile.getId(), "old_tile_" + oldTile.getId() ) : illum;
final ViewSetup newSetup = new ViewSetup( newId, null, newDim, voxDim, newTile, channel, angle, newIllum );
newSetups.add( newSetup );

// update registrations and interest points for all timepoints
Expand Down

0 comments on commit d815f8a

Please sign in to comment.