From 8a57b2acaa86bc67f01c12e309294ae63ee67609 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 16:34:19 +0000 Subject: [PATCH 1/2] Initial plan From 9cce480d1ad6b9f62081c2af0adfe5a88659336b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 16:35:57 +0000 Subject: [PATCH 2/2] Add comprehensive folder creation documentation to README Co-authored-by: KatoPitipat-Teerakitinat <256167484+KatoPitipat-Teerakitinat@users.noreply.github.com> --- README.md | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/README.md b/README.md index f523026..56f61a2 100644 --- a/README.md +++ b/README.md @@ -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-_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