Changeset 6388
- Timestamp:
- 05/25/10 16:21:27 (10 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/components/bio-formats/src/loci/formats/in/LeicaHandler.java
r6376 r6388 105 105 106 106 private MetadataLevel level; 107 private int laserCount = 0; 107 108 108 109 // -- Constructor -- … … 192 193 193 194 for (int i=0; i<xPos.size(); i++) { 194 int nPlanes = 195 coreMeta.imageCount / (coreMeta.rgb ? 1 : coreMeta.sizeC); 196 for (int image=0; image<nPlanes; image++) { 197 int index = image * nChannels + i; 198 store.setPlanePositionX(xPos.get(i), numDatasets, index); 199 store.setPlanePositionY(yPos.get(i), numDatasets, index); 200 store.setPlanePositionZ(zPos.get(i), numDatasets, index); 195 for (int image=0; image<coreMeta.imageCount; image++) { 196 store.setPlanePositionX(xPos.get(i), numDatasets, image); 197 store.setPlanePositionY(yPos.get(i), numDatasets, image); 198 store.setPlanePositionZ(zPos.get(i), numDatasets, image); 201 199 } 202 200 } … … 331 329 String id = MetadataTools.createLSID("Filter", numDatasets, filter); 332 330 if (i < numChannels && detectors.get(filter).active) { 331 String lsid = MetadataTools.createLSID("Channel", numDatasets, i); 332 store.setChannelID(lsid, numDatasets, i); 333 333 store.setLightPathEmissionFilterRef(id, numDatasets, i, 0); 334 334 } … … 339 339 core.add(new CoreMetadata()); 340 340 numDatasets++; 341 laserCount = 0; 341 342 linkedInstruments = false; 342 343 detectorChannel = 0; … … 520 521 if (attribute.equals("NumericalAperture")) { 521 522 store.setObjectiveLensNA(new Double(variant), numDatasets, 0); 522 store.setObjectiveCorrection(Correction.OTHER, numDatasets, 0);523 store.setObjectiveImmersion(Immersion.OTHER, numDatasets, 0);524 523 } 525 524 else if (attribute.equals("OrderNumber")) { 526 525 store.setObjectiveSerialNumber(variant, numDatasets, 0); 527 store.setObjectiveCorrection(Correction.OTHER, numDatasets, 0);528 store.setObjectiveImmersion(Immersion.OTHER, numDatasets, 0);529 526 } 530 527 else if (objectClass.equals("CDetectionUnit")) { … … 610 607 else if (attribute.equals("XPos")) { 611 608 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 612 int nPlanes = coreMeta.imageCount / c;609 int nPlanes = coreMeta.imageCount; 613 610 Double posX = new Double(variant); 614 611 for (int image=0; image<nPlanes; image++) { 615 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 616 if (index >= nPlanes) continue; 617 store.setPlanePositionX(posX, numDatasets, index); 612 store.setPlanePositionX(posX, numDatasets, image); 618 613 } 619 614 if (numChannels == 0) xPos.add(posX); … … 621 616 else if (attribute.equals("YPos")) { 622 617 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 623 int nPlanes = coreMeta.imageCount / c;618 int nPlanes = coreMeta.imageCount; 624 619 Double posY = new Double(variant); 625 620 for (int image=0; image<nPlanes; image++) { 626 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 627 if (index >= nPlanes) continue; 628 store.setPlanePositionY(posY, numDatasets, index); 621 store.setPlanePositionY(posY, numDatasets, image); 629 622 } 630 623 if (numChannels == 0) yPos.add(posY); … … 632 625 else if (attribute.equals("ZPos")) { 633 626 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 634 int nPlanes = coreMeta.imageCount / c;627 int nPlanes = coreMeta.imageCount; 635 628 Double posZ = new Double(variant); 636 629 for (int image=0; image<nPlanes; image++) { 637 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 638 if (index >= nPlanes) continue; 639 store.setPlanePositionZ(posZ, numDatasets, index); 630 store.setPlanePositionZ(posZ, numDatasets, image); 640 631 } 641 632 if (numChannels == 0) zPos.add(posZ); … … 718 709 } 719 710 711 store.setDetectorID(id, numDatasets, nextChannel); 720 712 if (detector != null) { 721 store.setDetectorID(id, numDatasets, nextChannel);722 713 store.setDetectorSettingsGain(gain, numDatasets, nextChannel); 723 714 store.setDetectorSettingsOffset(offset, numDatasets, nextChannel); … … 759 750 l.id = MetadataTools.createLSID("LightSource", numDatasets, l.index); 760 751 l.wavelength = new Integer(attributes.getValue("LaserLine")); 752 while (l.index > laserCount) { 753 String lsid = 754 MetadataTools.createLSID("LightSource", numDatasets, laserCount); 755 store.setLaserID(lsid, numDatasets, laserCount); 756 laserCount++; 757 } 761 758 store.setLaserID(l.id, numDatasets, l.index); 759 laserCount++; 762 760 if (l.wavelength > 0) { 763 761 store.setLaserWavelength( … … 948 946 if (i < x.size() - 1) points.append(" "); 949 947 } 950 store.setPolylinePoints(points.toString(), roi, 0);951 store.setPolylineClosed(Boolean.TRUE, roi, 0);948 store.setPolylinePoints(points.toString(), roi, 1); 949 store.setPolylineClosed(Boolean.TRUE, roi, 1); 952 950 953 951 break; 954 952 case TEXT: 955 953 case RECTANGLE: 956 store.setRectangleX(roiX - Math.abs(cornerX), roi, 0);957 store.setRectangleY(roiY - Math.abs(cornerY), roi, 0);954 store.setRectangleX(roiX - Math.abs(cornerX), roi, 1); 955 store.setRectangleY(roiY - Math.abs(cornerY), roi, 1); 958 956 double width = 2 * Math.abs(cornerX); 959 957 double height = 2 * Math.abs(cornerY); 960 store.setRectangleWidth(width, roi, 0);961 store.setRectangleHeight(height, roi, 0);958 store.setRectangleWidth(width, roi, 1); 959 store.setRectangleHeight(height, roi, 1); 962 960 963 961 break; … … 965 963 case ARROW: 966 964 case LINE: 967 store.setLineX1(roiX + x.get(0), roi, 0);968 store.setLineY1(roiY + y.get(0), roi, 0);969 store.setLineX2(roiX + x.get(1), roi, 0);970 store.setLineY2(roiY + y.get(1), roi, 0);965 store.setLineX1(roiX + x.get(0), roi, 1); 966 store.setLineY1(roiY + y.get(0), roi, 1); 967 store.setLineX2(roiX + x.get(1), roi, 1); 968 store.setLineY2(roiY + y.get(1), roi, 1); 971 969 break; 972 970 } -
branches/4.2/components/bio-formats/src/loci/formats/ome/OMEXMLMetadataImpl.java
r6383 r6388 5541 5541 model.addModelObject(id, o3); 5542 5542 o3.setID(id); 5543 if (o3.getLightPath() == null) { 5544 o3.setLightPath(new LightPath()); 5545 } 5543 5546 } 5544 5547 -
trunk/components/bio-formats/src/loci/formats/in/LeicaHandler.java
r6377 r6388 105 105 106 106 private MetadataLevel level; 107 private int laserCount = 0; 107 108 108 109 // -- Constructor -- … … 192 193 193 194 for (int i=0; i<xPos.size(); i++) { 194 int nPlanes = 195 coreMeta.imageCount / (coreMeta.rgb ? 1 : coreMeta.sizeC); 196 for (int image=0; image<nPlanes; image++) { 197 int index = image * nChannels + i; 198 store.setPlanePositionX(xPos.get(i), numDatasets, index); 199 store.setPlanePositionY(yPos.get(i), numDatasets, index); 200 store.setPlanePositionZ(zPos.get(i), numDatasets, index); 195 for (int image=0; image<coreMeta.imageCount; image++) { 196 store.setPlanePositionX(xPos.get(i), numDatasets, image); 197 store.setPlanePositionY(yPos.get(i), numDatasets, image); 198 store.setPlanePositionZ(zPos.get(i), numDatasets, image); 201 199 } 202 200 } … … 331 329 String id = MetadataTools.createLSID("Filter", numDatasets, filter); 332 330 if (i < numChannels && detectors.get(filter).active) { 331 String lsid = MetadataTools.createLSID("Channel", numDatasets, i); 332 store.setChannelID(lsid, numDatasets, i); 333 333 store.setLightPathEmissionFilterRef(id, numDatasets, i, 0); 334 334 } … … 339 339 core.add(new CoreMetadata()); 340 340 numDatasets++; 341 laserCount = 0; 341 342 linkedInstruments = false; 342 343 detectorChannel = 0; … … 520 521 if (attribute.equals("NumericalAperture")) { 521 522 store.setObjectiveLensNA(new Double(variant), numDatasets, 0); 522 store.setObjectiveCorrection(Correction.OTHER, numDatasets, 0);523 store.setObjectiveImmersion(Immersion.OTHER, numDatasets, 0);524 523 } 525 524 else if (attribute.equals("OrderNumber")) { 526 525 store.setObjectiveSerialNumber(variant, numDatasets, 0); 527 store.setObjectiveCorrection(Correction.OTHER, numDatasets, 0);528 store.setObjectiveImmersion(Immersion.OTHER, numDatasets, 0);529 526 } 530 527 else if (objectClass.equals("CDetectionUnit")) { … … 610 607 else if (attribute.equals("XPos")) { 611 608 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 612 int nPlanes = coreMeta.imageCount / c;609 int nPlanes = coreMeta.imageCount; 613 610 Double posX = new Double(variant); 614 611 for (int image=0; image<nPlanes; image++) { 615 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 616 if (index >= nPlanes) continue; 617 store.setPlanePositionX(posX, numDatasets, index); 612 store.setPlanePositionX(posX, numDatasets, image); 618 613 } 619 614 if (numChannels == 0) xPos.add(posX); … … 621 616 else if (attribute.equals("YPos")) { 622 617 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 623 int nPlanes = coreMeta.imageCount / c;618 int nPlanes = coreMeta.imageCount; 624 619 Double posY = new Double(variant); 625 620 for (int image=0; image<nPlanes; image++) { 626 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 627 if (index >= nPlanes) continue; 628 store.setPlanePositionY(posY, numDatasets, index); 621 store.setPlanePositionY(posY, numDatasets, image); 629 622 } 630 623 if (numChannels == 0) yPos.add(posY); … … 632 625 else if (attribute.equals("ZPos")) { 633 626 int c = coreMeta.rgb || coreMeta.sizeC == 0 ? 1 : coreMeta.sizeC; 634 int nPlanes = coreMeta.imageCount / c;627 int nPlanes = coreMeta.imageCount; 635 628 Double posZ = new Double(variant); 636 629 for (int image=0; image<nPlanes; image++) { 637 int index = image * (coreMeta.rgb ? 1 : coreMeta.sizeC); 638 if (index >= nPlanes) continue; 639 store.setPlanePositionZ(posZ, numDatasets, index); 630 store.setPlanePositionZ(posZ, numDatasets, image); 640 631 } 641 632 if (numChannels == 0) zPos.add(posZ); … … 718 709 } 719 710 711 store.setDetectorID(id, numDatasets, nextChannel); 720 712 if (detector != null) { 721 store.setDetectorID(id, numDatasets, nextChannel);722 713 store.setDetectorSettingsGain(gain, numDatasets, nextChannel); 723 714 store.setDetectorSettingsOffset(offset, numDatasets, nextChannel); … … 759 750 l.id = MetadataTools.createLSID("LightSource", numDatasets, l.index); 760 751 l.wavelength = new Integer(attributes.getValue("LaserLine")); 752 while (l.index > laserCount) { 753 String lsid = 754 MetadataTools.createLSID("LightSource", numDatasets, laserCount); 755 store.setLaserID(lsid, numDatasets, laserCount); 756 laserCount++; 757 } 761 758 store.setLaserID(l.id, numDatasets, l.index); 759 laserCount++; 762 760 if (l.wavelength > 0) { 763 761 store.setLaserWavelength( … … 948 946 if (i < x.size() - 1) points.append(" "); 949 947 } 950 store.setPolylinePoints(points.toString(), roi, 0);951 store.setPolylineClosed(Boolean.TRUE, roi, 0);948 store.setPolylinePoints(points.toString(), roi, 1); 949 store.setPolylineClosed(Boolean.TRUE, roi, 1); 952 950 953 951 break; 954 952 case TEXT: 955 953 case RECTANGLE: 956 store.setRectangleX(roiX - Math.abs(cornerX), roi, 0);957 store.setRectangleY(roiY - Math.abs(cornerY), roi, 0);954 store.setRectangleX(roiX - Math.abs(cornerX), roi, 1); 955 store.setRectangleY(roiY - Math.abs(cornerY), roi, 1); 958 956 double width = 2 * Math.abs(cornerX); 959 957 double height = 2 * Math.abs(cornerY); 960 store.setRectangleWidth(width, roi, 0);961 store.setRectangleHeight(height, roi, 0);958 store.setRectangleWidth(width, roi, 1); 959 store.setRectangleHeight(height, roi, 1); 962 960 963 961 break; … … 965 963 case ARROW: 966 964 case LINE: 967 store.setLineX1(roiX + x.get(0), roi, 0);968 store.setLineY1(roiY + y.get(0), roi, 0);969 store.setLineX2(roiX + x.get(1), roi, 0);970 store.setLineY2(roiY + y.get(1), roi, 0);965 store.setLineX1(roiX + x.get(0), roi, 1); 966 store.setLineY1(roiY + y.get(0), roi, 1); 967 store.setLineX2(roiX + x.get(1), roi, 1); 968 store.setLineY2(roiY + y.get(1), roi, 1); 971 969 break; 972 970 } -
trunk/components/bio-formats/src/loci/formats/ome/OMEXMLMetadataImpl.java
r6383 r6388 5541 5541 model.addModelObject(id, o3); 5542 5542 o3.setID(id); 5543 if (o3.getLightPath() == null) { 5544 o3.setLightPath(new LightPath()); 5545 } 5543 5546 } 5544 5547
Note: See TracChangeset
for help on using the changeset viewer.