jesse-radiata commited on
Commit
2eccbda
Β·
verified Β·
1 Parent(s): 952afea

Add files using upload-large-folder tool

Browse files
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
IXI/.DS_Store CHANGED
Binary files a/IXI/.DS_Store and b/IXI/.DS_Store differ
 
README.md CHANGED
@@ -1,7 +1,7 @@
1
  # Description
2
  3794 3D structural MRI brain scans (T1-weighted MPRAGE NIfTI files) from 2607 individuals included in five publicly available datasets: [IXI](https://brain-development.org/ixi-dataset/), [DLBS](https://fcon_1000.projects.nitrc.org/indi/retro/dlbs.html), [NKI-RS](https://fcon_1000.projects.nitrc.org/indi/enhanced/sharing_neuro.html), [OASIS-1](https://sites.wustl.edu/oasisbrains/home/oasis-1/), and [OASIS-2](https://sites.wustl.edu/oasisbrains/home/oasis-2/). Subjects have a mean age of 45 Β± 24. 3773 scans come from cognitively normal individuals and 261 scans from individuals with an Alzheimer's disease clinical diagnosis. Scans dimensions are 113x137x113, 1.5mm^3 resolution, aligned to MNI152 space (see methods).
3
 
4
- Scans are processed and no protected health information (PHI) is included - only the skull-stripped scan, integer age, biological sex, and clinical diagnosis. [Radiata](https://radiata.ai/) compiles and processes publicly available neuroimaging datasets to create an open, unified, and harmonized dataset. This can be used for purposes including developing models for brain age prediction and disease classification. For more information see https://radiata.ai/public-studies.
5
 
6
 
7
  # License
@@ -20,23 +20,23 @@ The metadata provide the license for each object.
20
  <table>
21
  <tr>
22
  <td align="center">
23
- <img src="18_F_CN_2966.png" alt="18_F_CN_2966" width="150">
24
- <br>Age 18 F
25
  <br>Cognitively normal
26
  </td>
27
  <td align="center">
28
- <img src="71_M_AD_3585.png" alt="71_M_AD_3585" width="150">
29
- <br>Age 71 M
30
  <br>Alzheimer's disease
31
  </td>
32
  <td align="center">
33
- <img src="46_F_CN_436.png" alt="46_F_CN_436" width="150">
34
- <br>Age 46 F
35
  <br>Cognitively normal
36
  </td>
37
  <td align="center">
38
- <img src="86_M_CN_3765.png" alt="86_M_CN_3765" width="150">
39
- <br>Age 86 M
40
  <br>Cognitively normal
41
  </td>
42
  </tr>
@@ -53,15 +53,15 @@ The metadata provide the license for each object.
53
 
54
  # Folder organization
55
  ```bash
56
- brains-structure/
57
- β”œβ”€ brains-structure.py
58
  β”œβ”€ metadata.csv
59
  β”œβ”€ IXI/
60
  β”‚ β”œβ”€ sub-002/
61
  β”‚ β”‚ └─ ses-01/
62
  β”‚ β”‚ └─ anat/
63
- β”‚ β”‚ β”œβ”€ sub-002_ses-01_T1w_brain_affine_mni.nii.gz
64
- β”‚ β”‚ └─ sub-017_ses-01_scandata.json
65
  β”‚ └─ ...
66
  β”œβ”€ DLBS/
67
  β”‚ └─ ...
@@ -79,9 +79,9 @@ pip install datasets
79
  # load datasets
80
  from datasets import load_dataset
81
 
82
- ds_train = load_dataset("radiata-ai/brains-structure", name="all", split="train", trust_remote_code=True)
83
- ds_val = load_dataset("radiata-ai/brains-structure", name="all", split="validation", trust_remote_code=True)
84
- ds_test = load_dataset("radiata-ai/brains-structure", name="all", split="test", trust_remote_code=True)
85
  ```
86
 
87
  ```
@@ -158,20 +158,27 @@ Citation: OASIS-2: Longitudinal: https://doi.org/10.1162/jocn.2009.21407
158
 
159
  # Methods
160
  ## Image processing
161
- T1-weighted structural MRI scans were processed with [CAT12](https://neuro-jena.github.io/cat12-help/) ([Gaser et al, 2024](https://academic.oup.com/gigascience/article/doi/10.1093/gigascience/giae049/7727520)). Voxel-based processing created tissue probability maps for gray matter/white matter/CSF. Scans were masked to brain-only and subsequently registered to ICBM 2009c Nonlinear Asymmetric space (MNI152NLin2009cAsym 1.5mm^3) using linear affine registration with 12 degrees of freedom in [FSL FLIRT](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/registration/flirt/index). The goal was to linearly align scans to standard space while preserving individual anatomy.
 
 
 
162
 
163
- Metadata includes the total intracranial volume (TIV), image quality rating (IQR), MRI scanner manufacturer/model, and field strength.
 
 
164
 
165
  ## Train/validation/test partitioning
166
- Scans were partitioned into train/validation/test datasets with a 80/10/10 split. Splits were balanced for age, sex, clinical diagnosis, and study. Subjects with multiple scans only appear in one split.
167
 
168
 
169
  # Citation
170
- @dataset{Radiata-Brains-structure,
 
171
  author = {Jesse Brown and Clayton Young},
172
- title = {Brains-Structure: A Collection of Processed Structural MRI Scans},
173
  year = {2025},
174
- url = { https://huggingface.co/datasets/radiata-ai/brains-structure },
175
  note = {Version 1.0},
176
  publisher = { Hugging Face }
177
- }
 
 
1
  # Description
2
  3794 3D structural MRI brain scans (T1-weighted MPRAGE NIfTI files) from 2607 individuals included in five publicly available datasets: [IXI](https://brain-development.org/ixi-dataset/), [DLBS](https://fcon_1000.projects.nitrc.org/indi/retro/dlbs.html), [NKI-RS](https://fcon_1000.projects.nitrc.org/indi/enhanced/sharing_neuro.html), [OASIS-1](https://sites.wustl.edu/oasisbrains/home/oasis-1/), and [OASIS-2](https://sites.wustl.edu/oasisbrains/home/oasis-2/). Subjects have a mean age of 45 Β± 24. 3773 scans come from cognitively normal individuals and 261 scans from individuals with an Alzheimer's disease clinical diagnosis. Scans dimensions are 113x137x113, 1.5mm^3 resolution, aligned to MNI152 space (see methods).
3
 
4
+ Scans are processed and no protected health information (PHI) is included - only the skull-stripped scan, integer age, biological sex, and clinical diagnosis. [Radiata](https://radiata.ai/) compiles and processes publicly available neuroimaging datasets to create this open, unified, and harmonized dataset. For more information see https://radiata.ai/public-studies. Example uses including developing foundation-like models or tailored models for brain age prediction and disease classification.
5
 
6
 
7
  # License
 
20
  <table>
21
  <tr>
22
  <td align="center">
23
+ <img src="sample_images/18_F_CN_2966.png" alt="18_F_CN_2966" width="150">
24
+ <br>Age 18 F, NKI-RS
25
  <br>Cognitively normal
26
  </td>
27
  <td align="center">
28
+ <img src="sample_images/71_M_AD_3585.png" alt="71_M_AD_3585" width="150">
29
+ <br>Age 71 M, OASIS-1
30
  <br>Alzheimer's disease
31
  </td>
32
  <td align="center">
33
+ <img src="sample_images/46_F_CN_436.png" alt="46_F_CN_436" width="150">
34
+ <br>Age 46 F, IXI
35
  <br>Cognitively normal
36
  </td>
37
  <td align="center">
38
+ <img src="sample_images/86_M_CN_3765.png" alt="86_M_CN_3765" width="150">
39
+ <br>Age 86 M, OASIS-2
40
  <br>Cognitively normal
41
  </td>
42
  </tr>
 
53
 
54
  # Folder organization
55
  ```bash
56
+ brain-structure/
57
+ β”œβ”€ brain-structure.py
58
  β”œβ”€ metadata.csv
59
  β”œβ”€ IXI/
60
  β”‚ β”œβ”€ sub-002/
61
  β”‚ β”‚ └─ ses-01/
62
  β”‚ β”‚ └─ anat/
63
+ β”‚ β”‚ β”œβ”€ msub-002_ses-01_T1w_brain_affine_mni.nii.gz
64
+ β”‚ β”‚ └─ msub-002_ses-01_scandata.json
65
  β”‚ └─ ...
66
  β”œβ”€ DLBS/
67
  β”‚ └─ ...
 
79
  # load datasets
80
  from datasets import load_dataset
81
 
82
+ ds_train = load_dataset("radiata-ai/brain-structure", name="all", split="train", trust_remote_code=True)
83
+ ds_val = load_dataset("radiata-ai/brain-structure", name="all", split="validation", trust_remote_code=True)
84
+ ds_test = load_dataset("radiata-ai/brain-structure", name="all", split="test", trust_remote_code=True)
85
  ```
86
 
87
  ```
 
158
 
159
  # Methods
160
  ## Image processing
161
+ T1-weighted structural MRI scans were processed with [CAT12](https://neuro-jena.github.io/cat12-help/) ([Gaser et al, 2024](https://academic.oup.com/gigascience/article/doi/10.1093/gigascience/giae049/7727520)). The image processing steps were:
162
+ - correct for bias, noise and intensity
163
+ - mask to brain-only (gray matter + white matter + CSF)
164
+ - register to ICBM 2009c Nonlinear Asymmetric space (MNI152NLin2009cAsym 1.5mm^3) using linear affine registration with 12 degrees of freedom in [FSL FLIRT](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/registration/flirt/index) ('flirt -in t1.nii.gz -ref mni_icbm152_t1_tal_nlin_asym_09c_brain_1_5_mm.nii.gz -dof 12 -noresampblur').
165
 
166
+ The goal was to get denoised, unsmoothed scans that were maximally aligned to standard space while preserving individual anatomy.
167
+
168
+ Metadata includes the total intracranial volume (TIV), image quality rating (IQR; larger value = worse quality), MRI scanner manufacturer/model, and field strength.
169
 
170
  ## Train/validation/test partitioning
171
+ Scans were partitioned into train/validation/test datasets with a 80%/10%/10% split. Splits were balanced for age, sex, clinical diagnosis, and study. Subjects with multiple scans only appear in one split.
172
 
173
 
174
  # Citation
175
+ ```
176
+ @dataset{Radiata-Brain-Structure,
177
  author = {Jesse Brown and Clayton Young},
178
+ title = {Brain-Structure: A Collection of Processed Structural MRI Scans},
179
  year = {2025},
180
+ url = { https://huggingface.co/datasets/radiata-ai/brain-structure },
181
  note = {Version 1.0},
182
  publisher = { Hugging Face }
183
+ }
184
+ ```
brain-structure.py ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import datasets
4
+ import logging
5
+
6
+ logger = logging.getLogger(__name__)
7
+
8
+ _DESCRIPTION = """
9
+ This dataset contains T1-weighted .nii.gz structural MRI scans in a BIDS-like arrangement.
10
+ Each scan has an associated JSON sidecar with metadata, including fields such as subject
11
+ demographics, scanner information, and a 'split' field indicating train/validation/test.
12
+ """
13
+
14
+ _CITATION = """
15
+ @dataset{Radiata-Brain-Structure,
16
+ author = {Jesse Brown and Clayton Young},
17
+ title = {Brain-Structure: A Collection of Processed Structural MRI Scans},
18
+ year = {2025},
19
+ url = {https://huggingface.co/datasets/radiata-ai/brain-structure},
20
+ note = {Version 1.0},
21
+ publisher = {Hugging Face}
22
+ }
23
+ """
24
+
25
+ _HOMEPAGE = "https://huggingface.co/datasets/radiata-ai/brain-structure"
26
+ _LICENSE = "ODC-By v1.0"
27
+
28
+ class BrainStructureConfig(datasets.BuilderConfig):
29
+ """
30
+ Configuration class for the Brain-Structure dataset.
31
+ You can define multiple configurations if needed (e.g. different subsets).
32
+ """
33
+ def __init__(self, **kwargs):
34
+ super().__init__(**kwargs)
35
+
36
+ class BrainStructure(datasets.GeneratorBasedBuilder):
37
+ """
38
+ A dataset loader for T1 .nii.gz files plus JSON sidecars.
39
+ Each sidecar includes a 'split' field identifying whether the scan
40
+ belongs to the train, validation, or test set.
41
+
42
+ Usage Example:
43
+ ds = load_dataset(
44
+ "radiata-ai/brain-structure",
45
+ name="all",
46
+ split="train",
47
+ trust_remote_code=True
48
+ )
49
+ """
50
+
51
+ VERSION = datasets.Version("1.0.0")
52
+ BUILDER_CONFIGS = [
53
+ BrainStructureConfig(
54
+ name="all",
55
+ version=VERSION,
56
+ description=(
57
+ "All structural MRI data in a BIDS-like arrangement, labeled "
58
+ "with train/validation/test splits."
59
+ ),
60
+ ),
61
+ ]
62
+ DEFAULT_CONFIG_NAME = "all"
63
+
64
+ def _info(self):
65
+ """
66
+ Provides metadata about the dataset, including feature types
67
+ and general dataset information.
68
+ """
69
+ return datasets.DatasetInfo(
70
+ description=_DESCRIPTION,
71
+ features=datasets.Features(
72
+ {
73
+ "id": datasets.Value("string"),
74
+ "nii_filepath": datasets.Value("string"),
75
+ "metadata": {
76
+ "split": datasets.Value("string"),
77
+ "participant_id": datasets.Value("string"),
78
+ "session_id": datasets.Value("string"),
79
+ "study": datasets.Value("string"),
80
+
81
+ # Additional fields from the JSON sidecar
82
+ "age": datasets.Value("int32"),
83
+ "sex": datasets.Value("string"),
84
+ "clinical_diagnosis": datasets.Value("string"),
85
+ "scanner_manufacturer": datasets.Value("string"),
86
+ "scanner_model": datasets.Value("string"),
87
+ "field_strength": datasets.Value("string"),
88
+ "image_quality_rating": datasets.Value("float"),
89
+ "total_intracranial_volume": datasets.Value("float"),
90
+ "license": datasets.Value("string"),
91
+ "website": datasets.Value("string"),
92
+ "citation": datasets.Value("string"),
93
+ "t1_file_name": datasets.Value("string"),
94
+ "radiata_id": datasets.Value("int32"),
95
+ },
96
+ }
97
+ ),
98
+ homepage=_HOMEPAGE,
99
+ license=_LICENSE,
100
+ citation=_CITATION,
101
+ )
102
+
103
+ def _split_generators(self, dl_manager: datasets.DownloadManager):
104
+ """
105
+ Returns SplitGenerators for 'train', 'validation', and 'test'.
106
+ Each split is identified by matching the 'split' field in the JSON sidecar.
107
+ """
108
+ data_dir = dl_manager.dataset_dir
109
+
110
+ return [
111
+ datasets.SplitGenerator(
112
+ name=datasets.Split.TRAIN,
113
+ gen_kwargs={"data_dir": data_dir, "desired_split": "train"},
114
+ ),
115
+ datasets.SplitGenerator(
116
+ name=datasets.Split.VALIDATION,
117
+ gen_kwargs={"data_dir": data_dir, "desired_split": "validation"},
118
+ ),
119
+ datasets.SplitGenerator(
120
+ name=datasets.Split.TEST,
121
+ gen_kwargs={"data_dir": data_dir, "desired_split": "test"},
122
+ ),
123
+ ]
124
+
125
+ def _generate_examples(self, data_dir, desired_split):
126
+ """
127
+ Recursively scan the data_dir, locate JSON sidecar files, and yield
128
+ examples whose 'split' field matches desired_split.
129
+
130
+ Each yielded example includes:
131
+ - 'nii_filepath': pointing to the corresponding .nii.gz file
132
+ - 'metadata': dictionary of subject and scan information
133
+ """
134
+ id_ = 0
135
+ for root, dirs, files in os.walk(data_dir):
136
+ for fname in files:
137
+ if fname.endswith("_scandata.json"):
138
+ sidecar_path = os.path.join(root, fname)
139
+ with open(sidecar_path, "r") as f:
140
+ sidecar = json.load(f)
141
+
142
+ # Only yield if 'split' matches the desired split
143
+ if sidecar.get("split") == desired_split:
144
+ # Attempt to locate the matching .nii.gz file
145
+ # Typically the sidecar is named sub-xxx_ses-xxx_scandata.json
146
+ # and the NIfTI file: sub-xxx_ses-xxx_T1w.nii.gz
147
+ possible_nii_prefix = fname.replace("_scandata.json", "_T1w")
148
+ nii_filepath = None
149
+ for potential_file in files:
150
+ if (potential_file.startswith(possible_nii_prefix)
151
+ and potential_file.endswith(".nii.gz")):
152
+ nii_filepath = os.path.join(root, potential_file)
153
+ break
154
+
155
+ if not nii_filepath:
156
+ logger.warning(
157
+ f"No corresponding .nii.gz file found for {sidecar_path}"
158
+ )
159
+ continue
160
+
161
+ # Build the example
162
+ yield id_, {
163
+ "id": str(id_),
164
+ "nii_filepath": nii_filepath,
165
+ "metadata": {
166
+ "split": sidecar.get("split", ""),
167
+ "participant_id": sidecar.get("participant_id", ""),
168
+ "session_id": sidecar.get("session_id", ""),
169
+ "study": sidecar.get("study", ""),
170
+ "age": sidecar.get("age", 0), # default to 0 if missing
171
+ "sex": sidecar.get("sex", ""),
172
+ "clinical_diagnosis": sidecar.get("clinical_diagnosis", ""),
173
+ "scanner_manufacturer": sidecar.get("scanner_manufacturer", ""),
174
+ "scanner_model": sidecar.get("scanner_model", ""),
175
+ "field_strength": sidecar.get("field_strength", ""),
176
+ "image_quality_rating": float(sidecar.get("image_quality_rating", 0.0)),
177
+ "total_intracranial_volume": float(sidecar.get("total_intracranial_volume", 0.0)),
178
+ "license": sidecar.get("license", ""),
179
+ "website": sidecar.get("website", ""),
180
+ "citation": sidecar.get("citation", ""),
181
+ "t1_file_name": sidecar.get("t1_file_name", ""),
182
+ "radiata_id": sidecar.get("radiata_id", 0),
183
+ },
184
+ }
185
+ id_ += 1
sample_images/.DS_Store ADDED
Binary file (6.15 kB). View file
 
sample_images/18_F_CN_2966.png ADDED

Git LFS Details

  • SHA256: 1156a47b3028102147c5b46fd0a6ca3aa4f02145d1b2a953e9c375dbdd0a9661
  • Pointer size: 130 Bytes
  • Size of remote file: 49.8 kB
sample_images/46_F_CN_436.png ADDED

Git LFS Details

  • SHA256: 51052eb69494efd918953b4560b6d2b4a957e5914bde7141b5bc01f42e37558d
  • Pointer size: 130 Bytes
  • Size of remote file: 86.8 kB
sample_images/71_M_AD_3585.png ADDED

Git LFS Details

  • SHA256: 464c14404884d3064dfb3237b1a58a5f1da956e58cf602c6fe8cc1faf8ccdded
  • Pointer size: 130 Bytes
  • Size of remote file: 48.5 kB
sample_images/86_M_CN_3765.png ADDED

Git LFS Details

  • SHA256: ce9bf1671078abe7dc6a1249b0b6a9bf4f8b049745d6711136ae79cb4a7ba428
  • Pointer size: 130 Bytes
  • Size of remote file: 83.1 kB