import mmcorej.TaggedImage;

import org.json.JSONObject;
import org.micromanager.acquisition.TaggedImageStorageDiskDefault;
import org.micromanager.api.TaggedImageStorage;


public class ReadDataSet {

   public static void main(String[] args) {
      //String rootName = "C:/AcqusitionData/Tests/Test-A_1";
      String rootName = "C:/AcqusitionData/20130813 Oxidative Stress Test 3/NIH3T3_1";
      
      try {
         TaggedImageStorage storage = new TaggedImageStorageDiskDefault(rootName);
         JSONObject summary = storage.getSummaryMetadata();
         System.out.println(summary.toString(3));
         
         int numChannels = summary.getInt("Channels");
         int numSlices = summary.getInt("Slices");
         int numFrames = summary.getInt("Frames");
         int numPositions = summary.getInt("Positions");
         
         for (int pos=0; pos < numPositions; pos++) {
            for (int fr=0; fr<numFrames; fr++) {
               TaggedImage img = storage.getImage(0, 0, fr, pos);
               System.out.println(img.tags.toString(3));
            }
         }
         
      } catch (Exception e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }

   }

}

import mmcorej.TaggedImage;

import org.json.JSONObject;
import org.micromanager.acquisition.TaggedImageStorageDiskDefault;
import org.micromanager.api.MMTags;
import org.micromanager.api.TaggedImageStorage;


public class ReadDataSet {

   public static void main(String[] args) {
      String rootName = "C:/AcqusitionData/Tests/Test-A_1";
      
      try {
         TaggedImageStorage storage = new TaggedImageStorageDiskDefault(rootName);
         JSONObject summary = storage.getSummaryMetadata();
         System.out.println(summary.toString(3));
         
         int numChannels = summary.getInt(MMTags.Summary.CHANNELS);
         int numSlices = summary.getInt(MMTags.Summary.SLICES);
         int numFrames = summary.getInt(MMTags.Summary.FRAMES);
         int numPositions = summary.getInt(MMTags.Summary.POSITIONS);
         
         for (int pos=0; pos < numPositions; pos++) {
            for (int t=0; t<numFrames; t++) {
               for (int z=0; z<numSlices; z++) {
                  for (int ch=0; ch<numChannels; ch++) {
                     TaggedImage img = storage.getImage(ch, z, t, pos);
                     Object pixels = img.pix;
                     // TODO: do something with pixels
                     
                     System.out.println(img.tags.toString(3));
                  }
               }
            }
         }
         
      } catch (Exception e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }

   }

}

Read data set up updated
Read data set up updated

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@11903 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd
