Skip to content

Commit

Permalink
chore: Build Models (#53)
Browse files Browse the repository at this point in the history
Co-authored-by: github-merge-queue[bot] <118344674+github-merge-queue[bot]@users.noreply.github.com>
  • Loading branch information
kjy5 and github-merge-queue[bot] authored Sep 24, 2024
1 parent 3ba93ca commit 8f3e7b9
Show file tree
Hide file tree
Showing 16 changed files with 99 additions and 26 deletions.
100 changes: 85 additions & 15 deletions models/csharp/PinpointModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,114 @@
[Serializable]
public struct AffineTransformModel
{
public string Name;
public string Prefix;
public Vector3 Scaling;
public Vector3 Rotation;

public AffineTransformModel(Vector3 scaling, Vector3 rotation)
public AffineTransformModel(string name, string prefix, Vector3 scaling, Vector3 rotation)
{
Name = name;
Prefix = prefix;
Scaling = scaling;
Rotation = rotation;
}
}


[Serializable]
public struct CraniotomyGroup
public struct CraniotomyModel
{
public string Atlas;
public CraniotomyModel[] Data;
public int Index;
public Vector2 Size;
public Vector3 Position;

public CraniotomyGroup(string atlas, CraniotomyModel[] data)
public CraniotomyModel(int index, Vector2 size, Vector3 position)
{
Atlas = atlas;
Data = data;
Index = index;
Size = size;
Position = position;
}
}


[Serializable]
public struct CraniotomyModel
public struct InsertionModel
{
public int Index;
public Vector2 Size;
public Vector3 Position;
public bool Rectangle;
public Vector3 Angles;
public string AtlasName;
public string TransformName;
public Vector3 ReferenceCoord;

public CraniotomyModel(int index, Vector2 size, Vector3 position, bool rectangle)
public InsertionModel(Vector3 position, Vector3 angles, string atlasName, string transformName, Vector3 referenceCoord)
{
Index = index;
Size = size;
Position = position;
Rectangle = rectangle;
Angles = angles;
AtlasName = atlasName;
TransformName = transformName;
ReferenceCoord = referenceCoord;
}
}


[Serializable]
public struct ProbeModel
{
public InsertionModel Insertion;
public string Uuid;
public string Name;
public Color Color;

public ProbeModel(InsertionModel insertion, string uuid, string name, Color color)
{
Insertion = insertion;
Uuid = uuid;
Name = name;
Color = color;
}
}


[Serializable]
public struct RigModel
{
public string Name;
public string Image;
public Vector3 Position;
public Vector3 Rotation;
public bool Active;

public RigModel(string name, string image, Vector3 position, Vector3 rotation, bool active)
{
Name = name;
Image = image;
Position = position;
Rotation = rotation;
Active = active;
}
}

[Serializable]
public struct SceneModel
{
public string AtlasName;
public string TransformName;
public ProbeModel[] Probes;
public RigModel[] Rigs;
public CraniotomyModel[] Craniotomies;
public string[] SceneData;
public string Settings;

public SceneModel(string atlasName, string transformName, ProbeModel[] probes, RigModel[] rigs, CraniotomyModel[] craniotomies, string[] sceneData, string settings)
{
AtlasName = atlasName;
TransformName = transformName;
Probes = probes;
Rigs = rigs;
Craniotomies = craniotomies;
SceneData = sceneData;
Settings = settings;
}
}

2 changes: 1 addition & 1 deletion models/schemas/ephys_link/AngularResponse.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "description": "Response format for the manipulator angles.\n\n:param angles: Position of the manipulator.\n:type angles: Vector3", "properties": {"Angles": {"allOf": [{"$ref": "#/$defs/Vector3"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "AngularResponse", "type": "object"}
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "description": "Response format for the manipulator angles.\n\n:param angles: Position of the manipulator.\n:type angles: Vector3", "properties": {"Angles": {"$ref": "#/$defs/Vector3", "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "AngularResponse", "type": "object"}
2 changes: 1 addition & 1 deletion models/schemas/ephys_link/GetManipulatorsResponse.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Vector4": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Response format for requesting available manipulators.\n\n:param manipulators: List of manipulators.\n:type manipulators: list[str]\n:param num_axes: Number of axes for the manipulators.\n:type num_axes: int\n:param dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).\n:type dimensions: Vector4\n:param error: Error message if any.\n:type error: str", "properties": {"Manipulators": {"items": {"type": "string"}, "title": "Manipulators", "type": "array"}, "NumAxes": {"default": 0, "minimum": -1, "title": "Numaxes", "type": "integer"}, "Dimensions": {"allOf": [{"$ref": "#/$defs/Vector4"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "GetManipulatorsResponse", "type": "object"}
{"$defs": {"Vector4": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Response format for requesting available manipulators.\n\n:param manipulators: List of manipulators.\n:type manipulators: list[str]\n:param num_axes: Number of axes for the manipulators.\n:type num_axes: int\n:param dimensions: Dimensions of the manipulators (3-axis manipulators should set w to 0).\n:type dimensions: Vector4\n:param error: Error message if any.\n:type error: str", "properties": {"Manipulators": {"items": {"type": "string"}, "title": "Manipulators", "type": "array"}, "NumAxes": {"default": 0, "minimum": -1, "title": "Numaxes", "type": "integer"}, "Dimensions": {"$ref": "#/$defs/Vector4", "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "GetManipulatorsResponse", "type": "object"}
2 changes: 1 addition & 1 deletion models/schemas/ephys_link/PositionalResponse.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Vector4": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Response format for the manipulator position.\n\n:param position: Position of the manipulator.\n:type position: Vector4\n:param error: Error message if any.\n:type error: str", "properties": {"Position": {"allOf": [{"$ref": "#/$defs/Vector4"}], "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "PositionalResponse", "type": "object"}
{"$defs": {"Vector4": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}, "w": {"default": 0.0, "title": "W", "type": "number"}}, "title": "Vector4", "type": "object"}}, "description": "Response format for the manipulator position.\n\n:param position: Position of the manipulator.\n:type position: Vector4\n:param error: Error message if any.\n:type error: str", "properties": {"Position": {"$ref": "#/$defs/Vector4", "default": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}}, "Error": {"default": "", "title": "Error", "type": "string"}}, "title": "PositionalResponse", "type": "object"}
2 changes: 1 addition & 1 deletion models/schemas/pinpoint/AffineTransformModel.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Scaling": {"$ref": "#/$defs/Vector3"}, "Rotation": {"$ref": "#/$defs/Vector3"}}, "required": ["Scaling", "Rotation"], "title": "AffineTransformModel", "type": "object"}
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Name": {"title": "Name", "type": "string"}, "Prefix": {"title": "Prefix", "type": "string"}, "Scaling": {"$ref": "#/$defs/Vector3"}, "Rotation": {"$ref": "#/$defs/Vector3"}}, "required": ["Name", "Prefix", "Scaling", "Rotation"], "title": "AffineTransformModel", "type": "object"}
1 change: 0 additions & 1 deletion models/schemas/pinpoint/CraniotomyGroup.json

This file was deleted.

2 changes: 1 addition & 1 deletion models/schemas/pinpoint/CraniotomyModel.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}, "Rectangle": {"default": false, "title": "Rectangle", "type": "boolean"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"}
{"$defs": {"Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"}
1 change: 1 addition & 0 deletions models/schemas/pinpoint/InsertionModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"}
1 change: 1 addition & 0 deletions models/schemas/pinpoint/ProbeModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "InsertionModel": {"properties": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Insertion": {"$ref": "#/$defs/InsertionModel"}, "Uuid": {"title": "Uuid", "type": "string"}, "Name": {"title": "Name", "type": "string"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["Insertion", "Uuid", "Name", "Color"], "title": "ProbeModel", "type": "object"}
1 change: 1 addition & 0 deletions models/schemas/pinpoint/RigModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$defs": {"Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"Name": {"title": "Name", "type": "string"}, "Image": {"title": "Image", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3", "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Rotation": {"$ref": "#/$defs/Vector3", "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Active": {"title": "Active", "type": "boolean"}}, "required": ["Name", "Image", "Active"], "title": "RigModel", "type": "object"}
1 change: 1 addition & 0 deletions models/schemas/pinpoint/SceneModel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$defs": {"Color": {"properties": {"r": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "R", "type": "number"}, "g": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "G", "type": "number"}, "b": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "B", "type": "number"}, "a": {"default": 1, "maximum": 1.0, "minimum": 0.0, "title": "A", "type": "number"}}, "title": "Color", "type": "object"}, "CraniotomyModel": {"properties": {"Index": {"title": "Index", "type": "integer"}, "Size": {"$ref": "#/$defs/Vector2"}, "Position": {"$ref": "#/$defs/Vector3"}}, "required": ["Index", "Size", "Position"], "title": "CraniotomyModel", "type": "object"}, "InsertionModel": {"properties": {"Position": {"$ref": "#/$defs/Vector3"}, "Angles": {"$ref": "#/$defs/Vector3"}, "AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "ReferenceCoord": {"$ref": "#/$defs/Vector3"}}, "required": ["Position", "Angles", "AtlasName", "TransformName", "ReferenceCoord"], "title": "InsertionModel", "type": "object"}, "ProbeModel": {"properties": {"Insertion": {"$ref": "#/$defs/InsertionModel"}, "Uuid": {"title": "Uuid", "type": "string"}, "Name": {"title": "Name", "type": "string"}, "Color": {"$ref": "#/$defs/Color"}}, "required": ["Insertion", "Uuid", "Name", "Color"], "title": "ProbeModel", "type": "object"}, "RigModel": {"properties": {"Name": {"title": "Name", "type": "string"}, "Image": {"title": "Image", "type": "string"}, "Position": {"$ref": "#/$defs/Vector3", "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Rotation": {"$ref": "#/$defs/Vector3", "default": {"x": 0.0, "y": 0.0, "z": 0.0}}, "Active": {"title": "Active", "type": "boolean"}}, "required": ["Name", "Image", "Active"], "title": "RigModel", "type": "object"}, "Vector2": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}}, "title": "Vector2", "type": "object"}, "Vector3": {"properties": {"x": {"default": 0.0, "title": "X", "type": "number"}, "y": {"default": 0.0, "title": "Y", "type": "number"}, "z": {"default": 0.0, "title": "Z", "type": "number"}}, "title": "Vector3", "type": "object"}}, "properties": {"AtlasName": {"title": "Atlasname", "type": "string"}, "TransformName": {"title": "Transformname", "type": "string"}, "Probes": {"items": {"$ref": "#/$defs/ProbeModel"}, "title": "Probes", "type": "array"}, "Rigs": {"items": {"$ref": "#/$defs/RigModel"}, "title": "Rigs", "type": "array"}, "Craniotomies": {"items": {"$ref": "#/$defs/CraniotomyModel"}, "title": "Craniotomies", "type": "array"}, "SceneData": {"items": {"type": "string"}, "title": "Scenedata", "type": "array"}, "Settings": {"title": "Settings", "type": "string"}}, "required": ["AtlasName", "TransformName", "Probes", "Rigs", "Craniotomies", "SceneData", "Settings"], "title": "SceneModel", "type": "object"}
Loading

0 comments on commit 8f3e7b9

Please sign in to comment.