Page 1 of 1

Opening filename containing spaces

PostPosted: Tue Oct 09, 2018 11:44 am
by kostermw
Before submitting a bug I like to ask if this is a known limitation.

I can open files interactively on Windows 10 using the Bio-formats plugin (I have installed Version 5-sept-2018).
It also doesn't seem to matter if I read from local drive, network shares or use UNC notation. Also filenames containing spaces open without issues. When using the ImageJ macro extensions, however, the opening of filenames containing spaces fail. I get a dialog box from the Bio-formats importer displaying: Sorry there was an I/O problem during import.

Is that expected behaviour?

Here's a code snipppet I use:

run("Bio-Formats Macro Extensions");
run("Bio-Formats","open=" + filename + " autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT" );

Re: Opening filename containing spaces

PostPosted: Wed Oct 10, 2018 9:46 am
by dgault
It should be possible to open files with spaces in them, do you have the square brackets around the filename?

run("Bio-Formats","open=[C:\\Path\\To\\File\\my sample file.tiff] autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT" );

A good test might be to select to record a macro and open the file interactively, then you can compare the generated macro code to ensure it is correct. If it is still failing though you can submit a sample file for testing to https://www.openmicroscopy.org/qa2/qa/upload/.

Re: Opening filename containing spaces

PostPosted: Thu Oct 11, 2018 4:10 pm
by kostermw
Ah that makes a difference. Got a bit confused since when I used the open command interactively then also the bio-formats importer is invoked, but this generates (recording);

Code: Select all
open("D:/temp/cslm-test/T EST/20x1 001.czi");


While developing/creating the macro I therefor copied/pasted bits and pieces, but had never noticed brackets. If I use plugins->bio-formats->bio-formats importer then indeed brackets are included (but only if there were spaces in the file name);

Code: Select all
run("Bio-Formats Importer", "open=[D:/temp/cslm-test/T EST/20x1 001.czi] autoscale color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT");


Problem solved! Thanks for your help :D