We're Hiring!

Opening filename containing spaces

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

Opening filename containing spaces

Postby kostermw » Tue Oct 09, 2018 11:44 am

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" );
kostermw
 
Posts: 3
Joined: Fri Oct 05, 2018 9:01 pm

Re: Opening filename containing spaces

Postby dgault » Wed Oct 10, 2018 9:46 am

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/.
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: Opening filename containing spaces

Postby kostermw » Thu Oct 11, 2018 4:10 pm

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
kostermw
 
Posts: 3
Joined: Fri Oct 05, 2018 9:01 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest