Problem with batch processing .ser files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with batch processing .ser files

fuSi0n
I modified the batch convert template to batch open .ser images from a folder and it's subfolders. However, just after the opener I receive the message that the file is not supported and the reader plugin is
not available. Running the plugin manually is not a problem and the files can be opened.
The problem sounds trivial but i cannot find the error.

here is the code.

  dir = getDirectory("Choose a Directory ");
   setBatchMode(true);
   count = 0;
   countFiles(dir);
   n = 0;
   processFiles(dir);
   //print(count+" files processed");
   
   function countFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              countFiles(""+dir+list[i]);
          else
              count++;
      }
  }

   function processFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              processFiles(""+dir+list[i]);
          else {
             showProgress(n++, count);
             path = dir+list[i];
             processFile(path);
          }
      }
  }

  function processFile(path) {
       if (endsWith(path, ".ser")) {
           open(path);
           run("TIA Reader")
          close(path);
      }
  }

Best,
Christopher
Reply | Threaded
Open this post in threaded view
|

Re: Problem with batch processing .ser files

Krs5
Dear Christopher,

Your line 'open(path') in  'function processFile(path)' will try to open the .ser image using the default options and is not using the TIA reader hence the error that the file is not a supported format. I don't know how the TIA reader works and which parameters have to be included in 'run("TIA Reader")' so not sure if just deleting 'open(path)' will solve the problem.

Best wishes

Kees

Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of fuSi0n
Sent: 07 June 2017 12:37
To: [hidden email]
Subject: Problem with batch processing .ser files

I modified the batch convert template to batch open .ser images from a folder and it's subfolders. However, just after the opener I receive the message that the file is not supported and the reader plugin is not available. Running the plugin manually is not a problem and the files can be opened.
The problem sounds trivial but i cannot find the error.

here is the code.

  dir = getDirectory("Choose a Directory ");
   setBatchMode(true);
   count = 0;
   countFiles(dir);
   n = 0;
   processFiles(dir);
   //print(count+" files processed");
   
   function countFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              countFiles(""+dir+list[i]);
          else
              count++;
      }
  }

   function processFiles(dir) {
      list = getFileList(dir);
      for (i=0; i<list.length; i++) {
          if (endsWith(list[i], "/"))
              processFiles(""+dir+list[i]);
          else {
             showProgress(n++, count);
             path = dir+list[i];
             processFile(path);
          }
      }
  }

  function processFile(path) {
       if (endsWith(path, ".ser")) {
           open(path);
           run("TIA Reader")
          close(path);
      }
  }

Best,
Christopher



--
View this message in context: http://imagej.1557.x6.nabble.com/Problem-with-batch-processing-ser-files-tp5018854.html
Sent from the ImageJ mailing list archive at Nabble.com.

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

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