Changeset 3393


Ignore:
Timestamp:
11/20/07 16:16:42 (12 years ago)
Author:
curtis
Message:

Bugfixes and corrections for 2003 (FC) version.

Location:
trunk/loci/formats/auto
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/auto/MetadataAutogen.java

    r3386 r3393  
    202202        String version = line.substring(0, colon).trim(); 
    203203        String path = line.substring(colon + 1).trim(); 
    204         node.paths.put(version, path); 
     204        if (version.equalsIgnoreCase("Default")) { 
     205          // populate all known versions with the default 
     206          Enumeration en = versions.keys(); 
     207          while (en.hasMoreElements()) { 
     208            String key = (String) en.nextElement(); 
     209            if (!node.paths.contains(key)) node.paths.put(key, path); 
     210          } 
     211        } 
     212        else node.paths.put(version, path); 
    205213        continue; 
    206214      } 
     
    272280      String value = (String) node.paths.get(key); 
    273281      // OME-XML implementation 
    274       doHelpers("ome/OMEXML" + key + "Metadata.java", value); 
     282      doHelpers("ome/OMEXML" + key + "Metadata.java", value, key); 
    275283    } 
    276284  } 
     
    379387        else { 
    380388          String varName = toVarName(last); 
    381           lt.add("    " + last + "Node " + varName + 
    382             " = get" + last + "("); 
     389          lt.add("    " + last + "Node " + varName + " = get" + last + "("); 
    383390          for (int j=0; j<isize; j++) { 
    384391            Param pj = (Param) indices.get(j); 
     
    388395          lt.newline(); 
    389396          String ante = "    return " + varName + " == null ? null :"; 
    390           String cons = varName + ".get" + pi.name + "();"; 
     397          String cons = varName + "." + 
     398            (pi.type.equals("Boolean") ? "is" : "get") + mappedName + "();"; 
    391399          if (ante.length() + cons.length() <= 79) { 
    392400            lt.add(ante + " " + cons); 
     
    553561 
    554562  /** Generates helper methods for the given node and source file. */ 
    555   private static void doHelpers(String id, String path) throws IOException { 
     563  private static void doHelpers(String id, 
     564    String path, String version) throws IOException 
     565  { 
    556566    // only generate each path's helper method once 
    557567    if (helpers.contains(id + ":" + path)) return; 
     
    573583    Vector indices = getIndices(path); 
    574584    int isize = indices.size(); 
     585 
     586    if (last.equals("-")) return; // unsupported node type for this version 
     587 
     588    // parse version-specific configuration 
     589    Hashtable vars = (Hashtable) versions.get(version); 
     590    boolean legacy = "true".equals(vars.get("legacy")); 
    575591 
    576592    // method signature 
     
    627643      lt.add("    // get " + token + " node"); 
    628644      lt.newline(); 
     645      boolean ca = pVar.equals("ca"); 
    629646      if (token.equals("CA")) token = "CustomAttributes"; 
    630647      if (multi) { 
    631648        lt.add("    ndx = i2i(" + var + "Index);"); 
    632649        lt.newline(); 
    633         lt.add("    count = " + pVar + ".count" + token + "List();"); 
     650        if (ca) { 
     651          lt.add("    count = " + pVar + ".countCAList(\"" + token + "\");"); 
     652        } 
     653        else if (legacy) { 
     654          lt.add("    count = " + pVar + ".count" + token + "List();"); 
     655        } 
     656        else lt.add("    count = " + pVar + ".get" + token + "Count();"); 
    634657        lt.newline(); 
    635658        lt.add("    if (!create && ndx >= count) return null;"); 
     
    649672          lt.newline(); 
    650673        } 
    651         lt.add("    list = " + pVar + ".get" + token + "List();"); 
     674        if (ca) { 
     675          lt.add("    list = " + pVar + "." + "getCAList(\"" + token + "\");"); 
     676        } 
     677        else lt.add("    list = " + pVar + ".get" + token + "List();"); 
    652678        lt.newline(); 
    653679        lt.add("    " + token + "Node " + var + 
     
    656682      } 
    657683      else { 
    658         lt.add("    " + token + "Node " + var + 
    659           " = " + pVar + ".get" + token + "();"); 
     684        if (ca || ref) { 
     685          lt.add("    " + token + "Node " + var + " = null;"); 
     686          lt.newline(); 
     687          if (ca) lt.add("    count = ca.countCAList(\"" + token + "\");"); 
     688          else lt.add("    count = " + pVar + ".count" + token + "List();"); 
     689          lt.newline(); 
     690          lt.add("    if (count >= 1) {"); 
     691          lt.newline(); 
     692          lt.add("      " + var + " = (" + token + "Node)"); 
     693          if (ca) { 
     694            lt.add(" ca.getCAList(\"" + token + "\").get(0);", "        "); 
     695          } 
     696          else { 
     697            lt.add(" " + pVar + ".get" + token + "List().get(0);", "        "); 
     698          } 
     699          lt.newline(); 
     700          lt.add("    }"); 
     701        } 
     702        else { 
     703          lt.add("    " + token + "Node " + var + 
     704            " = " + pVar + ".get" + token + "();"); 
     705        } 
    660706        lt.newline(); 
    661707        lt.add("    if (" + var + " == null) {"); 
  • trunk/loci/formats/auto/MetadataAutogenGlobal.txt

    r3383 r3393  
    2727subPackage = ome 
    2828version = 2007-06 
     29legacy = false 
    2930 
    3031[2003FC] 
     
    3435subPackage = st 
    3536version = 2003 (FC) 
     37legacy = true 
    3638 
    3739[-] 
  • trunk/loci/formats/auto/MetadataAutogenNodes.txt

    r3385 r3393  
    2424an image in the metadata store with a particular index 
    2525- 
    26 200706: Image+ 
    27 2003FC: Image+ 
     26Default: Image+ 
    2827String Name          the full name of the image 
    2928String CreationDate  the creation date of the image 
     29*2003FC: Created 
    3030String Description   the full description of the image 
    3131 
     
    3333an experimenter in the metadata store with a particular index 
    3434- 
    35 200706: Experimenter+ 
     35Default: Experimenter+ 
    36362003FC: CA/Experimenter+ 
    3737String FirstName      the first name of the experimenter 
     
    4040String Institution    the institution for which the experimenter belongs 
    4141String DataDirectory  the fully qualified path to the experimenter's data 
    42 Object Group          the group to which the experimenter belongs 
     42#CTR TODO - complexify 
     43#Object Group          the group to which the experimenter belongs 
    4344 
    4445[Group] 
    4546a group in the metadata store with a particular index 
    4647- 
    47 200706: Group+ 
     48Default: Group+ 
    48492003FC: CA/Group+ 
    4950String Name     the name of the group 
    50 Object Leader   the leader of the group 
    51 Object Contact  the contact for the group 
     51#CTR TODO - complexify 
     52#Object Leader   the leader of the group 
     53#CTR TODO - complexify 
     54#Object Contact  the contact for the group 
    5255 
    5356[Instrument] 
    5457an instrument in the metadata store with a particular index 
    5558- 
    56 200706: Instrument+ 
     59Default: Instrument+ 
    57602003FC: CA/Instrument+ 
    5861String Manufacturer  the name of the manufacturer 
     
    6467a set of pixel dimensions in the metadata store with a particular index 
    6568Unless both values are non-null, the MetadataStore should assume pixelSizeX equals pixelSizeY (i.e., should populate the null field with the other field's value). 
    66 200706: Image+ 
     69Default: Image+ 
    67702003FC: Image+/CA/Dimensions 
    6871Float PhysicalSizeX  size of an individual pixel's X axis in microns 
     
    8285a 5D bounding box region of interest and a set of display options in the metadata store with a particular index 
    8386- 
    84 200706: Image+/ROI 
     87Default: Image+/ROI 
    85882003FC: Image+/CA/DisplayROI 
    8689Integer X0             the starting X coordinate 
     
    9295Integer Z1             the ending Z coordinate 
    9396Integer T1             the ending timepoint 
    94 Object DisplayOptions  the display options to attach to this region of interest 
     97#CTR TODO - complexify 
     98#Object DisplayOptions  the display options to attach to this region of interest 
    9599 
    96100[Pixels] 
    97101a pixels set in the metadata store with a particular image and pixels index 
    98102- 
    99 200706: Image+/Pixels+ 
     103Default: Image+/Pixels+ 
    1001042003FC: Image+/CA/Pixels+ 
    101105Integer SizeX          size of an individual plane or section's X axis (width) 
     
    105109Integer SizeT          number of timepoints 
    106110String PixelType       the pixel type 
    107 Boolean BigEndian      if the pixels set is big endian or not 
     111#CTR TODO - why not working? 
     112#Boolean BigEndian      if the pixels set is big endian or not 
    108113String DimensionOrder  the dimension order of the pixels set 
    109114 
    110115[StageLabel] 
    111116a stage label in the metadata store with a particular index 
    112 200706: Image+/StageLabel+ 
    113 2003FC: Image+/CA/StageLabel+ 
     117Default: Image+/StageLabel 
     1182003FC: Image+/CA/StageLabel 
    114119String Name  a name for the stage label 
    115120Float X      x coordinate of the stage 
     
    120125a logical channel and physical channel in the metadata store for a particular pixels 
    121126- 
    122 200706: Image+/LogicalChannel+ 
     127Default: Image+/LogicalChannel+ 
    1231282003FC: Image+/CA/LogicalChannel+ 
    124129String Name                       the logical channel's name 
    125130Integer SamplesPerPixel           CTR TODO 
    126 Integer Filter                    index of the filter associated with this channel 
    127 Integer LightSource               index of the primary light source 
     131#CTR TODO - complexify 
     132#Integer Filter                    the index of the filter associated with this channel 
     133#CTR TODO - complexify 
     134#Integer LightSource               the index of the primary light source 
    128135Float LightAttenuation            the primary light source attenuation 
    129136Integer LightWavelength           the primary light source wavelength 
    130 Integer OTF                       the index of the OTF associated with this channel 
    131 Integer Detector                  the index of the detector associated with this channel 
     137#CTR TODO - complexify 
     138#Integer OTF                       the index of the OTF associated with this channel 
     139#CTR TODO - complexify 
     140#Integer Detector                  the index of the detector associated with this channel 
    132141Float DetectorOffset              the detector offset 
    133142Float DetectorGain                the detector gain 
     
    137146String Mode                       the acquisition mode 
    138147String ContrastMethod             the constrast method name 
    139 Integer AuxLightSource            index of the auxiliary light source 
     148#CTR TODO - complexify 
     149#Integer AuxLightSource            the index of the auxiliary light source 
    140150Float AuxLightAttenuation         the auxiliary light source attenuation 
    141151String AuxTechnique               the auxiliary technique type 
    142152Integer AuxLightWavelength        the auxiliary light source wavelength 
    143153Integer EmWave                    the emission wavelength 
     154*2003FC: EmissionWavelength 
    144155Integer ExWave                    the excitation wavelength 
     156*2003FC: ExcitationWavelength 
    145157String Fluor                      the fluorescence type 
    146158Float NdFilter                    the neutral-density filter value 
     159*2003FC: NDFilter 
    147160 
    148161[PlaneInfo] 
    149162the plane information for a particular X-Y plane (section) within a particular pixels set 
    150163NOTE: The implementation of this method is optional as this is a transitional type. More information about the PlaneInfo type can be found <a href="http://cvs.openmicroscopy.org.uk/tiki/tiki-index.php?page=DataModelProposal#id119301">here</a>. 
    151 200706: Image+/Pixels+/Plane+ 
     164Default: Image+/Pixels+/Plane+ 
    1521652003FC: Image+/Pixels+/Plane+/- 
    153166Integer TheZ        the optical section index 
     
    160173the imaging environment for a particular image 
    161174- 
    162 200706: Image+/ImagingEnvironment 
     175Default: Image+/ImagingEnvironment 
    1631762003FC: Image+/CA/ImagingEnvironment 
    164177Float Temperature  CTR TODO 
    165178Float AirPressure  CTR TODO 
    166179Float Humidity     CTR TODO 
    167 Float Co2Percent   CTR TODO 
     180Float CO2Percent   CTR TODO 
    168181 
    169182#TODO figure out how to solve problem with multiple subtypes of ChannelSpecType  
     
    171184#information about the specified channel for a particular image 
    172185#- 
    173 #200706: ChannelSpecType 
     186#Default: ChannelSpecType 
    174187#2003FC: Image+/CA/DisplayChannel+ 
    175188#Integer ChannelNumber  CTR TODO 
     
    181194various display options for a particular pixels set 
    182195- 
    183 200706: Image+/DisplayOptions 
     196Default: Image+/DisplayOptions 
    1841972003FC: Image+/CA/DisplayOptions 
    185198Float Zoom              CTR TODO 
     
    197210a light source for a particular instrument 
    198211- 
    199 200706: Instrument+/LightSource+ 
     212Default: Instrument+/LightSource+ 
    2002132003FC: CA/Instrument+/@LightSource+ 
    201214String Manufacturer  CTR TODO 
     
    206219a laser for a particular instrument 
    207220- 
    208 200706: Instrument+/LightSource+/Laser 
     221Default: Instrument+/LightSource+/Laser 
    2092222003FC: CA/Instrument+/@LightSource+/@Laser 
     223#TODO 2003FC needs to call lightSource.getLaserListByLightSource... 
    210224String Type               CTR TODO 
    211225String Medium             CTR TODO 
     
    219233a filament for a particular instrument 
    220234- 
    221 200706: Instrument+/LightSource+/Filament 
     235Default: Instrument+/LightSource+/Filament 
    2222362003FC: CA/Instrument+/@LightSource+/@Filament 
    223237String Type  CTR TODO 
     
    227241an arc for a particular instrument 
    228242- 
    229 200706: Instrument+/LightSource+/Arc 
     243Default: Instrument+/LightSource+/Arc 
    2302442003FC: CA/Instrument+/@LightSource+/@Arc 
    231245String Type  CTR TODO 
     
    235249a detector for a particular instrument 
    236250- 
    237 200706: Instrument+/Detector+ 
     251Default: Instrument+/Detector+ 
    2382522003FC: CA/Instrument+/@Detector+ 
    239253String Manufacturer  CTR TODO 
     
    248262an objective for a particular instrument 
    249263- 
    250 200706: Instrument+/Objective+ 
     264Default: Instrument+/Objective+ 
    2512652003FC: CA/Instrument+/@Objective+ 
    252266String Manufacturer  CTR TODO 
     
    260274#an excitation filter for a particular instrument 
    261275#- 
    262 #200706: ? 
     276#Default: ? 
    263277#2003FC: CA/ExcitationFilter+ 
    264278#String Manufacturer  CTR TODO 
     
    267281#String Type          CTR TODO 
    268282 
    269 #TODO figure out how to reconcile the two filter models 
    270283#[Dichroic] 
    271284#a dichroic for a particular instrument 
    272285#- 
    273 #200706: ? 
     286#Default: ? 
    274287#2003FC: CA/Dichroic+ 
    275288#String Manufacturer  CTR TODO 
     
    277290#String LotNumber     CTR TODO 
    278291# 
    279 #TODO figure out how to reconcile the two filter models 
    280292#[EmissionFilter] 
    281293#an emission filter for a particular instrument 
    282294#- 
    283 #200706: ? 
     295#Default: ? 
    284296#2003FC: CA/EmissionFilter+ 
    285297#String Manufacturer  CTR TODO 
     
    288300#String Type          CTR TODO 
    289301# 
    290 #TODO figure out how to reconcile the two filter models 
    291302#[FilterSet] 
    292303#a filter set for a particular instrument 
    293304#- 
    294 #200706: ? 
     305#Default: ? 
    295306#2003FC: CA/FilterSet+ 
    296307#String Manufacturer  CTR TODO 
     
    301312an optical transfer function for a particular instrument 
    302313- 
    303 200706: Instrument+/OTF+ 
     314Default: Instrument+/OTF+ 
    3043152003FC: CA/Instrument+/@OTF+ 
    305316Integer SizeX                CTR TODO 
Note: See TracChangeset for help on using the changeset viewer.