<?xml version="1.0" encoding="UTF-8"?>
<!--
University of Illinois/NCSA Open Source License

Copyright (c) 2005, Imaging Technology Group, All rights reserved.

Developed by:

Imaging Technology Group           
Beckman Institute for Advanced Science and Technology
University of Illinois at Urbana-Champaign

http://virtual.itg.uiuc.edu
virtual@itg.uiuc.edu

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal with the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject
to the following conditions:

Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.

Neither the names of the Imaging Technology Group, Beckman Institute
for Advanced Science and Technology, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used
to endorse or promote products derived from this Software without
specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="InfoRefType">
		<xs:simpleContent>
			<xs:extension base="xs:token">
				<xs:attribute name="href" type="xs:anyURI"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:element name="Element">
		<xs:complexType>
			<xs:attribute name="id" type="xs:token"/>
			<xs:attribute name="path" type="xs:token"/>
			<xs:attribute name="pxsize" type="xs:decimal"/>
			<xs:attribute name="scale" type="xs:decimal"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Bremsstrahlung">
		<xs:complexType>
			<xs:attribute name="scale" type="xs:decimal"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Mask">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="FileMask" type="xs:token"/>
				<xs:element name="BaseMagnification" type="xs:decimal"/>
				<xs:element name="PixelSize" type="xs:decimal"/>
				<xs:element name="OverlapPercent" type="xs:decimal"/>
				<xs:element name="Area" type="xs:decimal"/>
				<xs:element name="Step" type="xs:decimal"/>
				<xs:element name="Threshold" type="xs:decimal"/>
				<xs:element name="Method" type="xs:token" minOccurs="0" maxOccurs="1"/>
				<xs:element name="FlatField" type="xs:token" minOccurs="0" maxOccurs="1"/>
				<xs:element name="MasterLevel" type="xs:decimal" minOccurs="0" maxOccurs="1"/>
			</xs:sequence>
			<xs:attribute name="id"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="File">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="FileMask" type="xs:token"/>
				<xs:element name="BaseMagnification" type="xs:decimal"/>
				<xs:element name="PixelSize" type="xs:decimal"/>
			</xs:sequence>
			<xs:attribute name="id"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Folder">
		<xs:complexType>
			<xs:choice>
				<xs:element ref="Folder" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="Mask"/>
				<xs:element ref="File"/>
			</xs:choice>
			<xs:attribute name="id" type="xs:token"/>
			<xs:attribute name="srcPath" type="xs:token"/>
			<xs:attribute name="name" type="xs:token"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="TileSize">
		<xs:complexType>
			<xs:attribute name="width" type="xs:integer"/>
			<xs:attribute name="height" type="xs:integer"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="PixelSize">
		<xs:complexType>
			<xs:attribute name="width" type="xs:decimal"/>
			<xs:attribute name="height" type="xs:decimal"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ImageSize">
		<xs:complexType>
			<xs:attribute name="width" type="xs:integer"/>
			<xs:attribute name="height" type="xs:integer"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Control">
		<xs:complexType>
			<xs:choice>
				<xs:element ref="Element" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="Bremsstrahlung" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="Control" minOccurs="0" maxOccurs="unbounded"/>
				<xs:sequence>
					<xs:element ref="TileSize"/>
					<xs:element ref="PixelSize"/>
					<xs:element ref="ImageSize"/>
				</xs:sequence>
			</xs:choice>
			<xs:attribute name="id" type="xs:token"/>
			<xs:attribute name="DisplayString" type="xs:token"/>
			<xs:attribute name="FolderName" type="xs:token"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="Specimen">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="MetaData">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="Instrument">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Type">
											<xs:simpleType>
												<xs:restriction base="xs:token">
													<xs:enumeration value="EM"/>
													<xs:enumeration value="LM"/>
													<xs:enumeration value="SPM"/>
													<xs:enumeration value="ART"/>
													<xs:enumeration value="MACRO"/>
												</xs:restriction>
											</xs:simpleType>
										</xs:element>
										<xs:element name="LongName" type="xs:token"/>
										<xs:element name="Model" type="xs:token"/>
										<xs:element name="Thumbnail" type="xs:token"/>
										<xs:element name="InfoRef" type="InfoRefType" minOccurs="0" maxOccurs="unbounded"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="SampleInfo">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="Preparer" type="xs:token"/>
										<xs:element name="CollectionDate" type="xs:date"/>
										<xs:element name="Name" type="xs:token"/>
										<xs:element name="SpecimenID" type="xs:unsignedLong"/>
										<xs:element name="Thumbnail" type="xs:token"/>
										<xs:element name="NavigationThumbnail" type="xs:token"/>
										<xs:element name="InfoRef" type="InfoRefType" minOccurs="0" maxOccurs="unbounded"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="InputStructure">
					<xs:complexType>
						<xs:choice>
							<xs:element ref="Folder" minOccurs="0" maxOccurs="unbounded"/>
							<xs:element ref="Mask"/>
							<xs:element ref="File"/>
						</xs:choice>
					</xs:complexType>
				</xs:element>
				<xs:element name="ControlDescriptors">
					<xs:complexType>
						<xs:choice>
							<xs:element ref="Control" minOccurs="1" maxOccurs="unbounded"/>
						</xs:choice>
					</xs:complexType>
				</xs:element>
				<xs:element name="BuilderRuntimeInformation">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="TimeStamp" type="xs:dateTime"/>
							<xs:element name="BuilderVersion" type="xs:token"/>
							<xs:element name="XMLversion" type="xs:token"/>
							<xs:element name="ImagesProcessed" type="xs:integer"/>
							<xs:element name="TotalPixels" type="xs:long"/>
							<xs:element name="BytesProcessed" type="xs:long"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="XMLversion" type="xs:token"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
