# Morphology Description

While morphologies in NEURON could be explicitly defined used sections and connections, RSME assumes that your cell morphology is given as a 'HOC' file.&#x20;

In this example, we will use a traced morphology of a SAC. The morphology file can be downloaded here:

{% file src="/files/-MlOiWnptnlfFIWipXsz" %}
SAC morphology
{% endfile %}

Conversion between morphological data types is provided by NEURON. See the 'Reading a morphometric data file and converting it to a NEURON model' tutorial at:&#x20;

{% embed url="<https://neuron.yale.edu/neuron/docs/import3d>" %}

In RSME morphology specification XML we will need to specify the path to your morphology file. You can further modify your morphology by two means:&#x20;

* Referencing a Python function, which traverses the morphology sections and iteratively adjusting them&#x20;
* Providing an SBML-specified function to correct the sections, e.g., the sections' diameter.&#x20;

In the following XML file, we define one morphology, describe by the SAC morphology file attached above. Each morphology is given an ID, which is later used to define a network and the cell's biophysical characteristics. We refer the model to the morphology\_adhoc\_fix function in which section corrections are defined and specify an SBML-defined function, which we use to set the morphological sections' diameter.&#x20;

```
<morphology xmlns = "RSME.simulation_parameters">

  <morphology_description> TEST </morphology_description>
  
  <morphologies>
    
      <morphology_id id = "0" fix_function = "morphology_adhoc_fix">

        <morphology_hoc_file> SAChocLea.hoc </morphology_hoc_file>

        <section_diameter>
            <math>
                <apply> 
                    <plus/> 
                    <apply>
                        <times/>
                        <cn> 0.2 </cn>
                        <apply> 
                            <ci> exp </ci> 
                            <apply>
                                <divide/>
                                <ci> -x  </ci>
                                <cn> 40 </cn>
                            </apply>
                        </apply>
                    </apply>
                    <cn> 0.15 </cn>
                </apply>
            </math>
        </section_diameter>

      </morphology_id>
      
    </morphologies>
    
</morphology>

```

Note:

* The morphology\_adhoc\_fix function is explicitly defined in SimParameters.py file.
* The section diameter function specifies the diameter of each section as a function of its distance from the soma.&#x20;

In the following example, we define a second cell - a DSGC:

```
<morphology_id id = "1" fix_function = "None">
    <morphology_hoc_file> cell_12_trace.hoc</morphology_hoc_file>
</morphology_id>
```

You can download the DSGC morphology here:

{% file src="/files/58tsfmV9tqoxLbnAow7t" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elishai.gitbook.io/retinal-stimulation-modeling-environment/model-specification/morphology-description.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
