{ "$id":                    "https://schemas.mpai.community/TFA/V1.5/data/MedicalImageQualifier.json",
  "$schema":                "https://json-schema.org/draft/2020-12/schema",

  "title":                  "MedicalImageQualifier",
                            "description": "Metadata, subtypes, format, and attributes of medical imaging content.",
                            "type": "object",
                            "required": [ "Header", "MedicalImageQualifierID", "SubType", "Format", "Trace" ],
                            "additionalProperties": false, "properties": {

    "Header":               { "type": "string", "pattern": "^TFA-MIQ-V[0-9]{1,2}[.][0-9]{1,2}$" },

    "MedicalImageQualifierID": { "type": "string" },

    "SubType":              { "type": "object", "required": [ "ScanningTechnology" ], "additionalProperties": false,
                              "properties": {
      "ScanningTechnology": { "type": "string", "enum": [ "CT", "MRI", "PET", "SPECT", "X-Ray" ] },
      "AlphaChannel":       { "type": "boolean" } } },

    "Format":               { "type": "object", "required": [ "Content" ], "additionalProperties": false, "properties": {

      "Pixels":             { "type": "string", 
                              "enum": [ "Integer-Little-Endian", "Integer-Big-Endian", "Real", "Complex" ] },

      "Static":             { "type": "object", "additionalProperties": false, "properties": {

        "Dimensionality":   { "type": "string", "enum": [ "2D", "3D" ] },

        "Formats":          { "type": "object", "additionalProperties": false, "properties": {
          "Analyze":        { "type": "boolean" },
          "DICOM":          { "type": "boolean" },
          "MINC":           { "type": "boolean" },
          "NIfTI":          { "type": "boolean" },
          "MGH":            { "type": "boolean" } } },

        "NIfTIVariants":    { "type": "array", "items": { "type": "string", "enum": [ ".nii", ".nii.gz" ] },
                              "uniqueItems": true },

        "MINCVariants":     { "type": "array", "items": { "type": "string", "enum": [ "MINC1", "MINC2" ] },
                              "uniqueItems": true },

        "MGHVariants":      { "type": "array", "items": { "type": "string", "enum": [ "MGH", "MGZ" ] },
                              "uniqueItems": true },

        "SurfaceBased":     { "type": "object", "additionalProperties": false, "properties": {

          "GIFTI":          { "type": "string", "enum": [ "SURF", "FUNC", "SHAPE", "LABEL" ] },

          "CIFTI":          { "type": "string", "enum": [ "DTSeries", "DLabel", "DScalar", "DConn" ] } } } } },

      "Dynamic":            { "type": "object", "additionalProperties": false, "properties": {
        "Dimensionality":   { "type": "string", "enum": [ "2D", "3D" ] } } },

      "Content":            { "type": "string" } } },

    "Attributes":           { "type": "object", "additionalProperties": false, "properties": {
      "Dimensionality":     { "type": "string", "enum": [ "2D", "3D" ] } } },

    "DataExchangeMetadata": { "$ref": "https://schemas.mpai.community/AIF/V3.0/data/DataExchangeMetadata.json" },
    "Trace":                { "$ref": "https://schemas.mpai.community/AIF/V3.0/data/Trace.json" },
    "DescrMetadata":        { "type": "string", "maxLength": 2000 } } }