Changes between Initial Version and Version 1 of Matlab


Ignore:
Timestamp:
06/08/10 19:25:52 (10 years ago)
Author:
melissa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Matlab

    v1 v1  
     1= Reading files = 
     2 
     3This section assumes that you have installed the bfopen.m script and loci_tools.jar, as instructed [http://www.loci.wisc.edu/bio-formats/matlab here]. 
     4 
     5The first thing to do is initialize a file: 
     6 
     7{{{ 
     8  data = bfopen('/path/to/data/file'); 
     9}}}  
     10 
     11'data' is an array whose structure is a bit complicated.  It is an n-by-3 array, where n is the number of series in the dataset.  The [s, 1] element (if s is the series index between 1 and n) is an m-by-2 array, where m is the number of planes in the series.  The [s, 1, t, 1] element (where t is the image index between 1 and m) contains the pixel data for the t-th image in the s-th series.  The [s, 1, t, 2] element contains the label for said image. 
     12 
     13The [s, 2] element of 'data' contains metadata key/value pairs that apply to the s-th series.  The [s, 3] element of 'data' contains color lookup tables for each image in the series. 
     14 
     15== Displaying images == 
     16 
     17If you want to display one of the images, you can do so as follows: 
     18 
     19{{{ 
     20  series1 = data{1, 1}; 
     21  series1_plane1 = series1{1, 1}; 
     22  series1_label1 = series1{1, 2}; 
     23  series1_colorMaps = data{1, 3}; 
     24  figure('Name', series1_label1); 
     25  if (isempty(series1_colorMaps{1}) 
     26    colorMap(gray); 
     27  else 
     28    colorMap(series1_colorMaps{1}); 
     29  end 
     30  imagesc(series1_plane1); 
     31}}} 
     32 
     33This will display the first image of the first series with its associated color map (if present).  If you would prefer not to apply the color maps associated with each image, simply comment out the calls to 'colorMap'. 
     34 
     35== Retrieving metadata == 
     36 
     37To retrieve the metadata value for a specific key: 
     38 
     39{{{ 
     40  metadata = data{1, 2}; 
     41  bitsPerPixel = metadata.get('Bits per pixel'); 
     42}}} 
     43 
     44To print out all of the metadata key/value pairs for the first series: 
     45 
     46{{{ 
     47  metadata = data{1, 2}; 
     48  for i=1:size(metadata) 
     49    fprintf('%s = %s\n', metadata[1], metadata[2]) 
     50  end 
     51}}} 
     52 
     53= Saving files =