Skip to content

Commit

Permalink
add virtual option for SimView loader
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Jun 28, 2024
1 parent ac14e24 commit 715dca6
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

import ij.ImagePlus;
import ij.ImageStack;
import ij.VirtualStack;
import ij.io.FileInfo;
import ij.plugin.FileInfoVirtualStack;
import ij.plugin.Raw;
import mpicbg.spim.data.generic.sequence.AbstractSequenceDescription;
import mpicbg.spim.data.generic.sequence.BasicViewDescription;
Expand Down Expand Up @@ -58,6 +60,8 @@

public class SimViewSetupImgLoader implements SetupImgLoader< UnsignedShortType >
{
public static boolean virtual = true;

final int setupId;
final AbstractSequenceDescription<?, ?, ?> sequenceDescription;
final File expDir;
Expand Down Expand Up @@ -134,14 +138,23 @@ else if ( type == 1 )
t.getId(), c.getId(), cam, angle, 0,
patternParser.numDigitsTimepoints, patternParser.numDigitsChannels, patternParser.numDigitsCams, patternParser.numDigitsAngles, 0)[0] );

IOFunctions.println( new Date( System.currentTimeMillis() ) + ": Loading file " + rawFile.getAbsolutePath() );

fi.nImages = (int)vs.getSize().dimension( 2 );

System.out.println( fi );

//final VirtualStack virtual = new FileInfoVirtualStack(fi);
imp = Raw.open( rawFile.getAbsolutePath(), fi );
if ( virtual )
{
IOFunctions.println( new Date( System.currentTimeMillis() ) + ": Loading file " + rawFile.getAbsolutePath() + " (virtually)");

final VirtualStack stack = new FileInfoVirtualStack( fi );
imp = new ImagePlus(rawFile.getAbsolutePath(), stack);
}
else
{
IOFunctions.println( new Date( System.currentTimeMillis() ) + ": Loading file " + rawFile.getAbsolutePath() );

imp = Raw.open( rawFile.getAbsolutePath(), fi );
}

if ( imp == null )
throw new RuntimeException( "Could not load viewId=" + view.getViewSetupId() + ", tpId=" + view.getTimePointId() + " file=" + rawFile.getAbsolutePath() );
Expand Down

0 comments on commit 715dca6

Please sign in to comment.