Login  Register

Re: Opening Zeiss LSM files in a macro

Posted by Bertrand Vernay on Mar 25, 2010; 10:03am
URL: http://imagej.273.s1.nabble.com/Threshold-Selection-Macro-problem-tp3688803p3688806.html

Thanks Jerome

Problem solved.

Bertrand

//
// This macro batch processes all the lsm files in a folder and any
// subfolders in that folder. In this example, it saves the files
// as TIFF files.

 dir1 = getDirectory("Choose a Directory ");
 dir2 = getDirectory("Choose Destination Directory");  
setBatchMode(true);
 
list = getFileList(dir1);
      for (i=0; i<list.length; i++) {
           path = dir1 + list[i];
        run("Show LSMToolbox","ext"); // only once in your macro
path="c:\\test.lsm"
        Ext.lsmOpen(path);
           saveAs("Tiff", dir2+list[i]);
           close();
      }
setBatchMode(false);


--
Dr Bertrand Vernay
Microscopy Senior Research Associate
Developmental Biology Unit
UCL Institute of Child Health
30 Guilford Street
London WC1N 1EH, UK

Tel :  (+44)  020 7905 2224 (direct line)
       (+44)  020 7242 9789 (ICH switchboard)

Fax:    (+44)  020 7831 4366

E-mail: [hidden email]

http://www.ich.ucl.ac.uk/services_and_facilities/lab_services/confocal_micro
scopy_core_facility/index.html
-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Jerome
Mutterer
Sent: 24 March 2010 17:11
To: [hidden email]
Subject: Re: Opening Zeiss LSM files in a macro

Bertrand,

You can do that using the lsm macro extensions provided to the macro
language by the LSM Toolbox plugin. This is how it works:

run("Show LSMToolbox","ext"); // only once in your macro
path="c:\\test.lsm";
Ext.lsmOpen(path);

you can get the LSM Toolbox from:
http://imagejdocu.tudor.lu/doku.php?id=plugin:inputoutput:lsmtoolbox:start

Jerome


On Wed, Mar 24, 2010 at 5:13 PM, Bertrand Vernay
<[hidden email]>wrote:

> Dear all
>
> I do not manage to open .lsm5 files when running a macro using the
> open(path) command. The macro works fine with tiff files. ImageJ does open
> the LSM5 file without problem otherwise (drag and drop or File>Open ...).
>
> I'm sure it is an easy fix but beyond my limited macro programming skills.
>
> Thanks for your help
>
> I'm using the version 1.43r
>
> --
> Dr Bertrand Vernay
> Microscopy Senior Research Associate
> Developmental Biology Unit
> UCL Institute of Child Health
> 30 Guilford Street
> London WC1N 1EH, UK
>
> Tel :  (+44)  020 7905 2224 (direct line)
>       (+44)  020 7242 9789 (ICH switchboard)
>
> Fax:    (+44)  020 7831 4366
>
> E-mail: [hidden email]
>
>
>
http://www.ich.ucl.ac.uk/services_and_facilities/lab_services/confocal_micro
> scopy_core_facility/index.html
>
>