title: Setting different thresholds dependent on what filename ends with in ImageJ macro
body: <p>I have a folder containing many images. These are grouped into sets of three images where one filename ends in <code>dsRed).tif</code>, another filename ends in <code>FITC).tif</code> and the other filename ends in <code>DAPI).tif</code>.</p>
  
  <p>How can I tell ImageJ to do different stuff to each image dependent on which filename ending it has?</p>
  
  <p>I have tried to set up macros to run different thresholds, e.g.:</p>
  
  <pre><code>//run("Brightness/Contrast...");
  setMinAndMax(0, 20000);
  close();
  </code></pre>
  
  <p>to the different filenames based on scripts found here:
  <a href="http://imagej.1557.x6.nabble.com/open-file-with-specific-partial-name-td5002910.html" rel="nofollow">http://imagej.1557.x6.nabble.com/open-file-with-specific-partial-name-td5002910.html</a>
  and here:
  <a href="http://rsb.info.nih.gov/ij/macros/Batch_RGB_Merge.txt" rel="nofollow">http://rsb.info.nih.gov/ij/macros/Batch_RGB_Merge.txt</a> but I am having trouble with formatting if else functions with my three filename endings.</p>