Login  Register

Re: trying to open czi files always opens entire set of files in directory

Posted by Douglas Richardson on Nov 18, 2015; 11:08pm
URL: http://imagej.273.s1.nabble.com/trying-to-open-czi-files-always-opens-entire-set-of-files-in-directory-tp5014974p5014976.html

Hi Michael,

Here is a macro we wrote that breaks the .czi file into multiple .tif
stacks.  It will create a folder in your indicated output directory for
each channel and will place a file for each timepoint and view/angle in
those folders:

http://hcbi.fas.harvard.edu/lightsheet-czi-tif-converter-timelapsemultiview

If you don't want to process the entire file, the following macro command
lets you open specific timepoints/views:

//Angle = a variable representing the view/angle you want to open
//Time = a variable representing the timepoint you want to open
//This defaults to open all channels, but you could also specify individual
channels.

run("Bio-Formats Importer", "open=" + filePath + " color_mode=Grayscale
specify_range view=Hyperstack stack_order=XYCZT series_" + Angle + "
t_begin_" + Angle + "=" + Time + " t_end_" + Angle + "=" + Time + "
t_step_" + Angle + "=1");



Hope this helps,

-Doug

On Wed, Nov 18, 2015 at 5:34 PM, Cammer, Michael <[hidden email]
> wrote:

> We are having a problem with LOCI tools opening .czi files from Zeiss
> Lightsheet.Z1.  The problem is that when we select any single file, LOCI
> attempts to open all the files into one big dataset.
>
>
>
> The directory is full of multichannel Z series each recorded at a
> sequential timepoint.
>
>
>
> We want to open each one individually, process it, and then save a new tif
> file with the processed data.
>
>
>
> The problem is that LOCI always tries to open the entire sequence at once.
>
>
>
> We have tried different options such as
>
>   openPath = getDirectory("Choose a Directory");
>   fileList = getFileList(openPath);
>   for (i=0; i<fileList.length; i++) {
>     if ( (endsWith(fileList[i], ".czi")) || (endsWith(fileList[i], ".nd2"
> )) ) {
>        run("Bio-Formats Importer", "open='" + openPath + fileList[i] + "'
> color_mode=Default view=[Standard ImageJ] stack_order=Default ");
>
>
>
> where we expected "Standard ImageJ" to be the least likely to open
> multiple files at once.
>
>
>
> We've found that renaming files works so that they don't make a sequence,
> but with a lot of files, changing the root name is not practical.
> Actually, renaming the first file on one of our computers works for the
> entire sequence but not on another one!  We have tried old versions and
> today's daily build of LOCI plugins.
>
>
>
> Is there a way to turn off opening multiple files?
>
>
>
> Any help appreciated.  Including if there is a way from Zen to do this,
> but it only appears to have options to write out individual tifs or the
> entire volume, not the individual Z stacks.
>
>
>
> What the directory looks like:
>
>
>
>  Directory of E:\SWAP\20151109\overnight_20151109to10\view2
>
> 11/09/2015  06:24 PM     3,023,376,608 Covernight_G2(1).czi
> 11/09/2015  06:52 PM     3,023,330,432 Covernight_G2(10).czi
> 11/10/2015  12:52 AM     3,023,240,544 Covernight_G2(100).czi
> ...
> 11/10/2015  12:44 AM     3,023,205,920 Covernight_G2(98).czi
> 11/10/2015  12:48 AM     3,023,393,600 Covernight_G2(99).czi
> 11/10/2015  07:24 AM     3,023,266,784 Covernight_G2.czi
> 11/10/2015  07:24 AM             4,687 Covernight_G2.queue
>              201 File(s) 604,661,886,415 bytes
>                2 Dir(s)  4,414,754,717,696 bytes free
>
> Thank you!!
>
>
>
>
> _________________________________________
> Michael Cammer, Optical Microscopy Specialist
> http://ocs.med.nyu.edu/microscopy
> http://microscopynotes.com/
> Cell: (914) 309-3270
>
> ------------------------------------------------------------
> This email message, including any attachments, is for the sole use of the
> intended recipient(s) and may contain information that is proprietary,
> confidential, and exempt from disclosure under applicable law. Any
> unauthorized review, use, disclosure, or distribution is prohibited. If you
> have received this email in error please notify the sender by return email
> and delete the original message. Please note, the recipient should check
> this email and any attachments for the presence of viruses. The
> organization accepts no liability for any damage caused by any virus
> transmitted by this email.
> =================================
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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