Login  Register

Re: spaces in path with Bioformats

Posted by ctrueden on Jul 16, 2014; 7:14pm
URL: http://imagej.273.s1.nabble.com/spaces-in-path-with-Bioformats-tp5008616p5008779.html

Hi Aryeh,

> I find that the spaces in the path cause the BIo-Formats macro
> extensions to fail

I cannot reproduce this problem on my OS X 10.9 system.

Running this macro in the Script Editor:

https://github.com/openmicroscopy/bioformats/blob/v5.0.2/components/bio-formats-plugins/utils/macros/basicMetadata.txt

And selecting a file with path "/Users/curtis/Desktop/foo bar/2 ch ZT.lsm",
it prints the metadata to the ImageJ Log window as expected.

If you can create a minimal, complete, verifiable example [1], then please
pass it on to the Bio-Formats developers using the ome-users mailing list
[2].

Regards,
Curtis

[1] http://stackoverflow.com/help/mcve
[2] http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users/


On Mon, Jul 14, 2014 at 11:36 PM, Aryeh Weiss <[hidden email]> wrote:

>  Hi Curtis,
>
> I am starting to migrate to python, but it is still much faster for me to
> use (or reuse) parts  of scripts which I have already written. It is also
> easier for me to give macro scripts to people who ask me for assistance.
>
> Best regards,
> --aryeh
>
>
> On 7/14/14, 11:31 PM, Curtis Rueden wrote:
>
> Hi Aryeh,
>
>  > I find that the spaces in the path cause the BIo-Formats macro
> > extensions to fail
>
>  I did not have time to delve into what causes this bug, but perhaps the
> whole issue could be avoided by using any scripting language besides ImageJ
> macros? If you did that, you could call the Bio-Formats API directly; see:
> http://fiji.sc/Bio-Formats#Scripting
>
>  Regards,
> Curtis
>
>
> On Tue, Jul 8, 2014 at 4:14 AM, Aryeh Weiss <[hidden email]> wrote:
>
>> I have an external disk whose designation includes spaces. I am running
>> OSX 10.9.
>> I find that the spaces in the path cause the BIo-Formats macro extensions
>> to fail,
>> I tried escaping the spaces, as in:
>>
>> newInputPath = replace(inputPath," ", "\\\\ ");
>> Ext.setId(inputPath);
>>
>> and I tried enclosing the path in square brackets, as in:
>> Ext.setId("["+inputPath+"]");
>>
>> but neither of these worked.
>>
>> As a workaround, I set up a symlink to the mount point, and then replaced
>> the path, as in:
>> if (indexOf(inputPath,"Seagate Expansion Drive") > 0) {
>>     inputPath = replace(inputPath, "Seagate Expansion Drive", "seagate");
>> }
>>
>>
>> and this works fine, but it is a hack.
>>
>> I prefer one (or both) of two options:
>>
>> 1. Get the extensions to accept the original path with spaces.
>> 2. Get OSX to mount the disk by default with a mount directory whose name
>> does not include spaces.
>>
>> The second option is not about ImageJ, but maybe there are people on this
>> list who knowhow to do that.
>>
>> Thank in advance for your help.
>>
>> --aryeh
>>
>> --
>> Aryeh Weiss
>> Faculty of Engineering
>> Bar Ilan University
>> Ramat Gan 52900 Israel
>>
>> Ph:  972-3-5317638
>> FAX: 972-3-7384051
>>
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
>
>
> --
> Aryeh Weiss
> Faculty of Engineering
> Bar Ilan University
> Ramat Gan 52900 Israel
>
> Ph:  972-3-5317638
> FAX: 972-3-7384051
>
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html