syntax = "proto3";

package biopb.ome;

option java_package = "biopb.ome";
option java_multiple_files = true;

import "google/protobuf/timestamp.proto";
import "biopb/ome/objective_setting.proto";
import "biopb/ome/pixel.proto";

// This describes the environment that the biological sample was in
// during the experiment.
//
message ImagingEnvironment {
    // The Temperature is the define units.
    optional float temperature = 1;

    // The units the Temperature is in - default:Celsius[°C].
    string temperature_unit = 2;

    // AirPressure is the define units.
    optional float air_pressure = 3;

    // The units the AirPressure is in - default:millibars[mbar].
    string air_pressure_unit = 4;

    // Humidity around the sample [units:none] A fraction, as a value from 0.0
    // to 1.0.
    optional float humidity = 5;

    // Carbon Dioxide concentration around the sample [units:none]
    // A fraction, as a value from 0.0 to 1.0.    
    optional float co2_percent = 6;
}


// The StageLabel is used to specify a name and position for a stage position in
// the microscope's reference frame.
message StageLabel {

    string name = 2;

    // The X position of the stage label. Units are set by XUnit.
    optional float x = 3;

    // The units of the X stage position - default:[reference frame]
    string x_unit = 4;

    // The Y position of the stage label. Units are set by YUnit.
    optional float y = 5;

    // The units of the Y stage position - default:[reference frame]
    string y_unit = 6;

    // The Z position of the stage label. Units are set by ZUnit.
    optional float z = 7;

    // The units of the Z stage position - default:[reference frame]
    string z_unit = 8;

}


// This element describes the actual image and its meta-data. The elements that
// are references (ending in Ref or Settings) refer to elements defined outside
// of the Image element. Ref elements are simple links, while Settings elements
// are links with additional values.
//
// If any of the required Image attributes or elements are missing, its
// guaranteed to be an invalid document. 
//
// ExperimenterRef is required for all Images with well formed LSIDs. ImageType
// is a vendor-specific designation of the type of image this is. Examples of
// ImageType include 'STK', 'SoftWorx', etc. The Name attributes are in all
// cases the name of the element instance. In this case, the name of the image,
// not necessarily the filename. Physical size of pixels are microns[µm].
message Image {

    string name = 2;

    // A description for the image. [plain-text multi-line string]
    string description = 3;

    // Even only the date information is relavent here, we use the datatime
    // structure to be consistent with the OME-XML
    google.protobuf.Timestamp acquisition_date = 4; 

    // References
    string experimenter_id = 5;

    string experiment_id = 6;

    string experiment_group_id = 7;

    string instrument_id = 8;

    repeated string microbeam_manipulation_ids = 9;

    repeated string roi_ids = 10;

    repeated string annotation_ids = 11;

    // Settings
    ObjectiveSetting objective_setting = 12;

    ImagingEnvironment imaging_environment = 13;

    StageLabel stage_label = 14;

    // pixle
    Pixels pixels = 15;
}

