title: How can I call/execute an imageJ macro with R?
body: <p>I've written a macro in imageJ that spits out a data frame which I then analyze in R.   I'd love to be able to have the whole procedure work in R without having to first run the macro manually in imageJ.  Currently the macro prompts the user for the input and output directories and then does it's thing.  I'm thinking there must be a function in R that will allow me to specify the macro and the input and output directories (I could then recode these variables in the macro to somehow take these arguments through the R script?)</p>
  
  <p>I gather that I can use the system() command and found this tantalizing clue from somewhere else on the web:  </p>
  
  <pre><code>system("./JavaApplicationStub  directory file[i] -batch zmacro") 
  </code></pre>
  
  <p>but I am not sure how to implement this (my macro already utilizes batch processing so that part would be unnecessary).  </p>