Cannot import .nd files via FIJI macro

Hi All,

My problem is that I am unable to make Fiji macro open .nd files on Windows 10. Using drag and drop to the Fiji console, or the open command, or import directly via Bio-Formats (Windowless version likewise) work just fine, but when I record the commands with the macro recorder and try to run it from the script window…

run("Bio-Formats", "open=C:/Data/Test/Sample.nd autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT");

I get this error:

Error:

Sorry, there was a problem during import. in line 1:
		var ; initializeSciJavaParameters ( ) ; run ( "Bio-Formats" , "open=C:/Data/Test/Sample.nd autoscale color_mode=Default...

Log:

loci.formats.FormatException: STK file not found in C:\Data\Test.
	at loci.formats.in.MetamorphReader.initFile(MetamorphReader.java:404)
	at loci.formats.FormatReader.setId(FormatReader.java:1389)
	at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:499)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:142)
	at loci.plugins.in.Importer.showDialogs(Importer.java:140)
	at loci.plugins.in.Importer.run(Importer.java:76)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:229)
	at ij.IJ.runPlugIn(IJ.java:193)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:63)
	at ij.IJ.run(IJ.java:309)
	at ij.IJ.run(IJ.java:320)
	at ij.macro.Functions.doRun(Functions.java:623)
	at ij.macro.Functions.doFunction(Functions.java:97)
	at ij.macro.Interpreter.doStatement(Interpreter.java:270)
	at ij.macro.Interpreter.doStatements(Interpreter.java:256)
	at ij.macro.Interpreter.run(Interpreter.java:152)
	at ij.macro.Interpreter.run(Interpreter.java:91)
	at ij.macro.Interpreter.run(Interpreter.java:102)
	at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
	at ij.IJ.runMacro(IJ.java:148)
	at ij.IJ.runMacro(IJ.java:137)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1108)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1104)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1055)
	at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1104)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:147)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

I am using updated Fiji (ImageJ 1.52n), Bio-Formats 6.1.0, Java 1.8.0_192-b12 on Windows 10.

Of note, importing the .nd file from the macro works under Ubuntu 16.04 in Oracle VM Virtual box on Win 10.
Any suggestions will be appreciated.
Thanks so much,

Attila

Hi Attila,

I’ve gotten similar issues opening .nd2 files in FIJI. Sometimes it’s a file path thing (weird directory organization thing), sometimes I have no idea. i’ve had luck with two things.

  1. moving the nd2 files to another folder and trying to open it again.
  2. Uninstalling and reinstalling the bioformats update site from the FIJI update manager.

Let me know if either of those work.

Best,
Wilson

Hi Wilson,

Thanks for the suggestions!
None of the two worked for me, though. Still getting the same errors.
Bests,

Attila

Hi @attis,

thanks for reporting this. Glad to see some other users of the Metamorph .nd format here. We’re heavy users of this format in our facility, and I sometimes get the impression we’re the only users of this format who encounter quite some issues (1, 2, 3) regarding its support in #bio-formats :smile:

This is a bug in bio-formats that only manifests itself since the macro recorder was changed to record slashes (/) instead of double-backslashes (\\) for paths on Windows.

I noticed and reported the issue about six weeks ago here:

… but it seems there’s no fix yet…


Workaround

Replace C:/Data/Test/Sample.nd in your call by C:\\Data\\Test\\Sample.nd

2 Likes

Hi @imagejan,

Thanks so much for the solution!
It works.

attila

1 Like