> For the complete documentation index, see [llms.txt](https://docs.ccv.brown.edu/bnc-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ccv.brown.edu/bnc-user-manual/standalone-tools/voxalign-automated-mr-spectroscopy-voxel-placement/multi-session-alignment.md).

# Multi-session alignment

## Prepare in advance

You can organize your data however you like, but it is helpful to collect the session 1 DICOMs in advance of the scan session and make sure that they are named and organized in a way that will make running voxalign quick and simple. For example, I like to make a new folder for each participant, with sess1 and sess2 subdirectories. You can put the T1 and spectroscopy DICOMs in the sess1 directory in advance, and the sess2 directory you'll copy the T1 DICOM into as soon as it is collected.

<figure><img src="/files/h6UXxqcQb7SrEbfYMbLv" alt="Two directories shown in the file explorer: “sess1” and “sess2”. Inside “sess1” are 4 dicom files (one for each of the 3 spectroscopy scans, and the T1 anatomical scan). “sess2&#x22; is empty." width="281"><figcaption><p>A simple and clear way to organize your DICOMs</p></figcaption></figure>

## Running voxalign

1. Activate the virtual environment with `source /path/to/env/voxalign/bin/activate` (on Tess, this will be `source ~/Desktop/voxalign/bin/activate`. You can tell that the environment is activated when it says `(voxalign)` before the command prompt.
2. Start voxalign by typing `run-voxalign`.
3. Use the voxalign file selector to select your T1 and spectroscopy DICOMs. You can get everything but the session 2 T1 loaded in advance.
4. Specify an output directory. I usually just create a folder called "output" in the participant's directory.
5. Once the session 2 T1 has been collected, [export it to scannershare](/bnc-user-manual/mrf-guides/exporting-data-via-scannershare.md) and copy it to your participant/sess2 folder on Tess. Then select it in the voxalign GUI.

<figure><img src="/files/OMwC0o0srAOc01CuyURc" alt="The VoxAlign GUI. The “Select Session 1 T1 DICOM” button allows users to search in their file explorer for the first session’s anatomical scan. Then, they can select one or more spectroscopy dicoms with the button “Add Session 1 Spectroscopy DICOM(s)”. Next, the session 2 anatomical scan, which was just acquired, is selected using the “Select Session 2 T1 DICOM” button. Finally, the path to the output folder is provided, and users can press “Run VoxAlign”."><figcaption></figcaption></figure>

6\. Verify that everything looks correct, then click \*\*Run VoxAlign\*\*

**Your new spectroscopy voxel prescriptions will be printed to the terminal, saved out in a text file, and also automatically opened in a fsleyes window.**

<figure><img src="/files/nYvd5gJPIqolVUeJjLeE" alt="The text printed on the command line after running voxalign. The position, orientation, rotation, and dimensions of both the “Previous” voxel and “Today” voxel are provided. In this example, the text for only one ROI is printed (occipital)." width="563"><figcaption></figcaption></figure>

<figure><img src="/files/ecc4thdo58eic3afDZLH" alt="The FSLeyes image viewer, with these images available to view/toggle: the 3 voxels from session 2 aligned to session 1 (occipital, frontal, and amygdala), the session 2 T1, and the session 1 T1 aligned to session 2."><figcaption><p>You can turn on and off the overlay(s) for the *_aligned voxels to verify that they exactly match the session 1 voxel positions</p></figcaption></figure>

The prescription printed in the text file should be entered exactly on the scan console. For example, this position information in the text file:

{% code fullWidth="false" %}

```
Position: R19.4 A61.0 H21.7
Orientation: C > S10.8 > T-4.0
Rotation: 4.48 deg
Dimensions: 10 mm x 20 mm x 30 mm
```

{% endcode %}

would be entered on the console as:

<div align="left"><figure><img src="/files/GB9iEXVCtxxEcr9wErPl" alt="On the Siemens console, there are text boxes to enter values for: Position, Orientation, Rotation, Vol F >> H, Vol R >> L, and Vol A >> P."><figcaption></figcaption></figure></div>

***

## TIPS

* Your two T1 scans need to have the same resolution for voxalign to work properly (at the moment).
* When you are typing your prescription in on the scanner, if the field says 'R' enter a negative number to switch it to L, and vice versa. This applies to all three directions.
* The tools voxalign uses to convert DICOMs to NIFTIs do not play well with spaces in file paths, so - for example - running voxalign on data stored in a "Google Drive" folder will not work.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.ccv.brown.edu/bnc-user-manual/standalone-tools/voxalign-automated-mr-spectroscopy-voxel-placement/multi-session-alignment.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.
