Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Feb 24, 2024
2 parents e513275 + 4c41972 commit 6baa121
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,113 @@ MathWorks provides a free basic version of [MATLAB Online](https://uk.mathworks.
## Installation

openMINDS for MATLAB can be installed from MATLAB's addon manager (recommended). It is also possible to download the MATLAB toolbox from FileExchange or from the Releases page of this repository and install it manually.

## Getting Started


### Configure MATLAB's path to use the latest model versions

Note: Make sure **MATLAB_openMINDS** has been added to MATLAB's [search path](https://se.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html). If you installed **MATLAB_openMINDS** using the AddonManager, this should already have been taken care of.

```matlab
selectOpenMindsVersion("latest")
```
### Import schemas from core model
```matlab
import openminds.core.*
```
### Create a Subject
```matlab
% Create a new demo subject
subject1 = Subject('species', 'musMusculus', 'biologicalSex', 'male', 'lookupLabel', 'demo_subject1');
disp(subject1)
```

```TextOutput
Subject (https://openminds.ebrains.eu/core/Subject) with properties:
biologicalSex: male (BiologicalSex)
internalIdentifier: ""
isPartOf: [None] (SubjectGroup)
lookupLabel: "demo_subject1"
species: Mus musculus (One of: Species, Strain)
studiedState: [None] (SubjectState)
Required Properties: species, studiedState
```
### Create a Subject State
```matlab
subjectState = openminds.core.SubjectState('lookupLabel', 'demo_state')
```

```TextOutput
subjectState =
SubjectState (https://openminds.ebrains.eu/core/SubjectState) with properties:
additionalRemarks: ""
age: [None] (One of: QuantitativeValue, QuantitativeValueRange)
ageCategory: [None] (AgeCategory)
attribute: [None] (SubjectAttribute)
descendedFrom: [None] (SubjectState)
handedness: [None] (Handedness)
internalIdentifier: ""
lookupLabel: "demo_state"
pathology: [None] (Any of: Disease, DiseaseModel)
relativeTimeIndication: [None] (One of: QuantitativeValue, QuantitativeValueRange)
weight: [None] (One of: QuantitativeValue, QuantitativeValueRange)
Required Properties: ageCategory
```

```matlab
% Add subject state to subject
subject1.studiedState = subjectState;
disp(subject1)
```

```TextOutput
Subject (https://openminds.ebrains.eu/core/Subject) with properties:
biologicalSex: male (BiologicalSex)
internalIdentifier: ""
isPartOf: [None] (SubjectGroup)
lookupLabel: "demo_subject1"
species: Mus musculus (One of: Species, Strain)
studiedState: demo_state (SubjectState)
Required Properties: species, studiedState
```

```matlab
subjectState.lookupLabel = "demo_subjectstate_pre_recording";
subjectStatePost = openminds.core.SubjectState('lookupLabel', 'demo_subjectstate_post_recording')
```

```TextOutput
subjectStatePost =
SubjectState (https://openminds.ebrains.eu/core/SubjectState) with properties:
additionalRemarks: ""
age: [None] (One of: QuantitativeValue, QuantitativeValueRange)
ageCategory: [None] (AgeCategory)
attribute: [None] (SubjectAttribute)
descendedFrom: [None] (SubjectState)
handedness: [None] (Handedness)
internalIdentifier: ""
lookupLabel: "demo_subjectstate_post_recording"
pathology: [None] (Any of: Disease, DiseaseModel)
relativeTimeIndication: [None] (One of: QuantitativeValue, QuantitativeValueRange)
weight: [None] (One of: QuantitativeValue, QuantitativeValueRange)
Required Properties: ageCategory
```

```matlab
subject1.studiedState(end+1) = subjectStatePost;
disp(subject1)
```

```TextOutput
Subject (https://openminds.ebrains.eu/core/Subject) with properties:
biologicalSex: male (BiologicalSex)
internalIdentifier: ""
isPartOf: [None] (SubjectGroup)
lookupLabel: "demo_subject1"
species: Mus musculus (One of: Species, Strain)
studiedState: [demo_subjectstate_pre_recording demo_subjectstate_post_recording] (SubjectState)
Required Properties: species, studiedState
```

0 comments on commit 6baa121

Please sign in to comment.