Skip to content

Commit 660487a

Browse files
committed
build(deps): update README.md and create requirements.txt
1 parent 9e7c4b3 commit 660487a

File tree

2 files changed

+84
-2
lines changed

2 files changed

+84
-2
lines changed

README.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,76 @@
1+
![](https://github.com/chadHGY/CAM/blob/gh-pages/static/images/flowchart.png)
2+
3+
# CAM: Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping
4+
5+
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/chadHGY/CAM?include_prereleases)
6+
![GitHub last commit](https://img.shields.io/github/last-commit/chadHGY/CAM)
7+
![GitHub pull requests](https://img.shields.io/github/issues-pr/chadHGY/CAM)
8+
![GitHub](https://img.shields.io/github/license/chadHGY/CAM)
9+
![contributors](https://img.shields.io/github/contributors/chadHGY/CAM)
10+
![codesize](https://img.shields.io/github/languages/code-size/chadHGY/CAM)
11+
12+
[Update 2024/05/29] Training / Inference code will be available soon.
13+
14+
15+
Official PyTorch Implementation for the [Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping](https://arxiv.org/abs/2312.02762).
16+
117
# CAM
2-
Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping.
18+
A new **Self-Supervised** framework designed for **Unsupervised Anomaly Detection** of brain disorders using **3D cortical surface features**.
19+
20+
# Getting Started
21+
22+
## Setup
23+
1. Clone the repo:
24+
```bash
25+
git clone [email protected]:chadHGY/CAM.git
26+
cd CAM
27+
```
28+
29+
2. Install the required packages:
30+
```bash
31+
conda create -n cam python=3.10
32+
conda activate cam
33+
pip install -r requirements.txt
34+
```
35+
36+
3. Data Preprocessing:
37+
Please make sure you have gone through [FreeSurfer's](https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all) `recon-all pipeline` to extract the cortical surface features. The surface features should be found under each subject's `surf` directory.
38+
39+
40+
4. Data Postprocessing:
41+
Here we provide a simple script to convert the surface features to a numpy array.
42+
```bash
43+
python data_postprocessing.py --data_dir /path/to/your/freesurfer/output --output_dir /path/to/your/postprocessed/data
44+
```
45+
46+
47+
# Data
48+
To easily demonstrate the usage of CAM, we provide a toy dataset in the `data` directory. The toy dataset contains 10 subjects, each with 3 cortical surface features extracted by FreeSurfer (Thickness, Sulc, Curvature).
49+
50+
51+
# Training
52+
```bash
53+
python src/train.py --data_dir /path/to/your/postprocessed/data --output_dir /path/to/your/output
54+
```
55+
56+
# Inference
57+
```bash
58+
python src/inference.py --data_dir /path/to/your/postprocessed/data --output_dir /path/to/your/output
59+
```
60+
61+
62+
# Citation
63+
If you find this repository useful for your research, please use the following.
64+
```
65+
@article{yang2023learning,
66+
title={Learning Cortical Anomaly through Masked Encoding for Unsupervised Heterogeneity Mapping},
67+
author={Yang, Hao-Chun and Andreassen, Ole and Westlye, Lars Tjelta and Marquand, Andre F and Beckmann, Christian F and Wolfers, Thomas},
68+
journal={arXiv preprint arXiv:2312.02762},
69+
year={2023}
70+
}
71+
```
72+
373

4-
Training / Inference code will be available soon.
74+
# Acknowledgments/References
75+
1. IXI data: https://brain-development.org/ixi-dataset/
76+
3. We would like to thank all participants in this study, making the work possible. This work was supported the German Research Foundation (DFG) Emmy Noether with reference 513851350 (TW), the Cluster of Excellence with reference 390727645 (TW) and the BMBF-funded de.NBI Cloud within the German Network for Bioinformatics Infrastructure (de.NBI) (031A532B, 031A533A, 031A533B, 031A534A, 031A535A, 031A537A, 031A537B, 031A537C, 031A537D, 031A538A).

requirements.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# --------- pytorch --------- #
2+
torch
3+
4+
# --------- data science --------- #
5+
matplotlib
6+
7+
# --------- utils --------- #
8+
tqdm
9+
ipykernel
10+
ipywidgets

0 commit comments

Comments
 (0)