Skip to content

Commit

Permalink
Second attempt at file separator fix - now using InputStream
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Stefko committed Jul 6, 2017
1 parent 0c8c584 commit 97ce448
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ch/epfl/leb/injector/TiffParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import ij.ImageStack;
import ij.io.Opener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
Expand Down Expand Up @@ -56,7 +59,7 @@ public TiffParser(Studio studio, long frameLengthMs, InjectorSetupWindow setup_w
this.setup_window = setup_window;
}

public final void loadGeneralTiff(File file) {
public final void loadGeneralTiff(File file) throws FileNotFoundException, IOException {
// Set up progressbar
window.setProgress(0);
SwingUtilities.invokeLater( new Runnable() {
Expand All @@ -67,8 +70,15 @@ public void run() {
});
// Open the tiff via ImageJ
app.logs().logMessage("Trying to open general tiff.");
Opener o = new Opener();
ImagePlus win = o.openTiff(file.getParent(),file.getName());
InputStream input_stream = new FileInputStream(file);
ImagePlus win;
try {
Opener o = new Opener();
win = o.openTiff(input_stream,"InjectorStack");
} finally {
input_stream.close();
}

ImageStack stack = win.getImageStack();
// Build up metadata from scratch
m_builder = app.data().getMetadataBuilder();
Expand Down

0 comments on commit 97ce448

Please sign in to comment.