Changeset 6887


Ignore:
Timestamp:
09/06/10 11:06:36 (9 years ago)
Author:
melissa
Message:

Backported r6839, r6840, and r6841 to 4.2.

Location:
branches/4.2/components/bio-formats
Files:
17 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/4.2/components/bio-formats/src/loci/formats/meta

  • branches/4.2/components/bio-formats/src/loci/formats/meta/AggregateMetadata.java

    r6663 r6887  
    3333 * 
    3434 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    35  * Created by callan via xsd-fu on 2010-07-01 12:04:30+0100 
     35 * Created by callan via xsd-fu on 2010-08-24 16:48:47+0100 
    3636 * 
    3737 *----------------------------------------------------------------------------- 
     
    132132        } 
    133133 
     134        public String getLightSourceType(int instrumentIndex, int lightSourceIndex) 
     135        { 
     136                for (Iterator iter = delegates.iterator(); iter.hasNext();) 
     137                { 
     138                        Object o = iter.next(); 
     139                        if (o instanceof MetadataRetrieve) 
     140                        { 
     141                                MetadataRetrieve retrieve = (MetadataRetrieve) o; 
     142                                return retrieve.getLightSourceType(instrumentIndex, lightSourceIndex); 
     143                        } 
     144                } 
     145                return null; 
     146        } 
     147 
    134148        // -- Entity counting (code generated definitions) -- 
    135149 
  • branches/4.2/components/bio-formats/src/loci/formats/meta/DummyMetadata.java

    r6663 r6887  
    3333 * 
    3434 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    35  * Created by callan via xsd-fu on 2010-07-01 12:04:37+0100 
     35 * Created by callan via xsd-fu on 2010-08-24 16:50:49+0100 
    3636 * 
    3737 *----------------------------------------------------------------------------- 
     
    3939 
    4040package loci.formats.meta; 
    41  
    42 import java.util.Iterator; 
    4341 
    4442import ome.xml.model.enums.*; 
     
    8179        } 
    8280 
     81        public String getLightSourceType(int instrumentIndex, int lightSourceIndex) 
     82        { 
     83                return null; 
     84        } 
     85 
    8386        // -- Entity counting (code generated definitions) -- 
    8487 
  • branches/4.2/components/bio-formats/src/loci/formats/meta/MetadataConverter.java

    r6663 r6887  
    7777    for (int datasetIndex=0; datasetIndex<datasetCount; datasetIndex++) { 
    7878    try { 
     79      String datasetIDValue = src.getDatasetID(datasetIndex); 
     80      if (datasetIDValue != null) dest.setDatasetID(datasetIDValue, datasetIndex); 
     81    } catch (NullPointerException e) { } 
     82    try { 
    7983      for (int annotationRefIndex=0; annotationRefIndex<src.getDatasetAnnotationRefCount(datasetIndex); annotationRefIndex++) 
    8084      { 
     
    96100    } catch (NullPointerException e) { } 
    97101    try { 
    98       String datasetIDValue = src.getDatasetID(datasetIndex); 
    99       if (datasetIDValue != null) dest.setDatasetID(datasetIDValue, datasetIndex); 
    100     } catch (NullPointerException e) { } 
    101     try { 
    102102      String datasetNameValue = src.getDatasetName(datasetIndex); 
    103103      if (datasetNameValue != null) dest.setDatasetName(datasetNameValue, datasetIndex); 
     
    725725    } catch (NullPointerException e) { } 
    726726      try { 
    727       /* 
    728       int arcCount = src.getArcCount(instrumentIndex); 
    729       for (int arcIndex=0; arcIndex<arcCount; arcIndex++) { 
    730       try { 
    731         String arcIDValue = src.getArcID(instrumentIndex, arcIndex); 
    732         if (arcIDValue != null) dest.setArcID(arcIDValue, instrumentIndex, arcIndex); 
    733       } catch (NullPointerException e) { } 
    734       try { 
    735         String arcLotNumberValue = src.getArcLotNumber(instrumentIndex, arcIndex); 
    736         if (arcLotNumberValue != null) dest.setArcLotNumber(arcLotNumberValue, instrumentIndex, arcIndex); 
    737       } catch (NullPointerException e) { } 
    738       try { 
    739         String arcManufacturerValue = src.getArcManufacturer(instrumentIndex, arcIndex); 
    740         if (arcManufacturerValue != null) dest.setArcManufacturer(arcManufacturerValue, instrumentIndex, arcIndex); 
    741       } catch (NullPointerException e) { } 
    742       try { 
    743         String arcModelValue = src.getArcModel(instrumentIndex, arcIndex); 
    744         if (arcModelValue != null) dest.setArcModel(arcModelValue, instrumentIndex, arcIndex); 
    745       } catch (NullPointerException e) { } 
    746       try { 
    747         Double arcPowerValue = src.getArcPower(instrumentIndex, arcIndex); 
    748         if (arcPowerValue != null) dest.setArcPower(arcPowerValue, instrumentIndex, arcIndex); 
    749       } catch (NullPointerException e) { } 
    750       try { 
    751         String arcSerialNumberValue = src.getArcSerialNumber(instrumentIndex, arcIndex); 
    752         if (arcSerialNumberValue != null) dest.setArcSerialNumber(arcSerialNumberValue, instrumentIndex, arcIndex); 
    753       } catch (NullPointerException e) { } 
    754       try { 
    755         ArcType arcTypeValue = src.getArcType(instrumentIndex, arcIndex); 
    756         if (arcTypeValue != null) dest.setArcType(arcTypeValue, instrumentIndex, arcIndex); 
    757       } catch (NullPointerException e) { } 
    758       } 
    759       */ 
    760       } catch (NullPointerException e) { } 
    761       try { 
    762727      int detectorCount = src.getDetectorCount(instrumentIndex); 
    763728      for (int detectorIndex=0; detectorIndex<detectorCount; detectorIndex++) { 
     
    832797      } catch (NullPointerException e) { } 
    833798      } 
    834       } catch (NullPointerException e) { } 
    835       try { 
    836       /* 
    837       int filamentCount = src.getFilamentCount(instrumentIndex); 
    838       for (int filamentIndex=0; filamentIndex<filamentCount; filamentIndex++) { 
    839       try { 
    840         String filamentIDValue = src.getFilamentID(instrumentIndex, filamentIndex); 
    841         if (filamentIDValue != null) dest.setFilamentID(filamentIDValue, instrumentIndex, filamentIndex); 
    842       } catch (NullPointerException e) { } 
    843       try { 
    844         String filamentLotNumberValue = src.getFilamentLotNumber(instrumentIndex, filamentIndex); 
    845         if (filamentLotNumberValue != null) dest.setFilamentLotNumber(filamentLotNumberValue, instrumentIndex, filamentIndex); 
    846       } catch (NullPointerException e) { } 
    847       try { 
    848         String filamentManufacturerValue = src.getFilamentManufacturer(instrumentIndex, filamentIndex); 
    849         if (filamentManufacturerValue != null) dest.setFilamentManufacturer(filamentManufacturerValue, instrumentIndex, filamentIndex); 
    850       } catch (NullPointerException e) { } 
    851       try { 
    852         String filamentModelValue = src.getFilamentModel(instrumentIndex, filamentIndex); 
    853         if (filamentModelValue != null) dest.setFilamentModel(filamentModelValue, instrumentIndex, filamentIndex); 
    854       } catch (NullPointerException e) { } 
    855       try { 
    856         Double filamentPowerValue = src.getFilamentPower(instrumentIndex, filamentIndex); 
    857         if (filamentPowerValue != null) dest.setFilamentPower(filamentPowerValue, instrumentIndex, filamentIndex); 
    858       } catch (NullPointerException e) { } 
    859       try { 
    860         String filamentSerialNumberValue = src.getFilamentSerialNumber(instrumentIndex, filamentIndex); 
    861         if (filamentSerialNumberValue != null) dest.setFilamentSerialNumber(filamentSerialNumberValue, instrumentIndex, filamentIndex); 
    862       } catch (NullPointerException e) { } 
    863       try { 
    864         FilamentType filamentTypeValue = src.getFilamentType(instrumentIndex, filamentIndex); 
    865         if (filamentTypeValue != null) dest.setFilamentType(filamentTypeValue, instrumentIndex, filamentIndex); 
    866       } catch (NullPointerException e) { } 
    867       } 
    868       */ 
    869799      } catch (NullPointerException e) { } 
    870800      try { 
     
    967897      } catch (NullPointerException e) { } 
    968898      try { 
    969       /* 
    970       int laserCount = src.getLaserCount(instrumentIndex); 
    971       for (int laserIndex=0; laserIndex<laserCount; laserIndex++) { 
    972       try { 
    973         PositiveInteger laserFrequencyMultiplicationValue = src.getLaserFrequencyMultiplication(instrumentIndex, laserIndex); 
    974         if (laserFrequencyMultiplicationValue != null) dest.setLaserFrequencyMultiplication(laserFrequencyMultiplicationValue, instrumentIndex, laserIndex); 
    975       } catch (NullPointerException e) { } 
    976       try { 
    977         String laserIDValue = src.getLaserID(instrumentIndex, laserIndex); 
    978         if (laserIDValue != null) dest.setLaserID(laserIDValue, instrumentIndex, laserIndex); 
    979       } catch (NullPointerException e) { } 
    980       try { 
    981         LaserMedium laserLaserMediumValue = src.getLaserLaserMedium(instrumentIndex, laserIndex); 
    982         if (laserLaserMediumValue != null) dest.setLaserLaserMedium(laserLaserMediumValue, instrumentIndex, laserIndex); 
    983       } catch (NullPointerException e) { } 
    984       try { 
    985         String laserLotNumberValue = src.getLaserLotNumber(instrumentIndex, laserIndex); 
    986         if (laserLotNumberValue != null) dest.setLaserLotNumber(laserLotNumberValue, instrumentIndex, laserIndex); 
    987       } catch (NullPointerException e) { } 
    988       try { 
    989         String laserManufacturerValue = src.getLaserManufacturer(instrumentIndex, laserIndex); 
    990         if (laserManufacturerValue != null) dest.setLaserManufacturer(laserManufacturerValue, instrumentIndex, laserIndex); 
    991       } catch (NullPointerException e) { } 
    992       try { 
    993         String laserModelValue = src.getLaserModel(instrumentIndex, laserIndex); 
    994         if (laserModelValue != null) dest.setLaserModel(laserModelValue, instrumentIndex, laserIndex); 
    995       } catch (NullPointerException e) { } 
    996       try { 
    997         Boolean laserPockelCellValue = src.getLaserPockelCell(instrumentIndex, laserIndex); 
    998         if (laserPockelCellValue != null) dest.setLaserPockelCell(laserPockelCellValue, instrumentIndex, laserIndex); 
    999       } catch (NullPointerException e) { } 
    1000       try { 
    1001         Double laserPowerValue = src.getLaserPower(instrumentIndex, laserIndex); 
    1002         if (laserPowerValue != null) dest.setLaserPower(laserPowerValue, instrumentIndex, laserIndex); 
    1003       } catch (NullPointerException e) { } 
    1004       try { 
    1005         Pulse laserPulseValue = src.getLaserPulse(instrumentIndex, laserIndex); 
    1006         if (laserPulseValue != null) dest.setLaserPulse(laserPulseValue, instrumentIndex, laserIndex); 
    1007       } catch (NullPointerException e) { } 
    1008       try { 
    1009         String laserPumpValue = src.getLaserPump(instrumentIndex, laserIndex); 
    1010         if (laserPumpValue != null) dest.setLaserPump(laserPumpValue, instrumentIndex, laserIndex); 
    1011       } catch (NullPointerException e) { } 
    1012       try { 
    1013         Double laserRepetitionRateValue = src.getLaserRepetitionRate(instrumentIndex, laserIndex); 
    1014         if (laserRepetitionRateValue != null) dest.setLaserRepetitionRate(laserRepetitionRateValue, instrumentIndex, laserIndex); 
    1015       } catch (NullPointerException e) { } 
    1016       try { 
    1017         String laserSerialNumberValue = src.getLaserSerialNumber(instrumentIndex, laserIndex); 
    1018         if (laserSerialNumberValue != null) dest.setLaserSerialNumber(laserSerialNumberValue, instrumentIndex, laserIndex); 
    1019       } catch (NullPointerException e) { } 
    1020       try { 
    1021         Boolean laserTuneableValue = src.getLaserTuneable(instrumentIndex, laserIndex); 
    1022         if (laserTuneableValue != null) dest.setLaserTuneable(laserTuneableValue, instrumentIndex, laserIndex); 
    1023       } catch (NullPointerException e) { } 
    1024       try { 
    1025         LaserType laserTypeValue = src.getLaserType(instrumentIndex, laserIndex); 
    1026         if (laserTypeValue != null) dest.setLaserType(laserTypeValue, instrumentIndex, laserIndex); 
    1027       } catch (NullPointerException e) { } 
    1028       try { 
    1029         PositiveInteger laserWavelengthValue = src.getLaserWavelength(instrumentIndex, laserIndex); 
    1030         if (laserWavelengthValue != null) dest.setLaserWavelength(laserWavelengthValue, instrumentIndex, laserIndex); 
    1031       } catch (NullPointerException e) { } 
    1032       } 
    1033       */ 
    1034       } catch (NullPointerException e) { } 
    1035       try { 
    1036       /* 
    1037       int lightEmittingDiodeCount = src.getLightEmittingDiodeCount(instrumentIndex); 
    1038       for (int lightEmittingDiodeIndex=0; lightEmittingDiodeIndex<lightEmittingDiodeCount; lightEmittingDiodeIndex++) { 
    1039       try { 
    1040         String lightEmittingDiodeIDValue = src.getLightEmittingDiodeID(instrumentIndex, lightEmittingDiodeIndex); 
    1041         if (lightEmittingDiodeIDValue != null) dest.setLightEmittingDiodeID(lightEmittingDiodeIDValue, instrumentIndex, lightEmittingDiodeIndex); 
    1042       } catch (NullPointerException e) { } 
    1043       try { 
    1044         String lightEmittingDiodeLotNumberValue = src.getLightEmittingDiodeLotNumber(instrumentIndex, lightEmittingDiodeIndex); 
    1045         if (lightEmittingDiodeLotNumberValue != null) dest.setLightEmittingDiodeLotNumber(lightEmittingDiodeLotNumberValue, instrumentIndex, lightEmittingDiodeIndex); 
    1046       } catch (NullPointerException e) { } 
    1047       try { 
    1048         String lightEmittingDiodeManufacturerValue = src.getLightEmittingDiodeManufacturer(instrumentIndex, lightEmittingDiodeIndex); 
    1049         if (lightEmittingDiodeManufacturerValue != null) dest.setLightEmittingDiodeManufacturer(lightEmittingDiodeManufacturerValue, instrumentIndex, lightEmittingDiodeIndex); 
    1050       } catch (NullPointerException e) { } 
    1051       try { 
    1052         String lightEmittingDiodeModelValue = src.getLightEmittingDiodeModel(instrumentIndex, lightEmittingDiodeIndex); 
    1053         if (lightEmittingDiodeModelValue != null) dest.setLightEmittingDiodeModel(lightEmittingDiodeModelValue, instrumentIndex, lightEmittingDiodeIndex); 
    1054       } catch (NullPointerException e) { } 
    1055       try { 
    1056         Double lightEmittingDiodePowerValue = src.getLightEmittingDiodePower(instrumentIndex, lightEmittingDiodeIndex); 
    1057         if (lightEmittingDiodePowerValue != null) dest.setLightEmittingDiodePower(lightEmittingDiodePowerValue, instrumentIndex, lightEmittingDiodeIndex); 
    1058       } catch (NullPointerException e) { } 
    1059       try { 
    1060         String lightEmittingDiodeSerialNumberValue = src.getLightEmittingDiodeSerialNumber(instrumentIndex, lightEmittingDiodeIndex); 
    1061         if (lightEmittingDiodeSerialNumberValue != null) dest.setLightEmittingDiodeSerialNumber(lightEmittingDiodeSerialNumberValue, instrumentIndex, lightEmittingDiodeIndex); 
    1062       } catch (NullPointerException e) { } 
    1063       } 
    1064       */ 
    1065       } catch (NullPointerException e) { } 
    1066       try { 
    1067899        String microscopeLotNumberValue = src.getMicroscopeLotNumber(instrumentIndex); 
    1068900        if (microscopeLotNumberValue != null) dest.setMicroscopeLotNumber(microscopeLotNumberValue, instrumentIndex); 
     
    11941026      } 
    11951027      } catch (NullPointerException e) { } 
     1028      convertLightSources(src, dest, instrumentIndex); 
    11961029    } 
    11971030    } catch (NullPointerException e) { } 
     
    14301263    for (int projectIndex=0; projectIndex<projectCount; projectIndex++) { 
    14311264    try { 
     1265      String projectIDValue = src.getProjectID(projectIndex); 
     1266      if (projectIDValue != null) dest.setProjectID(projectIDValue, projectIndex); 
     1267    } catch (NullPointerException e) { } 
     1268    try { 
    14321269      int annotationRefCount = src.getProjectAnnotationRefCount(projectIndex); 
    14331270      for (int annotationRefIndex=0; annotationRefIndex<annotationRefCount; annotationRefIndex++) 
     
    14501287    } catch (NullPointerException e) { } 
    14511288    try { 
    1452       String projectIDValue = src.getProjectID(projectIndex); 
    1453       if (projectIDValue != null) dest.setProjectID(projectIDValue, projectIndex); 
    1454     } catch (NullPointerException e) { } 
    1455     try { 
    14561289      String projectNameValue = src.getProjectName(projectIndex); 
    14571290      if (projectNameValue != null) dest.setProjectName(projectNameValue, projectIndex); 
     
    22912124  } 
    22922125 
     2126  // -- Helper methods -- 
     2127 
     2128  private static void convertLightSources(MetadataRetrieve src, 
     2129    MetadataStore dest, int instrumentIndex) 
     2130  { 
     2131    int lightSourceCount = src.getLightSourceCount(instrumentIndex); 
     2132 
     2133    for (int lightSource=0; lightSource<lightSourceCount; lightSource++) { 
     2134      String type = src.getLightSourceType(instrumentIndex, lightSource); 
     2135      if (type.equals("Arc")) { 
     2136        try { 
     2137          String id = src.getArcID(instrumentIndex, lightSource); 
     2138          if (id != null) dest.setArcID(id, instrumentIndex, lightSource); 
     2139        } 
     2140        catch (NullPointerException e) { } 
     2141 
     2142        try { 
     2143          String lotNumber = src.getArcLotNumber(instrumentIndex, lightSource); 
     2144          if (lotNumber != null) { 
     2145            dest.setArcLotNumber(lotNumber, instrumentIndex, lightSource); 
     2146          } 
     2147        } 
     2148        catch (NullPointerException e) { } 
     2149 
     2150        try { 
     2151          String manufacturer = 
     2152            src.getArcManufacturer(instrumentIndex, lightSource); 
     2153          if (manufacturer != null) { 
     2154            dest.setArcManufacturer(manufacturer, instrumentIndex, lightSource); 
     2155          } 
     2156        } 
     2157        catch (NullPointerException e) { } 
     2158 
     2159        try { 
     2160          String model = src.getArcModel(instrumentIndex, lightSource); 
     2161          if (model != null) { 
     2162            dest.setArcModel(model, instrumentIndex, lightSource); 
     2163          } 
     2164        } 
     2165        catch (NullPointerException e) { } 
     2166 
     2167        try { 
     2168          Double power = src.getArcPower(instrumentIndex, lightSource); 
     2169          if (power != null) { 
     2170            dest.setArcPower(power, instrumentIndex, lightSource); 
     2171          } 
     2172        } 
     2173        catch (NullPointerException e) { } 
     2174 
     2175        try { 
     2176          String serialNumber = 
     2177            src.getArcSerialNumber(instrumentIndex, lightSource); 
     2178          if (serialNumber != null) { 
     2179            dest.setArcSerialNumber(serialNumber, instrumentIndex, lightSource); 
     2180          } 
     2181        } 
     2182        catch (NullPointerException e) { } 
     2183 
     2184        try { 
     2185          ArcType arcType = src.getArcType(instrumentIndex, lightSource); 
     2186          if (arcType != null) { 
     2187            dest.setArcType(arcType, instrumentIndex, lightSource); 
     2188          } 
     2189        } 
     2190        catch (NullPointerException e) { } 
     2191      } 
     2192      else if (type.equals("Filament")) { 
     2193        try { 
     2194          String id = src.getFilamentID(instrumentIndex, lightSource); 
     2195          if (id != null) dest.setFilamentID(id, instrumentIndex, lightSource); 
     2196        } 
     2197        catch (NullPointerException e) { } 
     2198 
     2199        try { 
     2200          String lotNumber = 
     2201            src.getFilamentLotNumber(instrumentIndex, lightSource); 
     2202          if (lotNumber != null) { 
     2203            dest.setFilamentLotNumber(lotNumber, instrumentIndex, lightSource); 
     2204          } 
     2205        } 
     2206        catch (NullPointerException e) { } 
     2207 
     2208        try { 
     2209          String manufacturer = 
     2210            src.getFilamentManufacturer(instrumentIndex, lightSource); 
     2211          if (manufacturer != null) { 
     2212            dest.setFilamentManufacturer( 
     2213              manufacturer, instrumentIndex, lightSource); 
     2214          } 
     2215        } 
     2216        catch (NullPointerException e) { } 
     2217 
     2218        try { 
     2219          String model = src.getFilamentModel(instrumentIndex, lightSource); 
     2220          if (model != null) { 
     2221            dest.setFilamentModel(model, instrumentIndex, lightSource); 
     2222          } 
     2223        } 
     2224        catch (NullPointerException e) { } 
     2225 
     2226        try { 
     2227          Double power = src.getFilamentPower(instrumentIndex, lightSource); 
     2228          if (power != null) { 
     2229            dest.setFilamentPower(power, instrumentIndex, lightSource); 
     2230          } 
     2231        } 
     2232        catch (NullPointerException e) { } 
     2233 
     2234        try { 
     2235          String serialNumber = 
     2236            src.getFilamentSerialNumber(instrumentIndex, lightSource); 
     2237          if (serialNumber != null) { 
     2238            dest.setFilamentSerialNumber( 
     2239              serialNumber, instrumentIndex, lightSource); 
     2240          } 
     2241        } 
     2242        catch (NullPointerException e) { } 
     2243 
     2244        try { 
     2245          FilamentType filamentType = 
     2246            src.getFilamentType(instrumentIndex, lightSource); 
     2247          if (filamentType != null) { 
     2248            dest.setFilamentType(filamentType, instrumentIndex, lightSource); 
     2249          } 
     2250        } 
     2251        catch (NullPointerException e) { } 
     2252      } 
     2253      else if (type.equals("Laser")) { 
     2254        try { 
     2255          String id = src.getLaserID(instrumentIndex, lightSource); 
     2256          if (id != null) dest.setLaserID(id, instrumentIndex, lightSource); 
     2257        } 
     2258        catch (NullPointerException e) { } 
     2259 
     2260        try { 
     2261          String lotNumber = 
     2262            src.getLaserLotNumber(instrumentIndex, lightSource); 
     2263          if (lotNumber != null) { 
     2264            dest.setLaserLotNumber(lotNumber, instrumentIndex, lightSource); 
     2265          } 
     2266        } 
     2267        catch (NullPointerException e) { } 
     2268 
     2269        try { 
     2270          String manufacturer = 
     2271            src.getLaserManufacturer(instrumentIndex, lightSource); 
     2272          if (manufacturer != null) { 
     2273            dest.setLaserManufacturer( 
     2274              manufacturer, instrumentIndex, lightSource); 
     2275          } 
     2276        } 
     2277        catch (NullPointerException e) { } 
     2278 
     2279        try { 
     2280          String model = src.getLaserModel(instrumentIndex, lightSource); 
     2281          if (model != null) { 
     2282            dest.setLaserModel(model, instrumentIndex, lightSource); 
     2283          } 
     2284        } 
     2285        catch (NullPointerException e) { } 
     2286 
     2287        try { 
     2288          Double power = src.getLaserPower(instrumentIndex, lightSource); 
     2289          if (power != null) { 
     2290            dest.setLaserPower(power, instrumentIndex, lightSource); 
     2291          } 
     2292        } 
     2293        catch (NullPointerException e) { } 
     2294 
     2295        try { 
     2296          String serialNumber = 
     2297            src.getLaserSerialNumber(instrumentIndex, lightSource); 
     2298          if (serialNumber != null) { 
     2299            dest.setLaserSerialNumber( 
     2300              serialNumber, instrumentIndex, lightSource); 
     2301          } 
     2302        } 
     2303        catch (NullPointerException e) { } 
     2304 
     2305        try { 
     2306          LaserType laserType = src.getLaserType(instrumentIndex, lightSource); 
     2307          if (laserType != null) { 
     2308            dest.setLaserType(laserType, instrumentIndex, lightSource); 
     2309          } 
     2310        } 
     2311        catch (NullPointerException e) { } 
     2312 
     2313        try { 
     2314          PositiveInteger frequencyMultiplication = 
     2315            src.getLaserFrequencyMultiplication(instrumentIndex, lightSource); 
     2316          if (frequencyMultiplication != null) { 
     2317            dest.setLaserFrequencyMultiplication( 
     2318              frequencyMultiplication, instrumentIndex, lightSource); 
     2319          } 
     2320        } 
     2321        catch (NullPointerException e) { } 
     2322 
     2323        try { 
     2324          LaserMedium medium = 
     2325            src.getLaserLaserMedium(instrumentIndex, lightSource); 
     2326          if (medium != null) { 
     2327            dest.setLaserLaserMedium(medium, instrumentIndex, lightSource); 
     2328          } 
     2329        } 
     2330        catch (NullPointerException e) { } 
     2331 
     2332        try { 
     2333          Boolean pockelCell = 
     2334            src.getLaserPockelCell(instrumentIndex, lightSource); 
     2335          if (pockelCell != null) { 
     2336            dest.setLaserPockelCell(pockelCell, instrumentIndex, lightSource); 
     2337          } 
     2338        } 
     2339        catch (NullPointerException e) { } 
     2340 
     2341        try { 
     2342          Pulse pulse = src.getLaserPulse(instrumentIndex, lightSource); 
     2343          if (pulse != null) { 
     2344            dest.setLaserPulse(pulse, instrumentIndex, lightSource); 
     2345          } 
     2346        } 
     2347        catch (NullPointerException e) { } 
     2348 
     2349        try { 
     2350          String pump = src.getLaserPump(instrumentIndex, lightSource); 
     2351          if (pump != null) { 
     2352            dest.setLaserPump(pump, instrumentIndex, lightSource); 
     2353          } 
     2354        } 
     2355        catch (NullPointerException e) { } 
     2356 
     2357        try { 
     2358          Double repetitionRate = 
     2359            src.getLaserRepetitionRate(instrumentIndex, lightSource); 
     2360          if (repetitionRate != null) { 
     2361            dest.setLaserRepetitionRate( 
     2362              repetitionRate, instrumentIndex, lightSource); 
     2363          } 
     2364        } 
     2365        catch (NullPointerException e) { } 
     2366 
     2367        try { 
     2368          Boolean tuneable = src.getLaserTuneable(instrumentIndex, lightSource); 
     2369          if (tuneable != null) { 
     2370            dest.setLaserTuneable(tuneable, instrumentIndex, lightSource); 
     2371          } 
     2372        } 
     2373        catch (NullPointerException e) { } 
     2374 
     2375        try { 
     2376          PositiveInteger wavelength = 
     2377            src.getLaserWavelength(instrumentIndex, lightSource); 
     2378          if (wavelength != null) { 
     2379            dest.setLaserWavelength(wavelength, instrumentIndex, lightSource); 
     2380          } 
     2381        } 
     2382        catch (NullPointerException e) { } 
     2383      } 
     2384      else if (type.equals("LightEmittingDiode")) { 
     2385        try { 
     2386          String id = src.getLightEmittingDiodeID(instrumentIndex, lightSource); 
     2387          if (id != null) { 
     2388            dest.setLightEmittingDiodeID(id, instrumentIndex, lightSource); 
     2389          } 
     2390        } 
     2391        catch (NullPointerException e) { } 
     2392 
     2393        try { 
     2394          String lotNumber = 
     2395            src.getLightEmittingDiodeLotNumber(instrumentIndex, lightSource); 
     2396          if (lotNumber != null) { 
     2397            dest.setLightEmittingDiodeLotNumber( 
     2398              lotNumber, instrumentIndex, lightSource); 
     2399          } 
     2400        } 
     2401        catch (NullPointerException e) { } 
     2402 
     2403        try { 
     2404          String manufacturer = 
     2405            src.getLightEmittingDiodeManufacturer(instrumentIndex, lightSource); 
     2406          if (manufacturer != null) { 
     2407            dest.setLightEmittingDiodeManufacturer( 
     2408              manufacturer, instrumentIndex, lightSource); 
     2409          } 
     2410        } 
     2411        catch (NullPointerException e) { } 
     2412 
     2413        try { 
     2414          String model = 
     2415            src.getLightEmittingDiodeModel(instrumentIndex, lightSource); 
     2416          if (model != null) { 
     2417            dest.setLightEmittingDiodeModel( 
     2418              model, instrumentIndex, lightSource); 
     2419          } 
     2420        } 
     2421        catch (NullPointerException e) { } 
     2422 
     2423        try { 
     2424          Double power = 
     2425            src.getLightEmittingDiodePower(instrumentIndex, lightSource); 
     2426          if (power != null) { 
     2427            dest.setLightEmittingDiodePower( 
     2428              power, instrumentIndex, lightSource); 
     2429          } 
     2430        } 
     2431        catch (NullPointerException e) { } 
     2432 
     2433        try { 
     2434          String serialNumber = 
     2435            src.getLightEmittingDiodeSerialNumber(instrumentIndex, lightSource); 
     2436          if (serialNumber != null) { 
     2437            dest.setLightEmittingDiodeSerialNumber( 
     2438              serialNumber, instrumentIndex, lightSource); 
     2439          } 
     2440        } 
     2441        catch (NullPointerException e) { } 
     2442      } 
     2443    } 
     2444  } 
     2445 
    22932446} 
  • branches/4.2/components/bio-formats/src/loci/formats/meta/MetadataRetrieve.java

    r6663 r6887  
    3333 * 
    3434 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    35  * Created by callan via xsd-fu on 2010-07-01 12:04:44+0100 
     35 * Created by callan via xsd-fu on 2010-08-24 16:48:27+0100 
    3636 * 
    3737 *----------------------------------------------------------------------------- 
     
    7777        int getPixelsBinDataCount(int imageIndex); 
    7878 
     79        String getLightSourceType(int instrumentIndex, int lightSourceIndex); 
     80 
    7981        // -- Entity counting (code generated definitions) -- 
    8082 
  • branches/4.2/components/bio-formats/src/loci/formats/meta/MetadataStore.java

    r6663 r6887  
    3333 * 
    3434 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    35  * Created by callan via xsd-fu on 2010-07-01 12:04:46+0100 
     35 * Created by callan via xsd-fu on 2010-08-24 16:48:21+0100 
    3636 * 
    3737 *----------------------------------------------------------------------------- 
  • branches/4.2/components/bio-formats/src/loci/formats/ome

  • branches/4.2/components/bio-formats/src/loci/formats/ome/OMEXMLMetadataImpl.java

    r6663 r6887  
    3333 * 
    3434 * THIS IS AUTOMATICALLY GENERATED CODE.  DO NOT MODIFY. 
    35  * Created by callan via xsd-fu on 2010-07-01 12:04:50+0100 
     35 * Created by callan via xsd-fu on 2010-08-24 16:58:15+0100 
    3636 * 
    3737 *----------------------------------------------------------------------------- 
     
    107107        } 
    108108 
     109        public String getLightSourceType(int instrumentIndex, int lightSourceIndex) 
     110        { 
     111                LightSource o = root.getInstrument(instrumentIndex).getLightSource(lightSourceIndex); 
     112                String className = o.getClass().getName(); 
     113                return className.substring( 
     114                        className.lastIndexOf('.') + 1, className.length()); 
     115        } 
     116 
    109117        // -- Entity counting (code generated definitions) -- 
    110118 
  • branches/4.2/components/bio-formats/test/loci/formats/utests

  • branches/4.2/components/bio-formats/test/loci/formats/utests/LuraWaveServiceTest.java

    r6663 r6887  
    4545public class LuraWaveServiceTest { 
    4646 
     47  private ServiceFactory sf; 
    4748  private LuraWaveService service; 
    4849 
    4950  @BeforeMethod 
    5051  public void setUp() throws DependencyException { 
    51     ServiceFactory sf = new ServiceFactory(); 
    52     service = sf.getInstance(LuraWaveService.class); 
     52    sf = new ServiceFactory(); 
    5353  } 
    5454 
     
    5656  public void testInitialize() 
    5757    throws IOException, DependencyException, ServiceException { 
     58    service = sf.getInstance(LuraWaveService.class); 
    5859    service.initialize(new ByteArrayInputStream(new byte[0])); 
    5960  } 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/testng.xml

    r6663 r6887  
    7474      </classes> 
    7575    </test> 
     76    <test name="SPWModel"> 
     77      <groups/> 
     78      <classes> 
     79        <class name="loci.formats.utests.SPWModelReaderTest"/> 
     80      </classes> 
     81    </test> 
    7682</suite> 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/BaseTiffMock.java

    r6026 r6887  
    2828import loci.common.ByteArrayHandle; 
    2929import loci.common.RandomAccessInputStream; 
     30import loci.common.RandomAccessOutputStream; 
     31import loci.formats.FormatException; 
    3032import loci.formats.tiff.IFD; 
    3133import loci.formats.tiff.IFDType; 
     
    3335import loci.formats.tiff.TiffParser; 
    3436import loci.formats.tiff.TiffRational; 
     37import loci.formats.tiff.TiffSaver; 
    3538 
    3639/** 
     
    4851  private RandomAccessInputStream in; 
    4952 
     53  private RandomAccessOutputStream out; 
     54 
    5055  private TiffParser tiffParser; 
     56 
     57  private TiffSaver tiffSaver; 
    5158 
    5259  private static byte[] TIFF_HEADER = new byte[] { 
     
    5663  private static final int ENTRY_VALUE_BEGIN_OFFSET = 65535; 
    5764 
    58   public BaseTiffMock() throws IOException { 
    59     handle = new ByteArrayHandle(TIFF_HEADER); 
    60     handle.seek(TIFF_HEADER.length); 
     65  public BaseTiffMock() throws FormatException, IOException { 
     66    handle = new ByteArrayHandle(); 
    6167    handle.setOrder(ByteOrder.LITTLE_ENDIAN); 
    62     long next = ENTRY_VALUE_BEGIN_OFFSET; 
    63     // IFD entry count 
    64     handle.writeShort(getEntryCount()); 
    65     // IMAGE_WIDTH 
    66     writeIFDEntry((short) IFD.IMAGE_WIDTH, IFDType.SHORT, getImageWidth()); 
    67     // IMAGE_LENGTH 
    68     writeIFDEntry((short) IFD.IMAGE_LENGTH, IFDType.SHORT, getImageLength()); 
    69     // BITS_PER_SAMPLE 
    70     next = writeBitsPerSample(next); 
    71     // COMPRESSION 
    72     writeIFDEntry((short) IFD.COMPRESSION, IFDType.SHORT, 
    73                   getCompression()); 
    74     // PHOTOMETRIC_INTERPRETATION 
    75     writeIFDEntry((short) IFD.PHOTOMETRIC_INTERPRETATION, IFDType.SHORT, 
    76                   PhotoInterp.RGB.getCode()); 
    77     // STRIP_OFFSETS 
    78     next = writeIFDEntry((short) IFD.STRIP_OFFSETS, IFDType.LONG, 
    79                          getStripOffsets(), next); 
    80     // SAMPLES_PER_PIXEL 
    81     writeIFDEntry((short) IFD.SAMPLES_PER_PIXEL, IFDType.SHORT, 
    82                    getSamplesPerPixel()); 
    83     // ROWS_PER_STRIP 
    84     next = writeIFDEntry((short) IFD.ROWS_PER_STRIP, IFDType.LONG, 
    85                          getRowsPerStrip(), next); 
    86     // X_RESOLUTION 
    87     next = writeIFDEntry((short) IFD.X_RESOLUTION, IFDType.RATIONAL, 
    88                          getXResolution(), next); 
    89     // Y_RESOLUTION 
    90     next = writeIFDEntry((short) IFD.Y_RESOLUTION, IFDType.RATIONAL, 
    91                          getYResolution(), next); 
    92     // RESOLUTION_UNIT 
    93     writeIFDEntry((short) IFD.RESOLUTION_UNIT, IFDType.SHORT, 
    94                   getResolutionUnit()); 
    95     // Terminating IFD offset 
    96     handle.writeInt(0); 
     68    out = new RandomAccessOutputStream(handle); 
     69    tiffSaver = new TiffSaver(out); 
     70    tiffSaver.writeHeader(); 
     71 
     72    IFD ifd = new IFD(); 
     73    ifd.put(IFD.IMAGE_WIDTH, getImageWidth()); 
     74    ifd.put(IFD.IMAGE_LENGTH, getImageLength()); 
     75    ifd.put(IFD.BITS_PER_SAMPLE, getBitsPerSample()); 
     76    ifd.put(IFD.COMPRESSION, getCompression()); 
     77    ifd.put(IFD.PHOTOMETRIC_INTERPRETATION, PhotoInterp.RGB.getCode()); 
     78    ifd.put(IFD.STRIP_OFFSETS, getStripOffsets()); 
     79    ifd.put(IFD.SAMPLES_PER_PIXEL, getSamplesPerPixel()); 
     80    ifd.put(IFD.ROWS_PER_STRIP, getRowsPerStrip()); 
     81    ifd.put(IFD.X_RESOLUTION, getXResolution()); 
     82    ifd.put(IFD.Y_RESOLUTION, getYResolution()); 
     83    ifd.put(IFD.RESOLUTION_UNIT, getResolutionUnit()); 
     84 
     85    tiffSaver.writeIFD(ifd, 0); 
     86 
    9787    in = new RandomAccessInputStream(handle); 
    9888    tiffParser = new TiffParser(in); 
    9989  } 
    10090 
    101   protected void writeIFDEntry(short tag, IFDType type, int value) 
    102                                throws IOException { 
    103     handle.writeShort(tag);  // IFD entry tag 
    104     handle.writeShort(type.getCode());  // IFD entry type 
    105     handle.writeInt(1);  // IFD entry value count 
    106     handle.writeInt(value);  // The actual value 
    107   } 
    108  
    109   protected long writeIFDEntry(short tag, IFDType type, int[] values, 
    110                                long offset) throws IOException { 
    111     handle.writeShort(tag);  // IFD entry tag 
    112     handle.writeShort(type.getCode());  // IFD entry type 
    113     handle.writeInt(values.length);  // IFD entry value count 
    114     handle.writeInt((int) offset); // The offset to the value 
    115     long before = handle.getFilePointer(); 
    116     handle.seek(offset); 
    117     for (int value : values) { 
    118       handle.writeInt(value); 
    119     } 
    120     long after = handle.getFilePointer(); 
    121     handle.seek(before); 
    122     return after; 
    123   } 
    124  
    125   protected long writeIFDEntry(short tag, IFDType type, short[] values, 
    126                                long offset) throws IOException { 
    127     handle.writeShort(tag);  // IFD entry tag 
    128     handle.writeShort(type.getCode());  // IFD entry type 
    129     handle.writeInt(values.length);  // IFD entry value count 
    130     handle.writeInt((int) offset); // The offset to the value 
    131     long before = handle.getFilePointer(); 
    132     handle.seek(offset); 
    133     for (int value : values) { 
    134       handle.writeShort(value); 
    135     } 
    136     long after = handle.getFilePointer(); 
    137     handle.seek(before); 
    138     return after; 
    139   } 
    140  
    141   protected long writeIFDEntry(short tag, IFDType type, TiffRational values, 
    142                                long offset) throws IOException { 
    143     handle.writeShort(tag);  // IFD entry tag 
    144     handle.writeShort(type.getCode());  // IFD entry type 
    145     handle.writeInt(1);  // IFD entry value count 
    146     handle.writeInt((int) offset); // The offset to the value 
    147     long before = handle.getFilePointer(); 
    148     handle.seek(offset); 
    149     handle.writeInt((int) values.getNumerator()); 
    150     handle.writeInt((int) values.getDenominator()); 
    151     long after = handle.getFilePointer(); 
    152     handle.seek(before); 
    153     return after; 
    154   } 
    155  
    15691  protected int getEntryCount() { 
    15792    return 11; 
    158   } 
    159  
    160   protected long writeBitsPerSample(long offset) throws IOException { 
    161     writeIFDEntry((short) IFD.BITS_PER_SAMPLE, IFDType.SHORT, 
    162                   getBitsPerSample()[0]); 
    163     return offset; 
    16493  } 
    16594 
     
    176105  } 
    177106 
    178   public short[] getBitsPerSample() { 
    179     return new short[] { 8 }; 
     107  public int[] getBitsPerSample() { 
     108    return new int[] { 8 }; 
    180109  } 
    181110 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/BitsPerSampleSamplesPerPixelMismatchMock.java

    r6026 r6887  
    2525import java.io.IOException; 
    2626 
     27import loci.formats.FormatException; 
     28 
    2729/** 
    2830 * @author callan 
     
    3537public class BitsPerSampleSamplesPerPixelMismatchMock extends RGBTiffMock { 
    3638 
    37   public BitsPerSampleSamplesPerPixelMismatchMock() throws IOException { 
     39  public BitsPerSampleSamplesPerPixelMismatchMock() 
     40    throws FormatException, IOException 
     41  { 
    3842    super(); 
    3943  } 
    4044 
    4145  @Override 
    42   public short[] getBitsPerSample() { 
    43     return new short[] { 8, 8 }; 
     46  public int[] getBitsPerSample() { 
     47    return new int[] { 8, 8 }; 
    4448  } 
    4549 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/NonUniformRowsPerStripMock.java

    r6026 r6887  
    2525import java.io.IOException; 
    2626 
     27import loci.formats.FormatException; 
     28 
    2729/** 
    2830 * @author callan 
     
    3537public class NonUniformRowsPerStripMock extends BaseTiffMock { 
    3638 
    37   public NonUniformRowsPerStripMock() throws IOException { 
     39  public NonUniformRowsPerStripMock() throws FormatException, IOException { 
    3840    super(); 
    3941  } 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/RGBTiffMock.java

    r6026 r6887  
    2525import java.io.IOException; 
    2626 
     27import loci.formats.FormatException; 
    2728import loci.formats.tiff.IFD; 
    2829import loci.formats.tiff.IFDType; 
     
    3839public class RGBTiffMock extends BaseTiffMock { 
    3940 
    40   public RGBTiffMock() throws IOException { 
     41  public RGBTiffMock() throws FormatException, IOException { 
    4142    super(); 
    4243  } 
    4344 
    44   protected long writeBitsPerSample(long offset) throws IOException { 
    45     return writeIFDEntry((short) IFD.BITS_PER_SAMPLE, IFDType.SHORT, 
    46                          getBitsPerSample(), offset); 
    47   } 
    48  
    4945  @Override 
    50   public short[] getBitsPerSample() { 
    51     return new short[] { 8, 8, 8 }; 
     46  public int[] getBitsPerSample() { 
     47    return new int[] { 8, 8, 8 }; 
    5248  } 
    5349 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/TiffParserTest.java

    r6663 r6887  
    9999    assertNotNull(bitsPerSample); 
    100100    assertEquals(mock.getSamplesPerPixel(), bitsPerSample.length); 
    101     short[] BITS_PER_SAMPLE = mock.getBitsPerSample(); 
     101    int[] BITS_PER_SAMPLE = mock.getBitsPerSample(); 
    102102    for (int i = 0; i < BITS_PER_SAMPLE.length; i++) { 
    103103      int a = BITS_PER_SAMPLE[i]; 
    104       long b = bitsPerSample[i];  
     104      long b = bitsPerSample[i]; 
    105105      if (a != b) { 
    106106        fail(String.format( 
     
    177177  } 
    178178 
    179   @Test(expectedExceptions={ FormatException.class }) 
     179  @Test 
    180180  public void testBitsPerSampleMismatch() throws IOException, FormatException { 
    181181    mock = new BitsPerSampleSamplesPerPixelMismatchMock(); 
    182182    tiffParser = mock.getTiffParser(); 
    183183    assertTrue(tiffParser.checkHeader()); 
    184     tiffParser.getFirstIFD().getBitsPerSample(); 
     184    IFD ifd = tiffParser.getFirstIFD(); 
     185    int[] bitsPerSample = ifd.getBitsPerSample(); 
     186    int[] mockBitsPerSample = mock.getBitsPerSample(); 
     187    assertEquals(bitsPerSample.length, ifd.getSamplesPerPixel()); 
     188    for (int i=0; i<mockBitsPerSample.length; i++) { 
     189      assertEquals(bitsPerSample[i], mockBitsPerSample[i]); 
     190    } 
    185191  } 
    186192 
  • branches/4.2/components/bio-formats/test/loci/formats/utests/tiff/TiffPixelsTest.java

    r6298 r6887  
    154154    ByteArrayHandle savedData = new ByteArrayHandle(); 
    155155    RandomAccessOutputStream out = new RandomAccessOutputStream(savedData); 
     156    RandomAccessInputStream in = new RandomAccessInputStream(savedData); 
    156157    TiffSaver saver = new TiffSaver(out); 
     158    saver.setInputStream(in); 
    157159    saver.writeImage(data, ifd, 0, FormatTools.UINT16, false); 
    158160    out.close(); 
    159     RandomAccessInputStream in = new RandomAccessInputStream(savedData); 
    160161    TiffParser parser = new TiffParser(in); 
    161162    byte[] plane = new byte[data.length]; 
Note: See TracChangeset for help on using the changeset viewer.