Open .nc files in a loop and convert them to tiff files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Open .nc files in a loop and convert them to tiff files

anants
I've a simple two line code to open a .nc files. I don't know where I'm doing
wrong but it's not working. The folder contains 73 nc files, but I'm
intended to open only 10 now. Please help me debugging the error.

Sirija.

<http://imagej.1557.x6.nabble.com/file/t382071/Capture.png>

and the code is

  dir = getDirectory("Choose a Directory ");
  count = 1;


     for (i=0; i<10; i++) {
        run("Load NetCDF File", "open=/"+dir+"block0000000"+i+".nc"" 3d");
     }



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Open .nc files in a loop and convert them to tiff files

George Patterson
Hi Sirija,
You may need to concatenate the " 3d" into the rest of that string.
Try an edit like this

run("Load NetCDF File", "open=/"+dir+"block0000000"+i+".nc"+" 3d");

Check out this thread for an explanation.

http://imagej.1557.x6.nabble.com/NetCDF-plugin-td3686714.html

Best,
George


On Tue, Aug 14, 2018 at 1:51 PM, anants <[hidden email]> wrote:

> I've a simple two line code to open a .nc files. I don't know where I'm
> doing
> wrong but it's not working. The folder contains 73 nc files, but I'm
> intended to open only 10 now. Please help me debugging the error.
>
> Sirija.
>
> <http://imagej.1557.x6.nabble.com/file/t382071/Capture.png>
>
> and the code is
>
>   dir = getDirectory("Choose a Directory ");
>   count = 1;
>
>
>      for (i=0; i<10; i++) {
>         run("Load NetCDF File", "open=/"+dir+"block0000000"+i+".nc""
> 3d");
>      }
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Open .nc files in a loop and convert them to tiff files

Straatman, Kees (Dr.)
In reply to this post by anants
Dear Sirija,

I don't know this file format but maybe this discussion at http://imagej.1557.x6.nabble.com/NetCDF-plugin-td3686714.html helps to solve your problem?

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of anants
Sent: 14 August 2018 18:52
To: [hidden email]
Subject: Open .nc files in a loop and convert them to tiff files

I've a simple two line code to open a .nc files. I don't know where I'm doing wrong but it's not working. The folder contains 73 nc files, but I'm intended to open only 10 now. Please help me debugging the error.

Sirija.

<http://imagej.1557.x6.nabble.com/file/t382071/Capture.png>

and the code is

  dir = getDirectory("Choose a Directory ");
  count = 1;


     for (i=0; i<10; i++) {
        run("Load NetCDF File", "open=/"+dir+"block0000000"+i+".nc"" 3d");
     }



--
Sent from: http://imagej.1557.x6.nabble.com/

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

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