Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,98 @@
# stroke_disconnection
Project repo for stroke disconnection research project

## Setup Instructions

### Creating the Required Folder Structure

This project analyzes structural connectivity data using the Schaefer 400-parcel atlas. Before running the analysis scripts, you need to create the required folder structure and add your data files.

#### 1. Create the Data Folder

Create a folder named `Schaefer2018-12m` in the project root directory:

```bash
mkdir Schaefer2018-12m
```

#### 2. Add Your Data Files

Place your connectivity data files in the `Schaefer2018-12m/` folder. The files should:

- Be in TSV (tab-separated values) format
- Follow the naming convention: `sub-<ID>_Schaefer2018-12m.tsv`
- Example: `sub-K1_Schaefer2018-12m.tsv`, `sub-P001_Schaefer2018-12m.tsv`
- Contain 400x400 connectivity matrices (Schaefer 400-parcel atlas)
- Have ROI names as both row and column headers

#### 3. Expected File Structure

```
stroke_disconnection/
├── Schaefer2018-12m/ # Data folder (you create this)
│ ├── sub-K1_Schaefer2018-12m.tsv
│ ├── sub-P001_Schaefer2018-12m.tsv
│ ├── sub-P002_Schaefer2018-12m.tsv
│ └── ... (additional subject files)
├── 1) Merge_All_Shaeffler.py
├── 2) Indivudual visualization of binarized shaeffler.py
├── 3) Create Group_Sum_Binarized_Schaefer400.py
├── 4) Visualization_Sum_Binarized_AllPatients.py
├── 5) Check_ROI_Regions.py
└── README.md
```

## Usage

Once you have created the `Schaefer2018-12m/` folder and added your data files, run the analysis scripts in order:

1. **Merge All Data**: Compiles all subject data into a single compressed file
```bash
python "1) Merge_All_Shaeffler.py"
```

2. **Visualize Individual Subject**: Creates visualization for a single subject
```bash
python "2) Indivudual visualization of binarized shaeffler.py"
```

3. **Create Group Summary**: Generates binarized group-level connectivity matrix
```bash
python "3) Create Group_Sum_Binarized_Schaefer400.py"
```

4. **Visualize Group Data**: Creates visualization of group-level connectivity
```bash
python "4) Visualization_Sum_Binarized_AllPatients.py"
```

5. **Check ROI Regions**: Utility to check which brain region corresponds to a specific ROI number
```bash
python "5) Check_ROI_Regions.py"
```

## Data Format

Each TSV file should contain a 400x400 matrix where:
- Rows and columns represent the 400 regions from the Schaefer atlas
- Values represent connectivity strength between regions
- The first row contains column headers (ROI names)
- The first column contains row indices (ROI names)

Example TSV structure:
```
ROI1 ROI2 ROI3 ... ROI400
ROI1 0.0 0.5 0.3 ... 0.1
ROI2 0.5 0.0 0.8 ... 0.2
ROI3 0.3 0.8 0.0 ... 0.4
...
ROI400 0.1 0.2 0.4 ... 0.0
```

## Output Files

The scripts will generate the following output files:
- `compiled_data_4953.npz` - Compiled data from all subjects
- `Group_Sum_Binarized_Schaefer400.csv` - Group-level binarized connectivity matrix
- `sub-K1_400x400_Binarized.png` - Individual subject visualization
- `Professional_400x400_Matrix_Binarized.png` - Group-level visualization