Changeset 7554


Ignore:
Timestamp:
01/20/11 12:18:59 (9 years ago)
Author:
curtis
Message:

Add variable for controlling number of channels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/utils/MinimumWriter.java

    r6881 r7554  
    3131    // create blank 512x512 image 
    3232    System.out.println("Creating random image..."); 
    33     int w = 512, h = 512; 
     33    int w = 512, h = 512, c = 1; 
    3434    int pixelType = FormatTools.UINT16; 
    35     byte[] img = new byte[w * h * FormatTools.getBytesPerPixel(pixelType)]; 
     35    byte[] img = new byte[w * h * c * FormatTools.getBytesPerPixel(pixelType)]; 
    3636 
    3737    // fill with random data 
     
    5555    meta.setPixelsSizeY(new PositiveInteger(h), 0); 
    5656    meta.setPixelsSizeZ(new PositiveInteger(1), 0); 
    57     meta.setPixelsSizeC(new PositiveInteger(1), 0); 
     57    meta.setPixelsSizeC(new PositiveInteger(c), 0); 
    5858    meta.setPixelsSizeT(new PositiveInteger(1), 0); 
    5959    meta.setChannelID("Channel:0:0", 0, 0); 
    60     meta.setChannelSamplesPerPixel(new PositiveInteger(1), 0, 0); 
     60    meta.setChannelSamplesPerPixel(new PositiveInteger(c), 0, 0); 
    6161 
    6262    // write image plane to disk 
Note: See TracChangeset for help on using the changeset viewer.