Overview
TheTADPOLE_TEMPORAL.csv file is the primary label and temporal information source for STGNN training. It contains subject labels, visit information, and temporal features for each scan in the dataset.
This file is typically generated by
setup_temporal_data.py from the original TADPOLE data files, but can also be created manually following this specification.File Location
FC_ADNIDataset.py:10 and README line 18:
- Default filename:
TADPOLE_TEMPORAL.csv - Location: Root data directory (same level as
FC_Matrices/) - Format: CSV with header row
Required Columns
FromFC_ADNIDataset.py:123-158 and setup_temporal_data.py:105-120:
Subject
- Type: string
- Description: Unique subject identifier
- Format: No underscores (e.g.,
123456, not123_456) - Example:
002S0295,123456
Visit
- Type: string
- Description: Visit code/identifier
- Format: Free text (typically ADNI visit codes)
- Examples:
bl(baseline),m06(6-month),m12(12-month),m24(24-month)
visit_code.
Label_CS_Num
- Type: integer
- Description: Cognitive stage label (classification target)
- Values:
0: Stable (no cognitive decline)1: Converter (progressed to worse cognitive stage)
- Usage: Binary classification label for the subject
FC_ADNIDataset.py:41:
Labels are assigned at the subject level. All visits from the same subject receive the same label, determined by the subject’s final cognitive stage (last chronological visit).
Visit_Order
- Type: integer
- Description: Chronological visit number for this subject
- Values: 1, 2, 3, … (1-indexed)
- Example: For a subject with 3 visits, values are 1, 2, 3
setup_temporal_data.py:112:
Months_From_Baseline
- Type: float
- Description: Time elapsed (in months) from subject’s first visit
- Values: ≥ 0.0 (baseline visit is 0.0)
- Precision: Rounded to 1 decimal place
- Examples:
0.0,6.2,12.5,24.8
setup_temporal_data.py:29-37:
Months_To_Next_Original
- Type: float
- Description: Time gap (in months) until subject’s next visit
- Values:
- Positive float for non-final visits
-1orNaNfor final visit (no subsequent visit)
- Examples:
6.2,12.3,-1(last visit)
FC_ADNIDataset.py:49 and setup_temporal_data.py:110:
Optional Columns
Acq_Date
- Type: string
- Description: Scan acquisition date
- Format: Various date formats (MM/DD/YYYY, YYYY-MM-DD, etc.)
- Example:
03/15/2018,2018-03-15
Total_Visits
- Type: integer
- Description: Total number of visits for this subject
- Example: For a subject with 3 scans: all rows have
Total_Visits=3
setup_temporal_data.py:113:
Age
- Type: float
- Description: Subject age at this visit
- Units: Years
- Example:
72.5,68.2
setup_temporal_data.py:117-119:
Sex
- Type: string
- Description: Subject biological sex
- Values:
M(Male),F(Female)
Group
- Type: string
- Description: Diagnostic group at this visit
- Values:
CN(Cognitively Normal),MCI(Mild Cognitive Impairment),AD(Alzheimer’s Disease) - Example: A converter might progress from
CN→MCI→ADacross visits
Example CSV
Row Structure
One Row Per Visit
Each row represents one visit for one subject:Subject-Level vs Visit-Level Data
| Field | Level | Varies Across Visits? |
|---|---|---|
Subject | Subject | No (same for all visits) |
Label_CS_Num | Subject | No (determined by final visit) |
Sex | Subject | No |
Visit | Visit | Yes |
Visit_Order | Visit | Yes |
Months_From_Baseline | Visit | Yes |
Months_To_Next_Original | Visit | Yes |
Age | Visit | Yes |
Group | Visit | Yes (can change) |
Mapping to FC Matrices
Subject ID Matching
FromFC_ADNIDataset.py:94-108:
- Extract subject ID from filename (remove
sub-prefix) - Extract run number from filename
- Format as
{subject}_run{run_num}(e.g.,002S0295_run01) - Map to CSV row where
Subject = '002S0295'andVisit_Order = 1
Run Number to Visit Order
FromFC_ADNIDataset.py:144-152:
Run numbers in FC filenames must match the chronological order of visits in the CSV (sorted by
Visit_Order).Label Assignment Logic
FromFC_ADNIDataset.py:130-135:
- Group rows by subject
- Sort by
Visit_Orderto find chronological sequence - Take
Label_CS_Numfrom the last visit (highestVisit_Order) - Apply this label to all visits for the subject
Data Validation
Required Validation Checks
Validation Script
Common Issues
Column name mismatch
Column name mismatch
Issue:
KeyError: 'Months_To_Next_Original'Cause: CSV has Months_To_Next instead of Months_To_Next_OriginalSolution:Subject ID underscores
Subject ID underscores
Issue: Subject IDs contain underscoresSolution: Remove underscores:
Non-consecutive Visit_Order
Non-consecutive Visit_Order
Issue: Visit_Order values like 1, 3, 5 (missing 2, 4)Solution: Re-number consecutively:
Missing labels for some subjects
Missing labels for some subjects
Issue: Some subjects in FC_Matrices/ not found in CSVSolution: Ensure all subjects with FC matrices have corresponding CSV entries. Check subject ID formatting (remove
sub- prefix and underscores).Integration with Training
TheTADPOLE_TEMPORAL.csv file is loaded during dataset initialization:
After validation and preparation, the CSV is ready for use with the STGNN training pipeline.