diff --git a/NeuroGraph/datasets.py b/NeuroGraph/datasets.py index 7b1a11c..ab2a882 100644 --- a/NeuroGraph/datasets.py +++ b/NeuroGraph/datasets.py @@ -4,19 +4,19 @@ from typing import Callable, List, Optional import torch -import zipfile + from torch_geometric.data import ( Data, InMemoryDataset, download_url, - extract_zip, + extract_zip ) -class NeuroGraphStatic(InMemoryDataset): +class NeuroGraphDataset(InMemoryDataset): r"""The NeuroGraph benchmark datasets from the `"NeuroGraph: Benchmarks for Graph Machine Learning in Brain Connectomics" `_ paper. - :class:`NeuroGraphStatic` holds a collection of five neuroimaging graph + :class:`NeuroGraphDataset` holds a collection of five neuroimaging graph learning datasets that span multiple categories of demographics, mental states, and cognitive traits. See the `documentation @@ -26,22 +26,22 @@ class NeuroGraphStatic(InMemoryDataset): +--------------------+---------+----------------------+ | Dataset | #Graphs | Task | +====================+=========+======================+ - | :obj:`HCP-State` | 7,443 | Graph Classification | + | :obj:`HCPActivity` | 7,443 | Graph Classification | +--------------------+---------+----------------------+ - | :obj:`HCP-Gender` | 1,078 | Graph Classification | + | :obj:`HCPGender` | 1,078 | Graph Classification | +--------------------+---------+----------------------+ - | :obj:`HCP-Age` | 1,065 | Graph Classification | + | :obj:`HCPAge` | 1,065 | Graph Classification | +--------------------+---------+----------------------+ - | :obj:`HCP-FI` | 1,071 | Graph Regression | + | :obj:`HCPFI` | 1,071 | Graph Regression | +--------------------+---------+----------------------+ - | :obj:`HCP-WM` | 1,078 | Graph Regression | + | :obj:`HCPWM` | 1,078 | Graph Regression | +--------------------+---------+----------------------+ Args: root (str): Root directory where the dataset should be saved. name (str): The name of the dataset (one of :obj:`"HCPGender"`, - :obj:`"HCP-State"`, :obj:`"HCP-Age"`, :obj:`"HCP-FI"`, - :obj:`"HCP-WM"`). + :obj:`"HCPActivity"`, :obj:`"HCPAge"`, :obj:`"HCPFI"`, + :obj:`"HCPWM"`). transform (callable, optional): A function/transform that takes in an :obj:`torch_geometric.data.Data` object and returns a transformed version. The data object will be transformed before every access. @@ -57,11 +57,11 @@ class NeuroGraphStatic(InMemoryDataset): """ url = 'https://vanderbilt.box.com/shared/static' filenames = { - 'HCP-Gender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip', - 'HCP-State': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip', - 'HCP-Age': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip', - 'HCP-WM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip', - 'HCP-FI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip', + 'HCPGender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip', + 'HCPActivity': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip', + 'HCPAge': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip', + 'HCPWM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip', + 'HCPFI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip', } def __init__( @@ -76,7 +76,7 @@ def __init__( self.name = name super().__init__(root, transform, pre_transform, pre_filter) - self.load(self.processed_paths[0]) + self.data, self.slices = torch.load(self.processed_paths[0]) @property def raw_dir(self) -> str: @@ -124,8 +124,8 @@ def process(self): sample = self.pre_transform(sample) data_list.append(sample) - - self.save(data_list, self.processed_paths[0]) + data, slices = self.collate(data_list) + torch.save((data,slices), self.processed_paths[0]) class NeuroGraphDynamic(): r"""Graph-based neuroimaging benchmark datasets, e.g., @@ -139,31 +139,56 @@ class NeuroGraphDynamic(): Returns: list: A list of graphs in PyTorch Geometric (pyg) format. Each graph contains a list of dynamic graphs batched in pyg batch. """ + url = 'https://vanderbilt.box.com/shared/static' + filenames = { + 'DynHCPGender': 'mj0z6unea34lfz1hkdwsinj7g22yohxn.zip', + 'DynHCPActivity': '2so3fnfqakeu6hktz322o3nm2c8ocus7.zip', + 'DynHCPAge': '195f9teg4t4apn6kl6hbc4ib4g9addtq.zip', + 'DynHCPWM': 'mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip', + 'DynHCPFI': 'un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip', + } def __init__(self,root, name): self.root = root self.name = name - self.urls = {"DynHCP-Gender":'https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip', - "DynHCP-State":'https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip', - "DynHCP-Age":'https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip', - "DynHCP-WM":'https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip', - "DynHCP-FI":'https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip' - } - if self.urls.get(name): - self.download(self.urls.get(name)) - else: - print('dataset not found! The name of the datasets are: "DynHCPGender","DynHCPActivity","DynHCPAge","DynHCPWM","DynHCPFI"') + + + # self.urls = {"DynHCP-Gender":'https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip', + # "DynHCP-State":'https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip', + # "DynHCP-Age":'https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip', + # "DynHCP-WM":'https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip', + # "DynHCP-FI":'https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip' + # } + assert name in self.filenames.keys() + self.name = name + file_path = os.path.join(self.root,self.name,'processed', self.name+".pt") + if not os.path.exists(file_path): + self.download() + # else: + # print('dataset not found! The name of the datasets are: "DynHCP-Gender","DynHCP-Activity","DynHCP-Age","DynHCP-WM","DynHCP-FI"') self.dataset, self.labels = self.load_data() - def download(self,url): - - download_url(url, os.path.join(self.root, self.name)) - basename = os.path.basename(url) - with zipfile.ZipFile(os.path.join(self.root,self.name,basename), 'r') as file: - file.extractall(os.path.join(self.root,self.name,os.path.dirname(basename))) + # def download(self,url): + # download_url(url, os.path.join(self.root, self.name)) + # basename = os.path.basename(url) + # with zipfile.ZipFile(os.path.join(self.root,self.name,basename), 'r') as file: + # file.extractall(os.path.join(self.root,self.name,os.path.dirname(basename))) # self.remove(os.path.join(self.raw_dir,basename)) + + + def download(self): + url = f'{self.url}/{self.filenames[self.name]}' + path = download_url(url, os.path.join(self.root, self.name)) + extract_zip(path, self.root) + os.unlink(path) + # os.rename( + # osp.join(self.raw_dir, self.name, 'processed', f'{self.name}.pt'), + # osp.join(self.raw_dir, 'data.pt')) + # shutil.rmtree(osp.join(self.raw_dir, self.name)) + + def load_data(self): - if self.name=='DynHCP-State': - dataset_raw = torch.load(os.path.join(self.root,self.name,self.name,"processed", self.name+".pt")) + if self.name=='DynHCPActivity': + dataset_raw = torch.load(os.path.join(self.root,self.name,'processed', self.name+".pt")) dataset,labels = [],[] for v in dataset_raw: batches = v.get('batches') @@ -173,7 +198,7 @@ def load_data(self): dataset.append(b) labels.append(y) else: - dataset = torch.load(os.path.join(self.root,self.name,self.name,"processed", self.name+".pt")) + dataset = torch.load(os.path.join(self.root,self.name,'processed', self.name+".pt")) labels = dataset['labels'] dataset = dataset['batches'] return dataset,labels diff --git a/doc/_build/doctrees/NeuroGraph.doctree b/doc/_build/doctrees/NeuroGraph.doctree index 774ab89..c0319ed 100644 Binary files a/doc/_build/doctrees/NeuroGraph.doctree and b/doc/_build/doctrees/NeuroGraph.doctree differ diff --git a/doc/_build/doctrees/datasets.doctree b/doc/_build/doctrees/datasets.doctree index 346f916..594b659 100644 Binary files a/doc/_build/doctrees/datasets.doctree and b/doc/_build/doctrees/datasets.doctree differ diff --git a/doc/_build/doctrees/environment.pickle b/doc/_build/doctrees/environment.pickle index a8a2bc2..e1d77ee 100644 Binary files a/doc/_build/doctrees/environment.pickle and b/doc/_build/doctrees/environment.pickle differ diff --git a/doc/_build/doctrees/get_started.doctree b/doc/_build/doctrees/get_started.doctree index 40e7ce2..f8c8d98 100644 Binary files a/doc/_build/doctrees/get_started.doctree and b/doc/_build/doctrees/get_started.doctree differ diff --git a/doc/_build/doctrees/index.doctree b/doc/_build/doctrees/index.doctree index 5be7d31..e4c071a 100644 Binary files a/doc/_build/doctrees/index.doctree and b/doc/_build/doctrees/index.doctree differ diff --git a/doc/_build/doctrees/install.doctree b/doc/_build/doctrees/install.doctree index 27f0714..6c8257c 100644 Binary files a/doc/_build/doctrees/install.doctree and b/doc/_build/doctrees/install.doctree differ diff --git a/doc/_build/doctrees/preprocess.doctree b/doc/_build/doctrees/preprocess.doctree index 6827104..d28d5ac 100644 Binary files a/doc/_build/doctrees/preprocess.doctree and b/doc/_build/doctrees/preprocess.doctree differ diff --git a/doc/_build/doctrees/utils.doctree b/doc/_build/doctrees/utils.doctree index 25e61d6..5897027 100644 Binary files a/doc/_build/doctrees/utils.doctree and b/doc/_build/doctrees/utils.doctree differ diff --git a/doc/_build/html/.buildinfo b/doc/_build/html/.buildinfo index 60b1a97..3ae3d86 100644 --- a/doc/_build/html/.buildinfo +++ b/doc/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 7313becfcf9696e10c17e4e0753ff7df +config: c0e52ab7b160affdaa25d3a6a797e2b5 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/_build/html/NeuroGraph.html b/doc/_build/html/NeuroGraph.html index 4481a4d..d8376e8 100644 --- a/doc/_build/html/NeuroGraph.html +++ b/doc/_build/html/NeuroGraph.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -97,16 +95,16 @@

NeuroGraph is a collection of graph-based neuroimaging datasets that span multiple categories of demographics, mental states and cognitive traits. The following provides an overview of these categories and their associated datasets.

-

Demographics

+

Demographics

Demographics category includes gender and age estimation. The gender attribute facilitates a binary classification with the categories being male and female. Age is categorized into three distinct groups as in: 22-25, 26-30, and 31-35 years. We introduce four datasets named: HCP-Gender, HCP-Age, DynHCP-Gender, and DynHCP-Age under this category. The first two are static graph datasets while the last two are the corresponding dynamic graph datasets.

-

Mental States

+

Mental States

The mental state decoding involves seven tasks: Emotion Processing, Gambling, Language, Motor, Relational Processing, Social Cognition, and Working Memory. Each task is designed to help delineate a core set of functions relevant to different facets of the relation between human brain, cognition and behavior. Under this category, we present two datasets: HCP-Activity, a static representation, and DynHCP-Activity, its dynamic counterpart.

-

Cognitive Traits

+

Cognitive Traits

The cognitive traits category of our dataset comprises two significant traits: working memory (List Sorting) and fluid intelligence evaluation with PMAT24. Working memory refers to an individual’s capacity to temporarily hold and manipulate information, a crucial aspect that influences higher cognitive functions such as reasoning, comprehension, and learning. Fluid intelligence represents the ability to solve novel problems, independent of any knowledge from the past. It demonstrates the capacity to analyze complex relationships, identify patterns, and derive solutions in dynamic situations. The prediction of both these traits, quantified as continuous variables in our dataset, are treated as regression problem. We aim to predict the performance or scores related to these cognitive traits based on the functional connectome graphs. We generate four datasets under cognitive traits: HCP Fluid Intelligence (HCP-FI), HCP Working Memory (HCP-WM), DynHCP-FI and DynHCP-WM.

diff --git a/doc/_build/html/_modules/NeuroGraph/datasets.html b/doc/_build/html/_modules/NeuroGraph/datasets.html index ae3bae7..0f7d15c 100644 --- a/doc/_build/html/_modules/NeuroGraph/datasets.html +++ b/doc/_build/html/_modules/NeuroGraph/datasets.html @@ -10,11 +10,9 @@ - - - - - + + + @@ -99,19 +97,21 @@

Source code for NeuroGraph.datasets

 from typing import Callable, List, Optional
 
 import torch
-import zipfile
+
 from torch_geometric.data import (
     Data,
     InMemoryDataset,
     download_url,
-    extract_zip,
+    extract_zip
 )
 
-
[docs]class NeuroGraphStatic(InMemoryDataset): +
+[docs] +class NeuroGraphDataset(InMemoryDataset): r"""The NeuroGraph benchmark datasets from the `"NeuroGraph: Benchmarks for Graph Machine Learning in Brain Connectomics" <https://arxiv.org/abs/2306.06202>`_ paper. - :class:`NeuroGraphStatic` holds a collection of five neuroimaging graph + :class:`NeuroGraphDataset` holds a collection of five neuroimaging graph learning datasets that span multiple categories of demographics, mental states, and cognitive traits. See the `documentation @@ -121,22 +121,22 @@

Source code for NeuroGraph.datasets

     +--------------------+---------+----------------------+
     | Dataset            | #Graphs | Task                 |
     +====================+=========+======================+
-    | :obj:`HCP-State` | 7,443   | Graph Classification |
+    | :obj:`HCPActivity` | 7,443   | Graph Classification |
     +--------------------+---------+----------------------+
-    | :obj:`HCP-Gender`   | 1,078   | Graph Classification |
+    | :obj:`HCPGender`   | 1,078   | Graph Classification |
     +--------------------+---------+----------------------+
-    | :obj:`HCP-Age`      | 1,065   | Graph Classification |
+    | :obj:`HCPAge`      | 1,065   | Graph Classification |
     +--------------------+---------+----------------------+
-    | :obj:`HCP-FI`       | 1,071   | Graph Regression     |
+    | :obj:`HCPFI`       | 1,071   | Graph Regression     |
     +--------------------+---------+----------------------+
-    | :obj:`HCP-WM`       | 1,078   | Graph Regression     |
+    | :obj:`HCPWM`       | 1,078   | Graph Regression     |
     +--------------------+---------+----------------------+
 
     Args:
         root (str): Root directory where the dataset should be saved.
         name (str): The name of the dataset (one of :obj:`"HCPGender"`,
-            :obj:`"HCP-State"`, :obj:`"HCP-Age"`, :obj:`"HCP-FI"`,
-            :obj:`"HCP-WM"`).
+            :obj:`"HCPActivity"`, :obj:`"HCPAge"`, :obj:`"HCPFI"`,
+            :obj:`"HCPWM"`).
         transform (callable, optional): A function/transform that takes in an
             :obj:`torch_geometric.data.Data` object and returns a transformed
             version. The data object will be transformed before every access.
@@ -152,11 +152,11 @@ 

Source code for NeuroGraph.datasets

     """
     url = 'https://vanderbilt.box.com/shared/static'
     filenames = {
-        'HCP-Gender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip',
-        'HCP-State': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip',
-        'HCP-Age': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip',
-        'HCP-WM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip',
-        'HCP-FI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip',
+        'HCPGender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip',
+        'HCPActivity': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip',
+        'HCPAge': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip',
+        'HCPWM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip',
+        'HCPFI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip',
     }
 
     def __init__(
@@ -171,7 +171,7 @@ 

Source code for NeuroGraph.datasets

         self.name = name
 
         super().__init__(root, transform, pre_transform, pre_filter)
-        self.load(self.processed_paths[0])
+        self.data, self.slices = torch.load(self.processed_paths[0])
 
     @property
     def raw_dir(self) -> str:
@@ -189,7 +189,9 @@ 

Source code for NeuroGraph.datasets

     def processed_file_names(self) -> str:
         return 'data.pt'
 
-
[docs] def download(self): +
+[docs] + def download(self): url = f'{self.url}/{self.filenames[self.name]}' path = download_url(url, self.raw_dir) extract_zip(path, self.raw_dir) @@ -199,7 +201,10 @@

Source code for NeuroGraph.datasets

             osp.join(self.raw_dir, 'data.pt'))
         shutil.rmtree(osp.join(self.raw_dir, self.name))
-
[docs] def process(self): + +
+[docs] + def process(self): data, slices = torch.load(self.raw_paths[0]) num_samples = slices['x'].size(0) - 1 @@ -219,10 +224,14 @@

Source code for NeuroGraph.datasets

                 sample = self.pre_transform(sample)
 
             data_list.append(sample)
+        data, slices = self.collate(data_list)
+        torch.save((data,slices), self.processed_paths[0])
+
- self.save(data_list, self.processed_paths[0])
-
[docs]class NeuroGraphDynamic(): +
+[docs] +class NeuroGraphDynamic(): r"""Graph-based neuroimaging benchmark datasets, e.g., :obj:`"DynHCP-Gender"`, :obj:`"DynHCP-Age"`, :obj:`"DynHCP-State"`, :obj:`"DynHCP-WM"`, or :obj:`"DynHCP-FI"` @@ -234,31 +243,61 @@

Source code for NeuroGraph.datasets

         Returns:
             list: A list of graphs in PyTorch Geometric (pyg) format. Each graph contains a list of dynamic graphs batched in pyg batch.
     """
+    url = 'https://vanderbilt.box.com/shared/static'
+    filenames = {
+            'DynHCPGender': 'mj0z6unea34lfz1hkdwsinj7g22yohxn.zip',
+            'DynHCPActivity': '2so3fnfqakeu6hktz322o3nm2c8ocus7.zip',
+            'DynHCPAge': '195f9teg4t4apn6kl6hbc4ib4g9addtq.zip',
+            'DynHCPWM': 'mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip',
+            'DynHCPFI': 'un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip',
+        }
     def __init__(self,root, name):
         self.root = root
         self.name = name
-        self.urls = {"DynHCP-Gender":'https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip',
-                    "DynHCP-State":'https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip',
-                    "DynHCP-Age":'https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip',
-                    "DynHCP-WM":'https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip',
-                    "DynHCP-FI":'https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip'
-                    }
-        if self.urls.get(name):
-            self.download(self.urls.get(name))
-        else:
-            print('dataset not found! The name of the datasets are: "DynHCPGender","DynHCPActivity","DynHCPAge","DynHCPWM","DynHCPFI"')
+        
+
+        # self.urls = {"DynHCP-Gender":'https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip',
+        #             "DynHCP-State":'https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip',
+        #             "DynHCP-Age":'https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip',
+        #             "DynHCP-WM":'https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip',
+        #             "DynHCP-FI":'https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip'
+        #             }
+        assert name in self.filenames.keys()
+        self.name = name
+        file_path = os.path.join(self.root,self.name,'processed', self.name+".pt")
+        if not os.path.exists(file_path):
+            self.download()
+        # else:
+        #     print('dataset not found! The name of the datasets are: "DynHCP-Gender","DynHCP-Activity","DynHCP-Age","DynHCP-WM","DynHCP-FI"')
         self.dataset, self.labels = self.load_data()
     
-
[docs] def download(self,url): - - download_url(url, os.path.join(self.root, self.name)) - basename = os.path.basename(url) - with zipfile.ZipFile(os.path.join(self.root,self.name,basename), 'r') as file: - file.extractall(os.path.join(self.root,self.name,os.path.dirname(basename)))
+ # def download(self,url): + # download_url(url, os.path.join(self.root, self.name)) + # basename = os.path.basename(url) + # with zipfile.ZipFile(os.path.join(self.root,self.name,basename), 'r') as file: + # file.extractall(os.path.join(self.root,self.name,os.path.dirname(basename))) # self.remove(os.path.join(self.raw_dir,basename)) -
[docs] def load_data(self): - if self.name=='DynHCP-State': - dataset_raw = torch.load(os.path.join(self.root,self.name,self.name,"processed", self.name+".pt")) + + +
+[docs] + def download(self): + url = f'{self.url}/{self.filenames[self.name]}' + path = download_url(url, os.path.join(self.root, self.name)) + extract_zip(path, self.root) + os.unlink(path)
+ + # os.rename( + # osp.join(self.raw_dir, self.name, 'processed', f'{self.name}.pt'), + # osp.join(self.raw_dir, 'data.pt')) + # shutil.rmtree(osp.join(self.raw_dir, self.name)) + + +
+[docs] + def load_data(self): + if self.name=='DynHCPActivity': + dataset_raw = torch.load(os.path.join(self.root,self.name,'processed', self.name+".pt")) dataset,labels = [],[] for v in dataset_raw: batches = v.get('batches') @@ -268,10 +307,12 @@

Source code for NeuroGraph.datasets

                         dataset.append(b)
                         labels.append(y)
         else:
-            dataset = torch.load(os.path.join(self.root,self.name,self.name,"processed", self.name+".pt"))
+            dataset = torch.load(os.path.join(self.root,self.name,'processed', self.name+".pt"))
             labels = dataset['labels']
             dataset = dataset['batches']
-        return dataset,labels
+ return dataset,labels
+
+
diff --git a/doc/_build/html/_modules/index.html b/doc/_build/html/_modules/index.html index e011775..f4139fe 100644 --- a/doc/_build/html/_modules/index.html +++ b/doc/_build/html/_modules/index.html @@ -10,11 +10,9 @@ - - - - - + + + diff --git a/doc/_build/html/_sources/get_started.rst.txt b/doc/_build/html/_sources/get_started.rst.txt index e1f8284..1074b9d 100644 --- a/doc/_build/html/_sources/get_started.rst.txt +++ b/doc/_build/html/_sources/get_started.rst.txt @@ -20,7 +20,7 @@ NeuroGraph utilizes the `PyG` `InMemoryDataset` class to facilitate the loading from NeuroGraph.datasets import NeuroGraphStatic - dataset = NeuroGraphStatic(root="data/", name= "HCP-Gender") + dataset = NeuroGraphStatic(root="data/", name= "HCPGender") print(dataset.num_classes) print(dataset.num_features) @@ -37,7 +37,7 @@ To efficiently store and utilize the dynamic datasets in `PyG`` Batch format, we from NeuroGraph.datasets import NeuroGraphDynamic - data_obj = NeuroGraphDynamic(root="data/", dataset_name= "DynHCP-Gender") + data_obj = NeuroGraphDynamic(root="data/", name= "DynHCPGender") dataset = data_obj.dataset labels = data_obj.labels print(len(dataset), len(labels)) diff --git a/doc/_build/html/_static/basic.css b/doc/_build/html/_static/basic.css index 4e9a9f1..30fee9d 100644 --- a/doc/_build/html/_static/basic.css +++ b/doc/_build/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -237,6 +237,10 @@ a.headerlink { visibility: hidden; } +a:visited { + color: #551A8B; +} + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -324,6 +328,7 @@ aside.sidebar { p.sidebar-title { font-weight: bold; } + nav.contents, aside.topic, div.admonition, div.topic, blockquote { @@ -331,6 +336,7 @@ div.admonition, div.topic, blockquote { } /* -- topics ---------------------------------------------------------------- */ + nav.contents, aside.topic, div.topic { @@ -606,6 +612,7 @@ ol.simple p, ul.simple p { margin-bottom: 0; } + aside.footnote > span, div.citation > span { float: left; @@ -667,6 +674,16 @@ dd { margin-left: 30px; } +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + dl > dd:last-child, dl > dd:last-child > :last-child { margin-bottom: 0; @@ -735,6 +752,14 @@ abbr, acronym { cursor: help; } +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + /* -- code displays --------------------------------------------------------- */ pre { diff --git a/doc/_build/html/_static/doctools.js b/doc/_build/html/_static/doctools.js index c3db08d..d06a71d 100644 --- a/doc/_build/html/_static/doctools.js +++ b/doc/_build/html/_static/doctools.js @@ -4,12 +4,19 @@ * * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ "use strict"; +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + const _ready = (callback) => { if (document.readyState !== "loading") { callback(); @@ -18,73 +25,11 @@ const _ready = (callback) => { } }; -/** - * highlight a given string on a node by wrapping it in - * span elements with the given class name. - */ -const _highlight = (node, addItems, text, className) => { - if (node.nodeType === Node.TEXT_NODE) { - const val = node.nodeValue; - const parent = node.parentNode; - const pos = val.toLowerCase().indexOf(text); - if ( - pos >= 0 && - !parent.classList.contains(className) && - !parent.classList.contains("nohighlight") - ) { - let span; - - const closestNode = parent.closest("body, svg, foreignObject"); - const isInSVG = closestNode && closestNode.matches("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.classList.add(className); - } - - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - parent.insertBefore( - span, - parent.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling - ) - ); - node.nodeValue = val.substr(0, pos); - - if (isInSVG) { - const rect = document.createElementNS( - "http://www.w3.org/2000/svg", - "rect" - ); - const bbox = parent.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute("class", className); - addItems.push({ parent: parent, target: rect }); - } - } - } else if (node.matches && !node.matches("button, select, textarea")) { - node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); - } -}; -const _highlightText = (thisNode, text, className) => { - let addItems = []; - _highlight(thisNode, addItems, text, className); - addItems.forEach((obj) => - obj.parent.insertAdjacentElement("beforebegin", obj.target) - ); -}; - /** * Small JavaScript module for the documentation. */ const Documentation = { init: () => { - Documentation.highlightSearchWords(); Documentation.initDomainIndexTable(); Documentation.initOnKeyListeners(); }, @@ -126,51 +71,6 @@ const Documentation = { Documentation.LOCALE = catalog.locale; }, - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords: () => { - const highlight = - new URLSearchParams(window.location.search).get("highlight") || ""; - const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); - if (terms.length === 0) return; // nothing to do - - // There should never be more than one element matching "div.body" - const divBody = document.querySelectorAll("div.body"); - const body = divBody.length ? divBody[0] : document.querySelector("body"); - window.setTimeout(() => { - terms.forEach((term) => _highlightText(body, term, "highlighted")); - }, 10); - - const searchBox = document.getElementById("searchbox"); - if (searchBox === null) return; - searchBox.appendChild( - document - .createRange() - .createContextualFragment( - '" - ) - ); - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords: () => { - document - .querySelectorAll("#searchbox .highlight-link") - .forEach((el) => el.remove()); - document - .querySelectorAll("span.highlighted") - .forEach((el) => el.classList.remove("highlighted")); - const url = new URL(window.location); - url.searchParams.delete("highlight"); - window.history.replaceState({}, "", url); - }, - /** * helper function to focus on search bar */ @@ -210,15 +110,11 @@ const Documentation = { ) return; - const blacklistedElements = new Set([ - "TEXTAREA", - "INPUT", - "SELECT", - "BUTTON", - ]); document.addEventListener("keydown", (event) => { - if (blacklistedElements.has(document.activeElement.tagName)) return; // bail for input elements - if (event.altKey || event.ctrlKey || event.metaKey) return; // bail with special keys + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; if (!event.shiftKey) { switch (event.key) { @@ -240,10 +136,6 @@ const Documentation = { event.preventDefault(); } break; - case "Escape": - if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; - Documentation.hideSearchWords(); - event.preventDefault(); } } diff --git a/doc/_build/html/_static/documentation_options.js b/doc/_build/html/_static/documentation_options.js index 69415c9..42ebe09 100644 --- a/doc/_build/html/_static/documentation_options.js +++ b/doc/_build/html/_static/documentation_options.js @@ -1,5 +1,4 @@ -var DOCUMENTATION_OPTIONS = { - URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), +const DOCUMENTATION_OPTIONS = { VERSION: '2.1.0', LANGUAGE: 'en', COLLAPSE_INDEX: false, diff --git a/doc/_build/html/_static/language_data.js b/doc/_build/html/_static/language_data.js index 2e22b06..250f566 100644 --- a/doc/_build/html/_static/language_data.js +++ b/doc/_build/html/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/doc/_build/html/_static/pygments.css b/doc/_build/html/_static/pygments.css index 691aeb8..0d49244 100644 --- a/doc/_build/html/_static/pygments.css +++ b/doc/_build/html/_static/pygments.css @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #FF0000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ diff --git a/doc/_build/html/_static/searchtools.js b/doc/_build/html/_static/searchtools.js index f2fb7d5..7918c3f 100644 --- a/doc/_build/html/_static/searchtools.js +++ b/doc/_build/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -57,14 +57,14 @@ const _removeChildren = (element) => { const _escapeRegExp = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string -const _displayItem = (item, highlightTerms, searchTerms) => { +const _displayItem = (item, searchTerms, highlightTerms) => { const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; - const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; - const [docName, title, anchor, descr] = item; + const [docName, title, anchor, descr, score, _filename] = item; let listItem = document.createElement("li"); let requestUrl; @@ -75,29 +75,35 @@ const _displayItem = (item, highlightTerms, searchTerms) => { if (dirname.match(/\/index\/$/)) dirname = dirname.substring(0, dirname.length - 6); else if (dirname === "index/") dirname = ""; - requestUrl = docUrlRoot + dirname; + requestUrl = contentRoot + dirname; linkUrl = requestUrl; } else { // normal html builders - requestUrl = docUrlRoot + docName + docFileSuffix; + requestUrl = contentRoot + docName + docFileSuffix; linkUrl = docName + docLinkSuffix; } - const params = new URLSearchParams(); - params.set("highlight", [...highlightTerms].join(" ")); let linkEl = listItem.appendChild(document.createElement("a")); - linkEl.href = linkUrl + "?" + params.toString() + anchor; + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; linkEl.innerHTML = title; - if (descr) + if (descr) { listItem.appendChild(document.createElement("span")).innerHTML = " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } else if (showSearchSummary) fetch(requestUrl) .then((responseData) => responseData.text()) .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms, highlightTerms) + Search.makeSearchSummary(data, searchTerms) ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); }); Search.output.appendChild(listItem); }; @@ -116,15 +122,15 @@ const _finishSearch = (resultCount) => { const _displayNextItem = ( results, resultCount, + searchTerms, highlightTerms, - searchTerms ) => { // results left, load the summary and display it // this is intended to be dynamic (don't sub resultsCount) if (results.length) { - _displayItem(results.pop(), highlightTerms, searchTerms); + _displayItem(results.pop(), searchTerms, highlightTerms); setTimeout( - () => _displayNextItem(results, resultCount, highlightTerms, searchTerms), + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), 5 ); } @@ -237,6 +243,12 @@ const Search = { * execute search (requires search index to be loaded) */ query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + // stem the search terms and add them to the correct list const stemmer = new Stemmer(); const searchTerms = new Set(); @@ -264,6 +276,10 @@ const Search = { } }); + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + // console.debug("SEARCH: searching for:"); // console.info("required: ", [...searchTerms]); // console.info("excluded: ", [...excludedTerms]); @@ -272,6 +288,40 @@ const Search = { let results = []; _removeChildren(document.getElementById("search-progress")); + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + // lookup as object objectTerms.forEach((term) => results.push(...Search.performObjectSearch(term, objectTerms)) @@ -318,7 +368,7 @@ const Search = { // console.info("search results:", Search.lastresults); // print the results - _displayNextItem(results, results.length, highlightTerms, searchTerms); + _displayNextItem(results, results.length, searchTerms, highlightTerms); }, /** @@ -399,8 +449,8 @@ const Search = { // prepare search const terms = Search._index.terms; const titleTerms = Search._index.titleterms; - const docNames = Search._index.docnames; const filenames = Search._index.filenames; + const docNames = Search._index.docnames; const titles = Search._index.titles; const scoreMap = new Map(); @@ -497,11 +547,9 @@ const Search = { /** * helper function to return a node containing the * search summary for a given text. keywords is a list - * of stemmed words, highlightWords is the list of normal, unstemmed - * words. the first one is used to find the occurrence, the - * latter for highlighting it. + * of stemmed words. */ - makeSearchSummary: (htmlText, keywords, highlightWords) => { + makeSearchSummary: (htmlText, keywords) => { const text = Search.htmlToText(htmlText); if (text === "") return null; @@ -519,10 +567,6 @@ const Search = { summary.classList.add("context"); summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; - highlightWords.forEach((highlightWord) => - _highlightText(summary, highlightWord, "highlighted") - ); - return summary; }, }; diff --git a/doc/_build/html/datasets.html b/doc/_build/html/datasets.html index 0f39058..ec81d86 100644 --- a/doc/_build/html/datasets.html +++ b/doc/_build/html/datasets.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -60,7 +58,27 @@

Loading Benchmarks:

Preprocessing:

    @@ -96,50 +114,54 @@
    -

    Load Benchmark Datasets

    -
    -
    -class NeuroGraphDynamic(root, name)[source]
    -

    Bases: object

    -

    Graph-based neuroimaging benchmark datasets, e.g., -"DynHCP-Gender", "DynHCP-Age", "DynHCP-State", -"DynHCP-WM", or "DynHCP-FI"

    -
    -
    Args:

    root (str): Root directory where the dataset should be saved. -name (str): The name of the dataset.

    -
    -
    Returns:

    list: A list of graphs in PyTorch Geometric (pyg) format. Each graph contains a list of dynamic graphs batched in pyg batch.

    -
    -
    -
    -
    -download(url)[source]
    -
    - -
    -
    -load_data()[source]
    -
    - -
    - +

    Load Benchmark Datasets

    -
    -class NeuroGraphStatic(root: str, name: str, transform: Optional[Callable] = None, pre_transform: Optional[Callable] = None, pre_filter: Optional[Callable] = None)[source]
    +
    +class NeuroGraphDataset(root: str, name: str, transform: Callable | None = None, pre_transform: Callable | None = None, pre_filter: Callable | None = None)[source]

    Bases: InMemoryDataset

    The NeuroGraph benchmark datasets from the “NeuroGraph: Benchmarks for Graph Machine Learning in Brain Connectomics” paper. -NeuroGraphStatic holds a collection of five neuroimaging graph +NeuroGraphDataset holds a collection of five neuroimaging graph learning datasets that span multiple categories of demographics, mental states, and cognitive traits. See the documentation and the Github for more details.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Dataset

    #Graphs

    Task

    HCPActivity

    7,443

    Graph Classification

    HCPGender

    1,078

    Graph Classification

    HCPAge

    1,065

    Graph Classification

    HCPFI

    1,071

    Graph Regression

    HCPWM

    1,078

    Graph Regression

    Args:

    root (str): Root directory where the dataset should be saved. name (str): The name of the dataset (one of "HCPGender",

    -

    "HCP-State", "HCP-Age", "HCP-FI", -"HCP-WM").

    +

    "HCPActivity", "HCPAge", "HCPFI", +"HCPWM").

    transform (callable, optional): A function/transform that takes in an

    torch_geometric.data.Data object and returns a transformed @@ -158,49 +180,85 @@

    -
    -download()[source]
    +
    +download()[source]

    Downloads the dataset to the self.raw_dir folder.

    -
    -filenames = {'HCP-Age': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip', 'HCP-FI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip', 'HCP-Gender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip', 'HCP-State': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip', 'HCP-WM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip'}
    +
    +filenames = {'HCPActivity': 'b4g59ibn8itegr0rpcd16m9ajb2qyddf.zip', 'HCPAge': 'static/lzzks4472czy9f9vc8aikp7pdbknmtfe.zip', 'HCPFI': 'g2md9h9snh7jh6eeay02k1kr9m4ido9f.zip', 'HCPGender': 'r6hlz2arm7yiy6v6981cv2nzq3b0meax.zip', 'HCPWM': 'xtmpa6712fidi94x6kevpsddf9skuoxy.zip'}
    -
    -process()[source]
    +
    +process()[source]

    Processes the dataset to the self.processed_dir folder.

    -
    -property processed_dir: str
    +
    +property processed_dir: str
    -
    -property processed_file_names: str
    +
    +property processed_file_names: str

    The name of the files in the self.processed_dir folder that must be present in order to skip processing.

    -
    -property raw_dir: str
    +
    +property raw_dir: str
    -
    -property raw_file_names: str
    +
    +property raw_file_names: str

    The name of the files in the self.raw_dir folder that must be present in order to skip downloading.

    -
    -url = 'https://vanderbilt.box.com/shared/static'
    +
    +url = 'https://vanderbilt.box.com/shared/static'
    +
    + +
    + +
    +
    +class NeuroGraphDynamic(root, name)[source]
    +

    Bases: object

    +

    Graph-based neuroimaging benchmark datasets, e.g., +"DynHCP-Gender", "DynHCP-Age", "DynHCP-State", +"DynHCP-WM", or "DynHCP-FI"

    +
    +
    Args:

    root (str): Root directory where the dataset should be saved. +name (str): The name of the dataset.

    +
    +
    Returns:

    list: A list of graphs in PyTorch Geometric (pyg) format. Each graph contains a list of dynamic graphs batched in pyg batch.

    +
    +
    +
    +
    +download()[source]
    +
    + +
    +
    +filenames = {'DynHCPActivity': '2so3fnfqakeu6hktz322o3nm2c8ocus7.zip', 'DynHCPAge': '195f9teg4t4apn6kl6hbc4ib4g9addtq.zip', 'DynHCPFI': 'un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip', 'DynHCPGender': 'mj0z6unea34lfz1hkdwsinj7g22yohxn.zip', 'DynHCPWM': 'mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip'}
    +
    + +
    +
    +load_data()[source]
    +
    + +
    +
    +url = 'https://vanderbilt.box.com/shared/static'
    diff --git a/doc/_build/html/genindex.html b/doc/_build/html/genindex.html index 4cb2b00..859c34f 100644 --- a/doc/_build/html/genindex.html +++ b/doc/_build/html/genindex.html @@ -10,11 +10,9 @@ - - - - - + + + @@ -166,10 +164,10 @@

    C

    D

    @@ -206,8 +204,12 @@

    F

    @@ -286,9 +288,9 @@

    N

  • module
-
  • NeuroGraphDynamic (class in NeuroGraph.datasets) +
  • NeuroGraphDataset (class in NeuroGraph.datasets)
  • -
  • NeuroGraphStatic (class in NeuroGraph.datasets) +
  • NeuroGraphDynamic (class in NeuroGraph.datasets)
  • @@ -315,7 +317,7 @@

    P

  • (Gender_Dataset method)
  • -
  • (NeuroGraphStatic method) +
  • (NeuroGraphDataset method)
  • (WM_Dataset method)
  • @@ -324,7 +326,7 @@

    P

    • process_dynamic_fc() (Dyn_Down_Prep method)
    • -
    • processed_dir (NeuroGraphStatic property) +
    • processed_dir (NeuroGraphDataset property)
    • processed_file_names (Age_Dataset property) @@ -341,7 +343,7 @@

      P

    • (Gender_Dataset property)
    • -
    • (NeuroGraphStatic property) +
    • (NeuroGraphDataset property)
    • (WM_Dataset property)
    • @@ -352,9 +354,9 @@

      P

      R

        @@ -368,8 +370,12 @@

        R

        U

        diff --git a/doc/_build/html/get_started.html b/doc/_build/html/get_started.html index e32a1dd..6e18ccb 100644 --- a/doc/_build/html/get_started.html +++ b/doc/_build/html/get_started.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -107,18 +105,18 @@
        -

        Introduction by Example

        +

        Introduction by Example

        We will briefly introduce the fundamental concepts of NeuroGraph through self-contained examples. We closely follow the data representation format of PyG. Therefore, interested readers are referred to the PyG documentation for an introduction to the graph machine learning and PyG’s data representation formats.

        -

        Loading Benchmark datasets

        +

        Loading Benchmark datasets

        NeuroGraph provides two classes for loading static and dynamic benchmark datastes.

        -

        Loading Static Benchmarks

        +

        Loading Static Benchmarks

        NeuroGraph utilizes the PyG InMemoryDataset class to facilitate the loading of datasets. this allows an easy-to-use interface for applying graph machine learning pipelines. For example, the HCPGender benchmark can be loaded as follows:

        1from NeuroGraph.datasets import NeuroGraphStatic
         2
         3
        -4dataset = NeuroGraphStatic(root="data/", name= "HCP-Gender")
        +4dataset = NeuroGraphStatic(root="data/", name= "HCPGender")
         5
         6print(dataset.num_classes)
         7print(dataset.num_features)
        @@ -126,11 +124,11 @@ 

        Loading Static Benchmarks -

        Loading Dynamic Dataset

        +

        Loading Dynamic Dataset

        To efficiently store and utilize the dynamic datasets in PyG` Batch format, we provide the corresponding functionality. Here is an example of loading the DynHCPGender dataset:

        1from NeuroGraph.datasets import NeuroGraphDynamic
         2
        -3data_obj = NeuroGraphDynamic(root="data/", dataset_name= "DynHCP-Gender")
        +3data_obj = NeuroGraphDynamic(root="data/", name= "DynHCPGender")
         4dataset = data_obj.dataset
         5labels = data_obj.labels
         6print(len(dataset), len(labels))
        @@ -141,7 +139,7 @@ 

        Loading Dynamic Dataset

        -

        Preprocessing Examples

        +

        Preprocessing Examples

        To bridge the gap betwee NeuroGraph and graph machine learning domains, NeuroGraph offers tools to easily preprocess and construct graph-based neuroimaging datasets. Here, we demonstrate how to preprocess your own data to construct functional connectomes and generate corresponding graphs-based representations.

        1from NeuroGraph import utils
         2
        @@ -189,10 +187,10 @@ 

        Preprocessing Examples

        -

        Preprocessing Human Connectome Project (HCP1200) Dataset

        +

        Preprocessing Human Connectome Project (HCP1200) Dataset

        NeuroGraph utilizes the HCP1200 dataset as a primary data source for exploring the dataset generation search space and constructing benchmarks. The HCP1200 dataset can be accessed from the HCP website by accepting the data usage terms. Additionally, the dataset is also available on an AWS S3 bucket, which can be accessed once authorization has been obtained from HCP. In this section, we provide various functions that allow you to crawl and preprocess the HCP datasets, enabling the construction of graph-based neuroimaging datasets. These functions streamline the process of obtaining and preparing the data for further analysis and modeling.

        -

        Download and preprocess static datasets

        +

        Download and preprocess static datasets

         1from NeuroGraph.preprocess import Brain_Connectome_Rest_Download
          2import boto3
          3
        @@ -240,7 +238,7 @@ 

        Download and preprocess static datasets -

        Download and preprocess dynamic datasets

        +

        Download and preprocess dynamic datasets

        We also offer similar functionalities for constructing dynamic datasets. You can create a dynamic REST dataset from the data stored locally as follows.

        1from NeuroGraph import preprocess
         2
        diff --git a/doc/_build/html/index.html b/doc/_build/html/index.html
        index bdd8fd1..ae2858d 100644
        --- a/doc/_build/html/index.html
        +++ b/doc/_build/html/index.html
        @@ -11,11 +11,9 @@
             
           
           
        -        
        -        
        -        
        -        
        -        
        +        
        +        
        +        
             
             
             
        @@ -126,23 +124,48 @@
         
         
         
         
        -

        Indices and tables

        +

        Indices and tables

        • Index

        • Module Index

        • diff --git a/doc/_build/html/install.html b/doc/_build/html/install.html index e3ea2b9..4dc4a76 100644 --- a/doc/_build/html/install.html +++ b/doc/_build/html/install.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -96,7 +94,7 @@
          -

          Installation

          +

          Installation

          NeuroGraph is available for Python 3 and can be easily installed with pip

          pip install NeuroGraph
           
          diff --git a/doc/_build/html/objects.inv b/doc/_build/html/objects.inv index f120fef..abb4d25 100644 Binary files a/doc/_build/html/objects.inv and b/doc/_build/html/objects.inv differ diff --git a/doc/_build/html/preprocess.html b/doc/_build/html/preprocess.html index d3faaa2..a62278d 100644 --- a/doc/_build/html/preprocess.html +++ b/doc/_build/html/preprocess.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -64,7 +62,70 @@

        Preprocessing:

        Utilities:

          @@ -96,20 +157,20 @@
          -

          NeuroGraph Preprocessing Functionalities

          +

          NeuroGraph Preprocessing Functionalities

          -class Age_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Age_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -118,17 +179,17 @@
          -class Brain_Connectome_Rest(root, name, n_rois, threshold, path_to_data, n_jobs, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Brain_Connectome_Rest(root, name, n_rois, threshold, path_to_data, n_jobs, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -construct_adj_postive_perc(corr)[source]
          +construct_adj_postive_perc(corr)[source]

          construct adjacency matrix from the given correlation matrix and threshold

          -extract_from_3d_no(volume, fmri)[source]
          +extract_from_3d_no(volume, fmri)[source]

          Extract time-series data from a 3d atlas with non-overlapping ROIs.

          Inputs:

          path_to_atlas = ‘/path/to/atlas.nii.gz’ @@ -141,18 +202,18 @@

          -get_data_obj(iid, behavioral_data, path_to_data, volume)[source]
          +get_data_obj(iid, behavioral_data, path_to_data, volume)[source]
          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -161,16 +222,16 @@
          -class Brain_Connectome_Rest_Download(root, name, n_rois, threshold, path_to_data, n_jobs, s3, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Brain_Connectome_Rest_Download(root, name, n_rois, threshold, path_to_data, n_jobs, s3, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -construct_Adj_postive_perc(corr)[source]
          +construct_Adj_postive_perc(corr)[source]
          -extract_from_3d_no(volume, fmri)[source]
          +extract_from_3d_no(volume, fmri)[source]

          Extract time-series data from a 3d atlas with non-overlapping ROIs.

          Inputs:

          path_to_atlas = ‘/path/to/atlas.nii.gz’ @@ -183,18 +244,18 @@

          -get_data_obj(iid, behavioral_data, BUCKET_NAME, volume)[source]
          +get_data_obj(iid, behavioral_data, BUCKET_NAME, volume)[source]
          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -203,17 +264,17 @@
          -class Brain_Connectome_State(root, dataset_name, n_rois, threshold, path_to_data, n_jobs, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Brain_Connectome_State(root, dataset_name, n_rois, threshold, path_to_data, n_jobs, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -construct_adj_postive_perc(corr)[source]
          +construct_adj_postive_perc(corr)[source]

          construct adjacency matrix from the given correlation matrix and threshold

          -extract_from_3d_no(volume, fmri)[source]
          +extract_from_3d_no(volume, fmri)[source]

          Extract time-series data from a 3d atlas with non-overlapping ROIs.

          Inputs:

          path_to_atlas = ‘/path/to/atlas.nii.gz’ @@ -226,18 +287,18 @@

          -get_data_obj_task(iid, target_path, volume)[source]
          +get_data_obj_task(iid, target_path, volume)[source]
          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -246,16 +307,16 @@
          -class Brain_Connectome_State_Download(root, dataset_name, n_rois, threshold, path_to_data, n_jobs, s3, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Brain_Connectome_State_Download(root, dataset_name, n_rois, threshold, path_to_data, n_jobs, s3, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -construct_Adj_postive_perc(corr)[source]
          +construct_Adj_postive_perc(corr)[source]
          -extract_from_3d_no(volume, fmri)[source]
          +extract_from_3d_no(volume, fmri)[source]

          Extract time-series data from a 3d atlas with non-overlapping ROIs.

          Inputs:

          path_to_atlas = ‘/path/to/atlas.nii.gz’ @@ -268,18 +329,18 @@

          -get_data_obj_task(iid, BUCKET_NAME, volume)[source]
          +get_data_obj_task(iid, BUCKET_NAME, volume)[source]
          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -288,21 +349,21 @@
          -class Dyn_Down_Prep(root, name, s3, n_rois=100, threshold=10, window_size=50, stride=3, dynamic_length=150)[source]
          +class Dyn_Down_Prep(root, name, s3, n_rois=100, threshold=10, window_size=50, stride=3, dynamic_length=150)[source]

          Bases: object

          -construct_Adj_postive_perc(corr)[source]
          +construct_Adj_postive_perc(corr)[source]
          -construct_dataset()[source]
          +construct_dataset()[source]
          -extract_from_3d_no(fmri)[source]
          +extract_from_3d_no(fmri)[source]

          Extract time-series data from a 3d atlas with non-overlapping ROIs.

          Inputs:

          path_to_atlas = ‘/path/to/atlas.nii.gz’ @@ -315,19 +376,19 @@

          -get_dynamic_data_object(iid)[source]
          +get_dynamic_data_object(iid)[source]
          -process_dynamic_fc(timeseries, y, sampling_init=None, self_loop=True)[source]
          +process_dynamic_fc(timeseries, y, sampling_init=None, self_loop=True)[source]
          -Dyn_Prep(fmri, regs, n_rois=100, window_size=50, stride=3, dynamic_length=None)[source]
          +Dyn_Prep(fmri, regs, n_rois=100, window_size=50, stride=3, dynamic_length=None)[source]

          Preprocess fMRI data using NeuroGraph preprocessing pipeline and construct dynamic functional connectome matrices

          Args:

          fmri (numpy array): fmri image @@ -343,17 +404,17 @@

          -class FI_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]
          +class FI_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -362,17 +423,17 @@
          -class Gender_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]
          +class Gender_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          @@ -381,17 +442,17 @@
          -class WM_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]
          +class WM_Dataset(root, dataset_name, dataset, transform=None, pre_transform=None, pre_filter=None)[source]

          Bases: InMemoryDataset

          -process()[source]
          +process()[source]

          Processes the dataset to the self.processed_dir folder.

          -property processed_file_names
          +property processed_file_names

          The name of the files in the self.processed_dir folder that must be present in order to skip processing.

          diff --git a/doc/_build/html/py-modindex.html b/doc/_build/html/py-modindex.html index a43d3f7..d18f26b 100644 --- a/doc/_build/html/py-modindex.html +++ b/doc/_build/html/py-modindex.html @@ -10,11 +10,9 @@ - - - - - + + + diff --git a/doc/_build/html/search.html b/doc/_build/html/search.html index 9d89a70..c06813f 100644 --- a/doc/_build/html/search.html +++ b/doc/_build/html/search.html @@ -11,11 +11,9 @@ - - - - - + + + diff --git a/doc/_build/html/searchindex.js b/doc/_build/html/searchindex.js index a37978d..5840f4b 100644 --- a/doc/_build/html/searchindex.js +++ b/doc/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["NeuroGraph", "datasets", "get_started", "index", "install", "preprocess", "utils"], "filenames": ["NeuroGraph.rst", "datasets.rst", "get_started.rst", "index.rst", "install.rst", "preprocess.rst", "utils.rst"], "titles": ["Demographics", "Load Benchmark Datasets", "Introduction by Example", "Indices and tables", "Installation", "NeuroGraph Preprocessing Functionalities", "NeuroGraph Utilities"], "terms": {"neurograph": [0, 1, 2, 4], "collect": [0, 1], "graph": [0, 1, 2, 5, 6], "base": [0, 1, 2, 5], "neuroimag": [0, 1, 2], "dataset": [0, 3, 5], "span": [0, 1], "multipl": [0, 1], "categori": [0, 1], "The": [0, 1, 2, 5], "follow": [0, 2, 4], "provid": [0, 2, 4], "an": [0, 1, 2], "overview": 0, "associ": 0, "includ": [0, 1], "gender": [0, 1, 2], "ag": [0, 1, 2], "estim": 0, "attribut": 0, "facilit": [0, 2], "binari": 0, "classif": 0, "being": [0, 1], "male": 0, "femal": 0, "categor": 0, "three": 0, "distinct": 0, "group": 0, "22": 0, "25": 0, "26": 0, "30": 0, "31": 0, "35": 0, "year": 0, "we": [0, 2, 5, 6], "introduc": [0, 2], "four": [0, 2], "name": [0, 1, 2, 5], "hcp": [0, 1, 2], "dynhcp": [0, 1, 2], "under": [0, 2], "thi": [0, 2, 6], "first": 0, "two": [0, 2], "ar": [0, 2], "static": [0, 1, 3], "while": [0, 2], "last": 0, "correspond": [0, 2], "dynam": [0, 1, 3, 5], "decod": 0, "involv": 0, "seven": 0, "task": 0, "emot": 0, "process": [0, 1, 2, 5], "gambl": 0, "languag": 0, "motor": 0, "relat": 0, "social": 0, "work": [0, 2], "memori": [0, 2, 5], "each": [0, 1, 2], "design": 0, "help": 0, "delin": 0, "core": 0, "set": [0, 5], "function": [0, 1, 2, 3, 6], "relev": 0, "differ": 0, "facet": 0, "between": 0, "human": [0, 3], "brain": [0, 1, 6], "behavior": 0, "present": [0, 1, 5], "activ": [0, 6], "represent": [0, 2], "its": 0, "counterpart": 0, "our": [0, 2], "compris": 0, "signific": 0, "list": [0, 1, 2], "sort": 0, "fluid": [0, 2], "intellig": [0, 2], "evalu": 0, "pmat24": 0, "refer": [0, 2], "individu": 0, "s": [], "capac": 0, "temporarili": 0, "hold": [0, 1], "manipul": 0, "inform": 0, "crucial": 0, "aspect": 0, "influenc": 0, "higher": [0, 6], "reason": 0, "comprehens": 0, "learn": [0, 1, 2], "repres": [0, 2], "abil": 0, "solv": 0, "novel": 0, "problem": 0, "independ": 0, "ani": 0, "knowledg": 0, "from": [0, 1, 2, 5, 6], "past": 0, "It": [0, 2], "demonstr": [0, 2], "analyz": 0, "complex": 0, "relationship": 0, "identifi": 0, "pattern": 0, "deriv": [0, 6], "solut": 0, "situat": 0, "predict": 0, "both": [0, 2], "quantifi": 0, "continu": [0, 2], "variabl": 0, "treat": 0, "regress": [0, 6], "aim": 0, "perform": [0, 2], "score": 0, "connectom": [0, 1, 3, 5, 6], "gener": [0, 2], "fi": [0, 1, 2], "wm": [0, 1, 2], "briefli": 2, "fundament": 2, "concept": 2, "through": 2, "self": [1, 2, 5], "contain": [1, 2], "close": 2, "data": [1, 2, 5, 6], "format": [1, 2], "pyg": [1, 2, 4, 6], "therefor": 2, "interest": [2, 5, 6], "reader": 2, "document": [1, 2, 4], "machin": [1, 2], "class": [1, 2, 5], "datast": 2, "util": 2, "inmemorydataset": [1, 2, 5], "allow": 2, "easi": 2, "us": [2, 5, 6], "interfac": 2, "appli": 2, "pipelin": [2, 5, 6], "For": [2, 5], "hcpgender": [1, 2], "can": [2, 4], "import": 2, "neurographstat": [1, 2], "root": [1, 2, 5], "print": 2, "num_class": 2, "num_featur": 2, "To": [2, 4], "effici": [2, 5], "store": 2, "batch": [1, 2], "here": [2, 4], "dynhcpgend": 2, "neurographdynam": [1, 2], "data_obj": 2, "dataset_nam": [2, 5], "label": [2, 6], "len": 2, "make": 2, "compat": 2, "bridg": 2, "gap": 2, "betwe": 2, "domain": 2, "offer": 2, "tool": 2, "easili": [2, 4], "construct": [2, 5, 6], "how": 2, "your": 2, "own": 2, "fc": 2, "fmri": [2, 5, 6], "reg": [2, 5, 6], "n_roi": [2, 5, 6], "1000": [2, 5, 6], "could": 2, "numpi": [2, 5, 6], "arrai": [2, 5, 6], "adjac": [2, 5, 6], "matrix": [2, 5, 6], "object": [1, 2, 5, 6], "creat": [2, 6], "functional_connectom": 2, "adj": 2, "construct_adj": [2, 6], "threshold": [2, 5, 6], "5": [2, 6], "construct_data": [2, 6], "1": [2, 6], "correl": [2, 5, 6], "node": [2, 6], "featur": [2, 6], "sourc": [1, 2, 5, 6], "code": 2, "one": [1, 2], "scan": 2, "regressor": [2, 5, 6], "np": 2, "nilearn": 2, "imag": [2, 5, 6], "load_img": 2, "img": 2, "raw": 2, "nii": [2, 5], "gz": [2, 5], "loadtxt": 2, "txt": 2, "movement": [2, 6], "get_fdata": 2, "100": [2, 5, 6], "torch": 2, "consist": 2, "five": [1, 2], "step": 2, "also": 2, "seper": 2, "parcel": [2, 6], "schaefer": 2, "atla": [2, 5], "default": [1, 2, 5, 6], "y": [2, 5, 6], "remove_drift": [2, 6], "regress_head_mot": [2, 6], "construct_corr": [2, 6], "primari": 2, "explor": 2, "search": [2, 3], "space": 2, "access": [1, 2], "websit": 2, "accept": 2, "usag": 2, "term": 2, "addition": 2, "avail": [2, 4], "aw": 2, "s3": [2, 5], "bucket": 2, "which": 2, "onc": 2, "author": 2, "ha": 2, "been": 2, "obtain": 2, "In": 2, "section": 2, "variou": 2, "you": 2, "crawl": 2, "enabl": 2, "These": 2, "streamlin": 2, "prepar": 2, "further": 2, "analysi": 2, "model": 2, "brain_connectome_rest_download": [2, 5], "boto3": 2, "path_to_data": [2, 5], "n_job": [2, 5], "script": 2, "run": 2, "parallel": 2, "requir": [2, 4], "number": [2, 5, 6], "job": 2, "input": [2, 5], "access_kei": 2, "connectomedb": 2, "credenti": 2, "secret_kei": 2, "client": 2, "aws_access_key_id": 2, "aws_secret_access_kei": 2, "hcp_behavior": 2, "csv": 2, "id": 2, "pkl": 2, "file": [1, 2, 5], "directori": [1, 2], "have": 2, "found": 2, "rest_dataset": 2, "note": 2, "separ": 2, "gender_dataset": [2, 5], "age_dataset": [2, 5], "hcpage": 2, "wm_datast": 2, "wm_dataset": [2, 5], "hcpwm": 2, "fi_datast": 2, "fi_dataset": [2, 5], "hcpfi": 2, "state": [1, 2, 3], "state_dataset": 2, "brain_connectome_state_download": [2, 5], "roi": [2, 5, 6], "If": 2, "local": 2, "brain_connectome_rest": [2, 5], "similarli": 2, "brain_connectome_st": [2, 5], "similar": 2, "rest": 2, "ngd": 2, "dyn_prep": [2, 5], "window_s": [2, 5], "50": [2, 5], "stride": [2, 5], "3": [2, 4, 5], "dynamic_length": [2, 5], "none": [1, 2, 5], "form": 2, "fed": 2, "fly": 2, "dyn_obj": 2, "preporcess": 2, "dyn_down_prep": [2, 5], "10": [2, 5], "150": [2, 5], "data_dict": 2, "dictionari": 2, "against": 2, "prprocess": 2, "k": 2, "v": 2, "item": 2, "l": 2, "0": 2, "int": [2, 5, 6], "sub": 2, "d": 2, "new_data": 2, "x": [2, 5, 6], "edge_index": 2, "append": 2, "from_data_list": 2, "instanc": 2, "new_dataset": 2, "2": 2, "ignor": 2, "subject": 2, "36": 2, "some": 2, "should": [1, 2], "remov": [2, 6], "math": 2, "isnan": 2, "demograph": [1, 3], "mental": [1, 3], "cognit": [1, 3], "trait": [1, 3], "introduct": 3, "exampl": 3, "project": 3, "hcp1200": 3, "download": [1, 3], "index": 3, "modul": 3, "page": 3, "python": 4, "pip": 4, "develop": 4, "top": 4, "pleas": 4, "instruct": 4, "i": [0, 2, 4], "": [0, 2], "e": 1, "g": 1, "arg": [1, 5, 6], "str": 1, "where": 1, "save": 1, "return": [1, 5, 6], "A": 1, "pytorch": 1, "geometr": 1, "url": 1, "load_data": 1, "transform": [1, 5], "option": [1, 5, 6], "callabl": 1, "pre_transform": [1, 5], "pre_filt": [1, 5], "paper": 1, "see": 1, "github": 1, "more": [1, 6], "detail": 1, "take": 1, "torch_geometr": 1, "version": 1, "befor": 1, "everi": 1, "disk": 1, "boolean": 1, "valu": 1, "indic": 1, "whether": 1, "final": 1, "raw_dir": 1, "folder": [1, 5], "filenam": 1, "lzzks4472czy9f9vc8aikp7pdbknmtf": 1, "zip": 1, "g2md9h9snh7jh6eeay02k1kr9m4ido9f": 1, "r6hlz2arm7yiy6v6981cv2nzq3b0meax": 1, "b4g59ibn8itegr0rpcd16m9ajb2qyddf": 1, "xtmpa6712fidi94x6kevpsddf9skuoxi": 1, "processed_dir": [1, 5], "properti": [1, 5], "processed_file_nam": [1, 5], "must": [1, 5], "order": [1, 5], "skip": [1, 5], "raw_file_nam": 1, "http": 1, "vanderbilt": 1, "box": 1, "com": 1, "share": 1, "construct_adj_postive_perc": 5, "corr": [5, 6], "given": 5, "extract_from_3d_no": 5, "volum": 5, "extract": 5, "time": 5, "seri": 5, "3d": 5, "non": 5, "overlap": 5, "path_to_atla": 5, "path": 5, "path_to_fmri": 5, "output": 5, "get_data_obj": 5, "iid": 5, "behavioral_data": 5, "bucket_nam": 5, "get_data_obj_task": 5, "target_path": 5, "construct_dataset": 5, "get_dynamic_data_object": 5, "process_dynamic_fc": 5, "timeseri": 5, "sampling_init": 5, "self_loop": 5, "true": 5, "matric": 5, "200": [5, 6], "300": [5, 6], "400": [5, 6], "500": [5, 6], "600": [5, 6], "700": [5, 6], "800": [5, 6], "900": [5, 6], "region": [5, 6], "length": 5, "window": 5, "consid": 5, "comput": 5, "whole": 5, "n": 6, "control": 6, "densiti": 6, "denser": 6, "m": 6, "preprocess": 6, "prepfrom": 6, "out": 6, "six": 6, "rigid": 6, "bodi": 6, "head": 6, "motion": 6, "paramet": 6, "along": 6, "scanner": 6, "drift": 6, "signal": 6, "aris": 6, "instrument": 6, "factor": 6, "By": 6, "elimin": 6, "trend": 6, "enhanc": 6, "nois": 6, "ratio": 6, "increas": 6, "sensit": 6, "neural": 6}, "objects": {"NeuroGraph": [[1, 0, 0, "-", "datasets"], [5, 0, 0, "-", "preprocess"], [6, 0, 0, "-", "utils"]], "NeuroGraph.datasets": [[1, 1, 1, "", "NeuroGraphDynamic"], [1, 1, 1, "", "NeuroGraphStatic"]], "NeuroGraph.datasets.NeuroGraphDynamic": [[1, 2, 1, "", "download"], [1, 2, 1, "", "load_data"]], "NeuroGraph.datasets.NeuroGraphStatic": [[1, 2, 1, "", "download"], [1, 3, 1, "", "filenames"], [1, 2, 1, "", "process"], [1, 4, 1, "", "processed_dir"], [1, 4, 1, "", "processed_file_names"], [1, 4, 1, "", "raw_dir"], [1, 4, 1, "", "raw_file_names"], [1, 3, 1, "", "url"]], "NeuroGraph.preprocess": [[5, 1, 1, "", "Age_Dataset"], [5, 1, 1, "", "Brain_Connectome_Rest"], [5, 1, 1, "", "Brain_Connectome_Rest_Download"], [5, 1, 1, "", "Brain_Connectome_State"], [5, 1, 1, "", "Brain_Connectome_State_Download"], [5, 1, 1, "", "Dyn_Down_Prep"], [5, 5, 1, "", "Dyn_Prep"], [5, 1, 1, "", "FI_Dataset"], [5, 1, 1, "", "Gender_Dataset"], [5, 1, 1, "", "WM_Dataset"]], "NeuroGraph.preprocess.Age_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_Rest": [[5, 2, 1, "", "construct_adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_Rest_Download": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_State": [[5, 2, 1, "", "construct_adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj_task"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_State_Download": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj_task"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Dyn_Down_Prep": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "construct_dataset"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_dynamic_data_object"], [5, 2, 1, "", "process_dynamic_fc"]], "NeuroGraph.preprocess.FI_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Gender_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.WM_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.utils": [[6, 5, 1, "", "construct_adj"], [6, 5, 1, "", "construct_corr"], [6, 5, 1, "", "construct_data"], [6, 5, 1, "", "parcellation"], [6, 5, 1, "", "preprocess"], [6, 5, 1, "", "regress_head_motions"], [6, 5, 1, "", "remove_drifts"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"demograph": 0, "mental": 0, "state": 0, "cognit": 0, "trait": 0, "load": [1, 2, 3], "benchmark": [1, 2, 3], "dataset": [1, 2], "introduct": 2, "exampl": 2, "static": 2, "dynam": 2, "preprocess": [2, 3, 5], "human": 2, "connectom": 2, "project": 2, "hcp1200": 2, "download": 2, "neurograph": [3, 5, 6], "instal": [3, 4], "get": 3, "start": 3, "util": [3, 6], "indic": 3, "tabl": 3, "function": 5}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 56}}) \ No newline at end of file +Search.setIndex({"docnames": ["NeuroGraph", "datasets", "get_started", "index", "install", "preprocess", "utils"], "filenames": ["NeuroGraph.rst", "datasets.rst", "get_started.rst", "index.rst", "install.rst", "preprocess.rst", "utils.rst"], "titles": ["Demographics", "Load Benchmark Datasets", "Introduction by Example", "Indices and tables", "Installation", "NeuroGraph Preprocessing Functionalities", "NeuroGraph Utilities"], "terms": {"neurograph": [0, 1, 2, 4], "i": [0, 2, 4], "collect": [0, 1], "graph": [0, 1, 2, 5, 6], "base": [0, 1, 2, 5], "neuroimag": [0, 1, 2], "dataset": [0, 3, 5], "span": [0, 1], "multipl": [0, 1], "categori": [0, 1], "The": [0, 1, 2, 5], "follow": [0, 2, 4], "provid": [0, 2, 4], "an": [0, 1, 2], "overview": 0, "associ": 0, "includ": [0, 1], "gender": [0, 1, 2], "ag": [0, 1, 2], "estim": 0, "attribut": 0, "facilit": [0, 2], "binari": 0, "classif": [0, 1], "being": [0, 1], "male": 0, "femal": 0, "categor": 0, "three": 0, "distinct": 0, "group": 0, "22": 0, "25": 0, "26": 0, "30": 0, "31": 0, "35": 0, "year": 0, "we": [0, 2, 5, 6], "introduc": [0, 2], "four": [0, 2], "name": [0, 1, 2, 5], "hcp": [0, 2], "dynhcp": [0, 1], "under": [0, 2], "thi": [0, 2, 6], "first": 0, "two": [0, 2], "ar": [0, 2], "static": [0, 1, 3], "while": [0, 2], "last": 0, "correspond": [0, 2], "dynam": [0, 1, 3, 5], "decod": 0, "involv": 0, "seven": 0, "task": [0, 1], "emot": 0, "process": [0, 1, 2, 5], "gambl": 0, "languag": 0, "motor": 0, "relat": 0, "social": 0, "work": [0, 2], "memori": [0, 2, 5], "each": [0, 1, 2], "design": 0, "help": 0, "delin": 0, "core": 0, "set": [0, 5], "function": [0, 1, 2, 3, 6], "relev": 0, "differ": 0, "facet": 0, "between": 0, "human": [0, 3], "brain": [0, 1, 6], "behavior": 0, "present": [0, 1, 5], "activ": [0, 6], "represent": [0, 2], "its": 0, "counterpart": 0, "our": [0, 2], "compris": 0, "signific": 0, "list": [0, 1, 2], "sort": 0, "fluid": [0, 2], "intellig": [0, 2], "evalu": 0, "pmat24": 0, "refer": [0, 2], "individu": 0, "": [0, 2], "capac": 0, "temporarili": 0, "hold": [0, 1], "manipul": 0, "inform": 0, "crucial": 0, "aspect": 0, "influenc": 0, "higher": [0, 6], "reason": 0, "comprehens": 0, "learn": [0, 1, 2], "repres": [0, 2], "abil": 0, "solv": 0, "novel": 0, "problem": 0, "independ": 0, "ani": 0, "knowledg": 0, "from": [0, 1, 2, 5, 6], "past": 0, "It": [0, 2], "demonstr": [0, 2], "analyz": 0, "complex": 0, "relationship": 0, "identifi": 0, "pattern": 0, "deriv": [0, 6], "solut": 0, "situat": 0, "predict": 0, "both": [0, 2], "quantifi": 0, "continu": [0, 2], "variabl": 0, "treat": 0, "regress": [0, 1, 6], "aim": 0, "perform": [0, 2], "score": 0, "connectom": [0, 1, 3, 5, 6], "gener": [0, 2], "fi": [0, 1, 2], "wm": [0, 1, 2], "class": [1, 2, 5], "neurographdataset": [1, 3], "root": [1, 2, 5], "str": 1, "transform": [1, 5], "callabl": 1, "none": [1, 2, 5], "pre_transform": [1, 5], "pre_filt": [1, 5], "sourc": [1, 2, 5, 6], "inmemorydataset": [1, 2, 5], "machin": [1, 2], "paper": 1, "five": [1, 2], "demograph": [1, 3], "mental": [1, 3], "state": [1, 2, 3], "cognit": [1, 3], "trait": [1, 3], "see": 1, "document": [1, 2, 4], "github": 1, "more": [1, 6], "detail": 1, "hcpactiv": 1, "7": 1, "443": 1, "hcpgender": [1, 2], "1": [1, 2, 6], "078": 1, "hcpage": [1, 2], "065": 1, "hcpfi": [1, 2], "071": 1, "hcpwm": [1, 2], "arg": [1, 5, 6], "directori": [1, 2], "where": 1, "should": [1, 2], "save": 1, "one": [1, 2], "option": [1, 5, 6], "A": 1, "take": 1, "torch_geometr": 1, "data": [1, 2, 5, 6], "object": [1, 2, 5, 6], "return": [1, 5, 6], "version": 1, "befor": 1, "everi": 1, "access": [1, 2], "default": [1, 2, 5, 6], "disk": 1, "boolean": 1, "valu": 1, "indic": 1, "whether": 1, "final": 1, "download": [1, 3], "self": [1, 2, 5], "raw_dir": 1, "folder": [1, 5], "filenam": 1, "b4g59ibn8itegr0rpcd16m9ajb2qyddf": 1, "zip": 1, "lzzks4472czy9f9vc8aikp7pdbknmtf": 1, "g2md9h9snh7jh6eeay02k1kr9m4ido9f": 1, "r6hlz2arm7yiy6v6981cv2nzq3b0meax": 1, "xtmpa6712fidi94x6kevpsddf9skuoxi": 1, "processed_dir": [1, 5], "properti": [1, 5], "processed_file_nam": [1, 5], "file": [1, 2, 5], "must": [1, 5], "order": [1, 5], "skip": [1, 5], "raw_file_nam": 1, "url": 1, "http": 1, "vanderbilt": 1, "box": 1, "com": 1, "share": 1, "neurographdynam": [1, 2, 3], "e": 1, "g": 1, "pytorch": 1, "geometr": 1, "pyg": [1, 2, 4, 6], "format": [1, 2], "contain": [1, 2], "batch": [1, 2], "dynhcpact": 1, "2so3fnfqakeu6hktz322o3nm2c8ocus7": 1, "dynhcpag": 1, "195f9teg4t4apn6kl6hbc4ib4g9addtq": 1, "dynhcpfi": 1, "un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo": 1, "dynhcpgend": [1, 2], "mj0z6unea34lfz1hkdwsinj7g22yohxn": 1, "dynhcpwm": 1, "mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2": 1, "load_data": 1, "briefli": 2, "fundament": 2, "concept": 2, "through": 2, "close": 2, "therefor": 2, "interest": [2, 5, 6], "reader": 2, "datast": 2, "util": 2, "allow": 2, "easi": 2, "us": [2, 5, 6], "interfac": 2, "appli": 2, "pipelin": [2, 5, 6], "For": [2, 5], "can": [2, 4], "import": 2, "neurographstat": 2, "print": 2, "num_class": 2, "num_featur": 2, "To": [2, 4], "effici": [2, 5], "store": 2, "here": [2, 4], "data_obj": 2, "label": [2, 6], "len": 2, "make": 2, "compat": 2, "bridg": 2, "gap": 2, "betwe": 2, "domain": 2, "offer": 2, "tool": 2, "easili": [2, 4], "construct": [2, 5, 6], "how": 2, "your": 2, "own": 2, "fc": 2, "fmri": [2, 5, 6], "reg": [2, 5, 6], "n_roi": [2, 5, 6], "1000": [2, 5, 6], "could": 2, "numpi": [2, 5, 6], "arrai": [2, 5, 6], "adjac": [2, 5, 6], "matrix": [2, 5, 6], "creat": [2, 6], "functional_connectom": 2, "adj": 2, "construct_adj": [2, 3, 6], "threshold": [2, 5, 6], "5": [2, 6], "construct_data": [2, 3, 6], "correl": [2, 5, 6], "node": [2, 6], "featur": [2, 6], "code": 2, "scan": 2, "regressor": [2, 5, 6], "np": 2, "nilearn": 2, "imag": [2, 5, 6], "load_img": 2, "img": 2, "raw": 2, "nii": [2, 5], "gz": [2, 5], "loadtxt": 2, "txt": 2, "movement": [2, 6], "get_fdata": 2, "100": [2, 5, 6], "torch": 2, "consist": 2, "step": 2, "also": 2, "seper": 2, "parcel": [2, 3, 6], "schaefer": 2, "atla": [2, 5], "y": [2, 5, 6], "remove_drift": [2, 3, 6], "regress_head_mot": [2, 3, 6], "construct_corr": [2, 3, 6], "primari": 2, "explor": 2, "search": [2, 3], "space": 2, "websit": 2, "accept": 2, "usag": 2, "term": 2, "addition": 2, "avail": [2, 4], "aw": 2, "s3": [2, 5], "bucket": 2, "which": 2, "onc": 2, "author": 2, "ha": 2, "been": 2, "obtain": 2, "In": 2, "section": 2, "variou": 2, "you": 2, "crawl": 2, "enabl": 2, "These": 2, "streamlin": 2, "prepar": 2, "further": 2, "analysi": 2, "model": 2, "brain_connectome_rest_download": [2, 3, 5], "boto3": 2, "path_to_data": [2, 5], "n_job": [2, 5], "script": 2, "run": 2, "parallel": 2, "requir": [2, 4], "number": [2, 5, 6], "job": 2, "input": [2, 5], "access_kei": 2, "connectomedb": 2, "credenti": 2, "secret_kei": 2, "client": 2, "aws_access_key_id": 2, "aws_secret_access_kei": 2, "hcp_behavior": 2, "csv": 2, "id": 2, "pkl": 2, "have": 2, "found": 2, "rest_dataset": 2, "note": 2, "separ": 2, "gender_dataset": [2, 3, 5], "age_dataset": [2, 3, 5], "wm_datast": 2, "wm_dataset": [2, 3, 5], "fi_datast": 2, "fi_dataset": [2, 3, 5], "state_dataset": 2, "brain_connectome_state_download": [2, 3, 5], "dataset_nam": [2, 5], "roi": [2, 5, 6], "If": 2, "local": 2, "brain_connectome_rest": [2, 3, 5], "similarli": 2, "brain_connectome_st": [2, 3, 5], "similar": 2, "rest": 2, "ngd": 2, "dyn_prep": [2, 3, 5], "window_s": [2, 5], "50": [2, 5], "stride": [2, 5], "3": [2, 4, 5], "dynamic_length": [2, 5], "form": 2, "fed": 2, "fly": 2, "dyn_obj": 2, "preporcess": 2, "dyn_down_prep": [2, 3, 5], "10": [2, 5], "150": [2, 5], "data_dict": 2, "dictionari": 2, "against": 2, "prprocess": 2, "k": 2, "v": 2, "item": 2, "l": 2, "0": 2, "int": [2, 5, 6], "sub": 2, "d": 2, "new_data": 2, "x": [2, 5, 6], "edge_index": 2, "append": 2, "from_data_list": 2, "instanc": 2, "new_dataset": 2, "2": 2, "ignor": 2, "subject": 2, "36": 2, "some": 2, "remov": [2, 6], "math": 2, "isnan": 2, "introduct": 3, "exampl": 3, "project": 3, "hcp1200": 3, "index": 3, "modul": 3, "page": 3, "python": 4, "pip": 4, "develop": 4, "top": 4, "pleas": 4, "instruct": 4, "construct_adj_postive_perc": 5, "corr": [5, 6], "given": 5, "extract_from_3d_no": 5, "volum": 5, "extract": 5, "time": 5, "seri": 5, "3d": 5, "non": 5, "overlap": 5, "path_to_atla": 5, "path": 5, "path_to_fmri": 5, "output": 5, "get_data_obj": 5, "iid": 5, "behavioral_data": 5, "bucket_nam": 5, "get_data_obj_task": 5, "target_path": 5, "construct_dataset": 5, "get_dynamic_data_object": 5, "process_dynamic_fc": 5, "timeseri": 5, "sampling_init": 5, "self_loop": 5, "true": 5, "matric": 5, "200": [5, 6], "300": [5, 6], "400": [5, 6], "500": [5, 6], "600": [5, 6], "700": [5, 6], "800": [5, 6], "900": [5, 6], "region": [5, 6], "length": 5, "window": 5, "consid": 5, "comput": 5, "whole": 5, "n": 6, "control": 6, "densiti": 6, "denser": 6, "m": 6, "preprocess": 6, "prepfrom": 6, "out": 6, "six": 6, "rigid": 6, "bodi": 6, "head": 6, "motion": 6, "paramet": 6, "along": 6, "scanner": 6, "drift": 6, "signal": 6, "aris": 6, "instrument": 6, "factor": 6, "By": 6, "elimin": 6, "trend": 6, "enhanc": 6, "nois": 6, "ratio": 6, "increas": 6, "sensit": 6, "neural": 6}, "objects": {"NeuroGraph": [[1, 0, 0, "-", "datasets"], [5, 0, 0, "-", "preprocess"], [6, 0, 0, "-", "utils"]], "NeuroGraph.datasets": [[1, 1, 1, "", "NeuroGraphDataset"], [1, 1, 1, "", "NeuroGraphDynamic"]], "NeuroGraph.datasets.NeuroGraphDataset": [[1, 2, 1, "", "download"], [1, 3, 1, "", "filenames"], [1, 2, 1, "", "process"], [1, 4, 1, "", "processed_dir"], [1, 4, 1, "", "processed_file_names"], [1, 4, 1, "", "raw_dir"], [1, 4, 1, "", "raw_file_names"], [1, 3, 1, "", "url"]], "NeuroGraph.datasets.NeuroGraphDynamic": [[1, 2, 1, "", "download"], [1, 3, 1, "", "filenames"], [1, 2, 1, "", "load_data"], [1, 3, 1, "", "url"]], "NeuroGraph.preprocess": [[5, 1, 1, "", "Age_Dataset"], [5, 1, 1, "", "Brain_Connectome_Rest"], [5, 1, 1, "", "Brain_Connectome_Rest_Download"], [5, 1, 1, "", "Brain_Connectome_State"], [5, 1, 1, "", "Brain_Connectome_State_Download"], [5, 1, 1, "", "Dyn_Down_Prep"], [5, 5, 1, "", "Dyn_Prep"], [5, 1, 1, "", "FI_Dataset"], [5, 1, 1, "", "Gender_Dataset"], [5, 1, 1, "", "WM_Dataset"]], "NeuroGraph.preprocess.Age_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_Rest": [[5, 2, 1, "", "construct_adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_Rest_Download": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_State": [[5, 2, 1, "", "construct_adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj_task"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Brain_Connectome_State_Download": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_data_obj_task"], [5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Dyn_Down_Prep": [[5, 2, 1, "", "construct_Adj_postive_perc"], [5, 2, 1, "", "construct_dataset"], [5, 2, 1, "", "extract_from_3d_no"], [5, 2, 1, "", "get_dynamic_data_object"], [5, 2, 1, "", "process_dynamic_fc"]], "NeuroGraph.preprocess.FI_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.Gender_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.preprocess.WM_Dataset": [[5, 2, 1, "", "process"], [5, 4, 1, "", "processed_file_names"]], "NeuroGraph.utils": [[6, 5, 1, "", "construct_adj"], [6, 5, 1, "", "construct_corr"], [6, 5, 1, "", "construct_data"], [6, 5, 1, "", "parcellation"], [6, 5, 1, "", "preprocess"], [6, 5, 1, "", "regress_head_motions"], [6, 5, 1, "", "remove_drifts"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"demograph": 0, "mental": 0, "state": 0, "cognit": 0, "trait": 0, "load": [1, 2, 3], "benchmark": [1, 2, 3], "dataset": [1, 2], "introduct": 2, "exampl": 2, "static": 2, "dynam": 2, "preprocess": [2, 3, 5], "human": 2, "connectom": 2, "project": 2, "hcp1200": 2, "download": 2, "neurograph": [3, 5, 6], "instal": [3, 4], "get": 3, "start": 3, "util": [3, 6], "indic": 3, "tabl": 3, "function": 5}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"Demographics": [[0, "demographics"]], "Mental States": [[0, "mental-states"]], "Cognitive Traits": [[0, "cognitive-traits"]], "Load Benchmark Datasets": [[1, "module-NeuroGraph.datasets"]], "Introduction by Example": [[2, "introduction-by-example"]], "Loading Benchmark datasets": [[2, "loading-benchmark-datasets"]], "Loading Static Benchmarks": [[2, "loading-static-benchmarks"]], "Loading Dynamic Dataset": [[2, "loading-dynamic-dataset"]], "Preprocessing Examples": [[2, "preprocessing-examples"]], "Preprocessing Human Connectome Project (HCP1200) Dataset": [[2, "preprocessing-human-connectome-project-hcp1200-dataset"]], "Download and preprocess static datasets": [[2, "download-and-preprocess-static-datasets"]], "Download and preprocess dynamic datasets": [[2, "download-and-preprocess-dynamic-datasets"]], "NeuroGraph:": [[3, null]], "Installations:": [[3, null]], "GET STARTED:": [[3, null]], "Loading Benchmarks:": [[3, null]], "Preprocessing:": [[3, null]], "Utilities:": [[3, null]], "Indices and tables": [[3, "indices-and-tables"]], "Installation": [[4, "installation"]], "NeuroGraph Preprocessing Functionalities": [[5, "module-NeuroGraph.preprocess"]], "NeuroGraph Utilities": [[6, "module-NeuroGraph.utils"]]}, "indexentries": {"neurograph.datasets": [[1, "module-NeuroGraph.datasets"]], "neurographdataset (class in neurograph.datasets)": [[1, "NeuroGraph.datasets.NeuroGraphDataset"]], "neurographdynamic (class in neurograph.datasets)": [[1, "NeuroGraph.datasets.NeuroGraphDynamic"]], "download() (neurographdataset method)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.download"]], "download() (neurographdynamic method)": [[1, "NeuroGraph.datasets.NeuroGraphDynamic.download"]], "filenames (neurographdataset attribute)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.filenames"]], "filenames (neurographdynamic attribute)": [[1, "NeuroGraph.datasets.NeuroGraphDynamic.filenames"]], "load_data() (neurographdynamic method)": [[1, "NeuroGraph.datasets.NeuroGraphDynamic.load_data"]], "module": [[1, "module-NeuroGraph.datasets"], [5, "module-NeuroGraph.preprocess"], [6, "module-NeuroGraph.utils"]], "process() (neurographdataset method)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.process"]], "processed_dir (neurographdataset property)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.processed_dir"]], "processed_file_names (neurographdataset property)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.processed_file_names"]], "raw_dir (neurographdataset property)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.raw_dir"]], "raw_file_names (neurographdataset property)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.raw_file_names"]], "url (neurographdataset attribute)": [[1, "NeuroGraph.datasets.NeuroGraphDataset.url"]], "url (neurographdynamic attribute)": [[1, "NeuroGraph.datasets.NeuroGraphDynamic.url"]], "age_dataset (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Age_Dataset"]], "brain_connectome_rest (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest"]], "brain_connectome_rest_download (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download"]], "brain_connectome_state (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State"]], "brain_connectome_state_download (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download"]], "dyn_down_prep (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep"]], "dyn_prep() (in module neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Dyn_Prep"]], "fi_dataset (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.FI_Dataset"]], "gender_dataset (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.Gender_Dataset"]], "neurograph.preprocess": [[5, "module-NeuroGraph.preprocess"]], "wm_dataset (class in neurograph.preprocess)": [[5, "NeuroGraph.preprocess.WM_Dataset"]], "construct_adj_postive_perc() (brain_connectome_rest_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download.construct_Adj_postive_perc"]], "construct_adj_postive_perc() (brain_connectome_state_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download.construct_Adj_postive_perc"]], "construct_adj_postive_perc() (dyn_down_prep method)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep.construct_Adj_postive_perc"]], "construct_adj_postive_perc() (brain_connectome_rest method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest.construct_adj_postive_perc"]], "construct_adj_postive_perc() (brain_connectome_state method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State.construct_adj_postive_perc"]], "construct_dataset() (dyn_down_prep method)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep.construct_dataset"]], "extract_from_3d_no() (brain_connectome_rest method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest.extract_from_3d_no"]], "extract_from_3d_no() (brain_connectome_rest_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download.extract_from_3d_no"]], "extract_from_3d_no() (brain_connectome_state method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State.extract_from_3d_no"]], "extract_from_3d_no() (brain_connectome_state_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download.extract_from_3d_no"]], "extract_from_3d_no() (dyn_down_prep method)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep.extract_from_3d_no"]], "get_data_obj() (brain_connectome_rest method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest.get_data_obj"]], "get_data_obj() (brain_connectome_rest_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download.get_data_obj"]], "get_data_obj_task() (brain_connectome_state method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State.get_data_obj_task"]], "get_data_obj_task() (brain_connectome_state_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download.get_data_obj_task"]], "get_dynamic_data_object() (dyn_down_prep method)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep.get_dynamic_data_object"]], "process() (age_dataset method)": [[5, "NeuroGraph.preprocess.Age_Dataset.process"]], "process() (brain_connectome_rest method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest.process"]], "process() (brain_connectome_rest_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download.process"]], "process() (brain_connectome_state method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State.process"]], "process() (brain_connectome_state_download method)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download.process"]], "process() (fi_dataset method)": [[5, "NeuroGraph.preprocess.FI_Dataset.process"]], "process() (gender_dataset method)": [[5, "NeuroGraph.preprocess.Gender_Dataset.process"]], "process() (wm_dataset method)": [[5, "NeuroGraph.preprocess.WM_Dataset.process"]], "process_dynamic_fc() (dyn_down_prep method)": [[5, "NeuroGraph.preprocess.Dyn_Down_Prep.process_dynamic_fc"]], "processed_file_names (age_dataset property)": [[5, "NeuroGraph.preprocess.Age_Dataset.processed_file_names"]], "processed_file_names (brain_connectome_rest property)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest.processed_file_names"]], "processed_file_names (brain_connectome_rest_download property)": [[5, "NeuroGraph.preprocess.Brain_Connectome_Rest_Download.processed_file_names"]], "processed_file_names (brain_connectome_state property)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State.processed_file_names"]], "processed_file_names (brain_connectome_state_download property)": [[5, "NeuroGraph.preprocess.Brain_Connectome_State_Download.processed_file_names"]], "processed_file_names (fi_dataset property)": [[5, "NeuroGraph.preprocess.FI_Dataset.processed_file_names"]], "processed_file_names (gender_dataset property)": [[5, "NeuroGraph.preprocess.Gender_Dataset.processed_file_names"]], "processed_file_names (wm_dataset property)": [[5, "NeuroGraph.preprocess.WM_Dataset.processed_file_names"]], "neurograph.utils": [[6, "module-NeuroGraph.utils"]], "construct_adj() (in module neurograph.utils)": [[6, "NeuroGraph.utils.construct_adj"]], "construct_corr() (in module neurograph.utils)": [[6, "NeuroGraph.utils.construct_corr"]], "construct_data() (in module neurograph.utils)": [[6, "NeuroGraph.utils.construct_data"]], "parcellation() (in module neurograph.utils)": [[6, "NeuroGraph.utils.parcellation"]], "preprocess() (in module neurograph.utils)": [[6, "NeuroGraph.utils.preprocess"]], "regress_head_motions() (in module neurograph.utils)": [[6, "NeuroGraph.utils.regress_head_motions"]], "remove_drifts() (in module neurograph.utils)": [[6, "NeuroGraph.utils.remove_drifts"]]}}) \ No newline at end of file diff --git a/doc/_build/html/utils.html b/doc/_build/html/utils.html index 8143527..cbe0cf7 100644 --- a/doc/_build/html/utils.html +++ b/doc/_build/html/utils.html @@ -11,11 +11,9 @@ - - - - - + + + @@ -67,7 +65,16 @@

        Utilities:

        @@ -95,10 +102,10 @@
        -

        NeuroGraph Utilities

        +

        NeuroGraph Utilities

        -construct_adj(corr, threshold=5)[source]
        +construct_adj(corr, threshold=5)[source]

        create adjacency matrix from functional connectome matrix

        Args:

        corr (n x n numpy matrix): functional connectome matrix

        @@ -108,7 +115,7 @@
        -construct_corr(m)[source]
        +construct_corr(m)[source]

        This function construct correlation matrix from the preprocessed fmri matrix Args.

        m (numpy array): a preprocessed numpy matrix @@ -117,7 +124,7 @@

        -construct_data(corr, label, threshold=5)[source]
        +construct_data(corr, label, threshold=5)[source]

        create pyg data object from functional connectome matrix. We use correlation as node features Args:

        corr (n x n numpy matrix): functional connectome matrix

        @@ -127,7 +134,7 @@
        -parcellation(fmri, n_rois=1000)[source]
        +parcellation(fmri, n_rois=1000)[source]

        Prepfrom brain parcellation

        Args:

        fmri (numpy array): fmri image @@ -137,7 +144,7 @@

        -preprocess(fmri, regs, n_rois=1000)[source]
        +preprocess(fmri, regs, n_rois=1000)[source]

        Preprocess fMRI data using NeuroGraph preprocessing pipeline

        Args:

        fmri (numpy array): fmri image @@ -148,7 +155,7 @@

        -regress_head_motions(Y, regs)[source]
        +regress_head_motions(Y, regs)[source]

        This function regress out six rigid- body head motion parameters, along with their derivatives, from the fMRI data

        Args: Y (numpy array)): fmri image @@ -157,7 +164,7 @@

        -remove_drifts(Y)[source]
        +remove_drifts(Y)[source]

        This function removes the scanner drifts in the fMRI signals that arise from instrumental factors. By eliminating these trends, we enhance the signal-to-noise ratio and increase the sensitivity to neural activity.

        diff --git a/doc/get_started.rst b/doc/get_started.rst index e1f8284..1074b9d 100644 --- a/doc/get_started.rst +++ b/doc/get_started.rst @@ -20,7 +20,7 @@ NeuroGraph utilizes the `PyG` `InMemoryDataset` class to facilitate the loading from NeuroGraph.datasets import NeuroGraphStatic - dataset = NeuroGraphStatic(root="data/", name= "HCP-Gender") + dataset = NeuroGraphStatic(root="data/", name= "HCPGender") print(dataset.num_classes) print(dataset.num_features) @@ -37,7 +37,7 @@ To efficiently store and utilize the dynamic datasets in `PyG`` Batch format, we from NeuroGraph.datasets import NeuroGraphDynamic - data_obj = NeuroGraphDynamic(root="data/", dataset_name= "DynHCP-Gender") + data_obj = NeuroGraphDynamic(root="data/", name= "DynHCPGender") dataset = data_obj.dataset labels = data_obj.labels print(len(dataset), len(labels)) diff --git a/setup.py b/setup.py index 5235d80..709d7a2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='NeuroGraph', - version='2.2.0', + version='2.3.0', description='A Python package for graph-based neuroimaging benchmarks and tools', author='Anwar Said', author_email='',