Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
435 commits
Select commit Hold shift + click to select a range
28069e0
minor change
mtorabi59 Jan 9, 2025
954d17b
improve report
mtorabi59 Jan 9, 2025
d0b7ebb
change font in report to bold
mtorabi59 Jan 10, 2025
adac72b
minor
mtorabi59 Jan 10, 2025
e4ea01d
add across_dataset analysis
mtorabi59 Feb 5, 2025
8dd73b0
Merge remote-tracking branch 'upstream/main' into task_dFC
mtorabi59 Feb 5, 2025
837b4af
add other classification acc metrics
mtorabi59 Feb 5, 2025
7c8a1c9
minor
mtorabi59 Feb 10, 2025
c776946
Merge branch 'main' into task_dFC
mtorabi59 Mar 4, 2025
5fab560
update across_dataset
mtorabi59 Mar 11, 2025
ac0dab3
add affinity mat to across_dataset
mtorabi59 Mar 11, 2025
60d6eae
test glasso
mtorabi59 Apr 1, 2025
4fcda4b
change the glasso back
mtorabi59 Apr 9, 2025
ad962f7
add binarizing_method shift
mtorabi59 Apr 30, 2025
971a1ff
update report gen
mtorabi59 May 2, 2025
0e14030
use bold.json in fmriprep root
mtorabi59 May 2, 2025
0cb1b02
change data loader to catch a bug
mtorabi59 May 2, 2025
e8a0700
minor change in run_fmriprep
mtorabi59 May 6, 2025
59e7da3
minor
mtorabi59 May 6, 2025
aad52f0
improve procrustes
mtorabi59 May 14, 2025
c057c47
fix bug in find_available_subjects
mtorabi59 May 16, 2025
d588a43
implement SVM_classify
mtorabi59 May 16, 2025
1dff794
modify SVC
mtorabi59 May 21, 2025
56c3adb
replace KNN with SVM
mtorabi59 May 22, 2025
324fef7
Merge remote-tracking branch 'origin/main' into task_dFC
mtorabi59 May 22, 2025
be3cae1
add clstr_distance to methods_config
mtorabi59 May 22, 2025
c067737
introduce extract_abs_task_presence
mtorabi59 May 23, 2025
402e54b
add SI to ML_scores
mtorabi59 May 24, 2025
1da218f
update report
mtorabi59 May 26, 2025
02e0fc8
add SI to report
mtorabi59 May 26, 2025
b85eff2
minor
mtorabi59 May 26, 2025
5a7683e
fix bug
mtorabi59 May 26, 2025
806e81e
refactor ml_utils
mtorabi59 May 27, 2025
2759e26
minor
mtorabi59 May 27, 2025
7d3b3e5
update report
mtorabi59 May 27, 2025
6faf567
group_permutation
mtorabi59 May 28, 2025
cbed638
change cv of logreg and svm to StratifiedGroupKFold
mtorabi59 May 28, 2025
67535fc
minor
mtorabi59 May 31, 2025
ba93c1d
fix bug in ml_utils
mtorabi59 Jun 2, 2025
297ee30
refactor simul_utils
mtorabi59 Jun 13, 2025
2f9a5a7
task_data_simulator reads tasks_info from json
mtorabi59 Jun 13, 2025
616de06
add GMM task presence
mtorabi59 Jun 21, 2025
ea3adf7
minor
mtorabi59 Jun 21, 2025
1a1095c
fix bug
mtorabi59 Jun 21, 2025
3912ee2
update task presence in report
mtorabi59 Jun 21, 2025
59876d9
minor
mtorabi59 Jun 21, 2025
9e8cfe9
add fallback_threshold to GMM
mtorabi59 Jun 21, 2025
119ed98
add LE_transform_dFC
mtorabi59 Jun 24, 2025
f72c8ce
minor fix
mtorabi59 Jun 26, 2025
0f02d71
switch to "concat+embed" for state-based
mtorabi59 Jun 26, 2025
29a9ece
minor
mtorabi59 Jun 26, 2025
9b5f901
minor
mtorabi59 Jun 26, 2025
839acef
Merge branch 'main' into task_dFC
mtorabi59 Jun 27, 2025
3826f1f
show kept TRs for report
mtorabi59 Jun 27, 2025
4017283
alter_hparams in FCS estimate
mtorabi59 Jul 1, 2025
8a22980
add W to SW name in ML
mtorabi59 Jul 1, 2025
7e6edb7
minor bug
mtorabi59 Jul 1, 2025
d04cf90
Merge branch 'main' into task_dFC
mtorabi59 Jul 2, 2025
26ba000
Merge branch 'main' into task_dFC
mtorabi59 Jul 4, 2025
2ad0ebe
Merge branch 'main' into task_dFC
mtorabi59 Jul 4, 2025
7732a03
use FCS_proba as features for SB methods
mtorabi59 Jul 7, 2025
623ebc3
parallel run_classification
mtorabi59 Jul 7, 2025
65bab30
minor
mtorabi59 Jul 8, 2025
0f70a0d
add FCS_proba_for_SB
mtorabi59 Jul 9, 2025
99244db
Merge branch 'main' into task_dFC
mtorabi59 Jul 10, 2025
fbbda11
minor fix in SI_ID
mtorabi59 Jul 11, 2025
336486d
minor
mtorabi59 Jul 11, 2025
763ef92
minor
mtorabi59 Jul 11, 2025
45b848b
minor
mtorabi59 Jul 11, 2025
0c01445
randomize struct conn and increase noise in simul
mtorabi59 Jul 11, 2025
796a895
minor
mtorabi59 Jul 11, 2025
ad4f206
minor
mtorabi59 Jul 11, 2025
e5a60fb
Merge branch 'main' into task_dFC
mtorabi59 Jul 17, 2025
d475670
minor in FCS
mtorabi59 Jul 25, 2025
37a8559
Merge branch 'main' into task_dFC
mtorabi59 Jul 25, 2025
30009c4
update hyperparams
mtorabi59 Jul 29, 2025
5dc2141
improve GMM and fix calc_task_duration
mtorabi59 Jul 29, 2025
b40215e
minor in GMM
mtorabi59 Jul 29, 2025
48ce13b
minor
mtorabi59 Jul 30, 2025
ada54e4
fix SI_ID
mtorabi59 Jul 30, 2025
4297309
fix SI_ID
mtorabi59 Jul 30, 2025
c6cb9e6
include rs in nifti2roi
mtorabi59 Jul 30, 2025
c1b2b5d
remove run_clustering_for_visual and run_task_features_extraction fro…
mtorabi59 Aug 7, 2025
4d4c4d8
optimize ML code
mtorabi59 Aug 21, 2025
08e07d6
remove permut tests from ML
mtorabi59 Aug 23, 2025
e8bae52
fix bug
mtorabi59 Aug 23, 2025
19cab30
fix error when num classes = 1
mtorabi59 Aug 24, 2025
2f2c3f1
minor check_count -= 1
mtorabi59 Aug 29, 2025
0fa5133
add process_SB_features with ILR
mtorabi59 Aug 31, 2025
3e0a085
ILR on WL
mtorabi59 Sep 1, 2025
023a436
add cohen d
mtorabi59 Sep 10, 2025
dc9716c
correct TR_array in task_presence
mtorabi59 Sep 10, 2025
7fbdd15
change back TR_array in task_presence
mtorabi59 Sep 10, 2025
4567a9e
change calc_rest_duration and calc_task_duration
mtorabi59 Sep 24, 2025
e2db813
minor
mtorabi59 Sep 24, 2025
1617d43
minor
mtorabi59 Sep 24, 2025
5f1ddf7
add across dataset scripts
mtorabi59 Oct 15, 2025
7aa52f5
minor fix
mtorabi59 Oct 16, 2025
bd4766f
fix minor
mtorabi59 Oct 16, 2025
342e3e3
minor fix
mtorabi59 Oct 16, 2025
70b665b
minor fix
mtorabi59 Oct 16, 2025
297a93b
minor fix
mtorabi59 Oct 17, 2025
791b904
improve sample matrix visualization
mtorabi59 Oct 22, 2025
d302a41
minor
mtorabi59 Oct 22, 2025
6af5cf5
minor
mtorabi59 Oct 22, 2025
f4d39ec
improve run_across_dataset_analysis.sh
mtorabi59 Oct 24, 2025
5132e44
modify across run heatmap
mtorabi59 Oct 31, 2025
72e0432
minor
mtorabi59 Oct 31, 2025
5ba0c8e
minor
mtorabi59 Oct 31, 2025
5103681
bug in ml_results
mtorabi59 Nov 10, 2025
daac328
add performance_predict
mtorabi59 Nov 10, 2025
9e0154a
minor
mtorabi59 Nov 10, 2025
bd3a8d6
add readme for task dFC
mtorabi59 Nov 14, 2025
6129d92
minor
mtorabi59 Nov 14, 2025
34d3d47
minor editing
mtorabi59 Nov 14, 2025
ea9047e
minor
mtorabi59 Nov 14, 2025
e609759
minor
mtorabi59 Nov 14, 2025
2467894
improve sample matrix visual
mtorabi59 Nov 20, 2025
6c9fb9c
minor
mtorabi59 Nov 20, 2025
42d0164
fix minor
mtorabi59 Nov 20, 2025
8519d71
minor
mtorabi59 Nov 20, 2025
7169f8b
minor
mtorabi59 Nov 21, 2025
8ac153e
minor
mtorabi59 Nov 21, 2025
f2119f9
minor
mtorabi59 Nov 21, 2025
756b04d
modify fonts
mtorabi59 Nov 21, 2025
29ddaf5
minor
mtorabi59 Nov 21, 2025
af15727
improve figures
mtorabi59 Nov 21, 2025
02d075f
minor
mtorabi59 Nov 21, 2025
c223b2e
minor
mtorabi59 Nov 21, 2025
67704d9
add periodicity_index and optimality_index
mtorabi59 Nov 25, 2025
3de514e
minor
mtorabi59 Nov 26, 2025
a9c63b4
minor
mtorabi59 Nov 26, 2025
419ef3f
normalize OI
mtorabi59 Nov 26, 2025
87435ae
minor
mtorabi59 Nov 27, 2025
8ccbe25
minor
mtorabi59 Nov 27, 2025
25ef679
add PAC
mtorabi59 Nov 27, 2025
aa85e13
bug fix
mtorabi59 Nov 27, 2025
dc72d9c
minor
mtorabi59 Nov 27, 2025
eae402a
add rest and task durations original
mtorabi59 Nov 27, 2025
3dbb63b
minor
mtorabi59 Nov 28, 2025
5063050
add pattern distinctiveness
mtorabi59 Dec 1, 2025
5dfa77c
boost other_class_max_corr
mtorabi59 Dec 2, 2025
34619f4
improve other_class_max_corr and nearest_neighbor_match
mtorabi59 Dec 3, 2025
1377737
minor
mtorabi59 Dec 3, 2025
be9b9d3
minor
mtorabi59 Dec 3, 2025
f2fcd0c
modify cog domains
mtorabi59 Dec 4, 2025
0b64b4e
minor
mtorabi59 Dec 4, 2025
368c17e
minor
mtorabi59 Dec 4, 2025
11993fa
minor
mtorabi59 Dec 4, 2025
f700285
improve LE embed visual
mtorabi59 Dec 10, 2025
92477c1
minor
mtorabi59 Dec 10, 2025
b23b334
use cosine for other_class_max_corr
mtorabi59 Dec 11, 2025
8e912b7
add ldc_crossvalidated for sample specificity
mtorabi59 Dec 11, 2025
85bce17
minor
mtorabi59 Dec 12, 2025
c7c9ed1
minor
mtorabi59 Dec 15, 2025
2151ff9
minor
mtorabi59 Dec 16, 2025
f1fee1c
Merge branch 'main' into task_dFC
mtorabi59 Dec 16, 2025
25276e7
make FCS estimate parallel
mtorabi59 Dec 16, 2025
cec3281
Merge branch 'main' into task_dFC
mtorabi59 Dec 16, 2025
b3b868f
Merge branch 'main' into task_dFC
mtorabi59 Dec 17, 2025
b38c743
minor fix
mtorabi59 Dec 17, 2025
4896a22
Merge branch 'main' into task_dFC
mtorabi59 Dec 19, 2025
8dde436
minor
mtorabi59 Dec 19, 2025
c45e5a6
Merge branch 'main' into task_dFC
mtorabi59 Jan 9, 2026
03b7ac3
minor
mtorabi59 Jan 10, 2026
dbaf4b4
minor cleaning
mtorabi59 Jan 16, 2026
d6a16a0
Merge branch 'main' into task_dFC
mtorabi59 Jan 20, 2026
3e39e30
add denoising_strategy as an arg for nifti_to_roi
mtorabi59 Jan 20, 2026
320adc1
add DENOISING_STRATEGY to run_nifti_to_roi.sh
mtorabi59 Jan 20, 2026
de04e52
Merge branch 'main' into task_dFC
mtorabi59 Jan 23, 2026
e38f8bd
add PLS
mtorabi59 Jan 24, 2026
b1255c8
minor
mtorabi59 Jan 25, 2026
96eb979
add contunous y support in embedding
mtorabi59 Jan 25, 2026
5e9426a
add real for cohensd.py
mtorabi59 Jan 28, 2026
9c3ccea
add procrustes_limit and n_neighbors_upper limit
mtorabi59 Jan 28, 2026
f329170
add localPCA
mtorabi59 Jan 29, 2026
e9f84b2
PLS PCA and LE for embed
mtorabi59 Jan 29, 2026
e5fb0f5
remove some datasets
mtorabi59 Feb 2, 2026
1be479c
minor
mtorabi59 Feb 2, 2026
6ad1475
add PLS to ml_results
mtorabi59 Feb 6, 2026
8d67c90
minor
mtorabi59 Feb 6, 2026
e47a42f
temporary
mtorabi59 Feb 8, 2026
4787068
update KNN_classify
mtorabi59 Feb 10, 2026
db0bdfe
standardize before PCA and PLS, rank_norm change
mtorabi59 Feb 13, 2026
6af24d5
improve errors in LE
mtorabi59 Feb 13, 2026
2933522
minor
mtorabi59 Feb 13, 2026
1783303
minor
mtorabi59 Feb 13, 2026
e67ba04
remove CIC from analysis
mtorabi59 Feb 14, 2026
8e76e96
put embedding in CV
mtorabi59 Feb 24, 2026
bbc1fd0
add ts2vec
mtorabi59 Feb 24, 2026
c38648c
finish putting embed in CV
mtorabi59 Feb 24, 2026
138b6ce
minor
mtorabi59 Feb 25, 2026
1936ab0
minor bug
mtorabi59 Feb 25, 2026
67cd516
minor bug
mtorabi59 Feb 25, 2026
9aaaab9
Merge branch 'main' into task_dFC
mtorabi59 Mar 1, 2026
2ba8ab5
remove LE from ml_results
mtorabi59 Mar 1, 2026
831954f
minor n_jobs
mtorabi59 Mar 1, 2026
c38bcd6
minor
mtorabi59 Mar 2, 2026
628eefa
important changes in normalization
mtorabi59 Mar 2, 2026
c5ea8db
refactor ml_results
mtorabi59 Mar 11, 2026
0384a20
remove legend ml_results
mtorabi59 Mar 11, 2026
0ae81a4
minor
mtorabi59 Mar 11, 2026
378cfe2
minor
mtorabi59 Mar 11, 2026
d0a9fc1
minor
mtorabi59 Mar 11, 2026
57f2068
minor
mtorabi59 Mar 11, 2026
a82cb6c
update cohensd script
mtorabi59 Mar 12, 2026
ccb695d
bug fix
mtorabi59 Mar 12, 2026
5ae1436
update task_timing_stats
mtorabi59 Mar 12, 2026
a0cff35
add performance_factor.py
mtorabi59 Mar 13, 2026
b7de7a0
minor
mtorabi59 Mar 14, 2026
a17dfd0
bug fix
mtorabi59 Mar 14, 2026
6471b60
add tsnr to performance_factor
mtorabi59 Mar 14, 2026
8275a21
add perf_factor corr plot
mtorabi59 Mar 14, 2026
f9104b5
add rdoc plot
mtorabi59 Mar 14, 2026
0c0b6db
add Top-vs-bottom performance profile plot
mtorabi59 Mar 14, 2026
9c86168
minor
mtorabi59 Mar 14, 2026
5559b24
minor
mtorabi59 Mar 14, 2026
6ff0c14
RDoC ratio plot
mtorabi59 Mar 14, 2026
f2d784b
adjust RDoC figure sizes
mtorabi59 Mar 14, 2026
b92f926
change EXP ids
mtorabi59 Mar 18, 2026
7c4f04c
minor
mtorabi59 Mar 18, 2026
e19ef8c
improvements in ml_results
mtorabi59 Mar 19, 2026
beb4d83
Merge branch 'main' into task_dFC
mtorabi59 Mar 19, 2026
1685cab
add optimality index
mtorabi59 Mar 22, 2026
fc7dd8a
change task paradigm to experiment name in visualizations
mtorabi59 Mar 22, 2026
c232ae4
minor in OI
mtorabi59 Mar 22, 2026
992a4d5
don'r clip OI_norm
mtorabi59 Mar 22, 2026
0ab6b46
correct OI
mtorabi59 Mar 22, 2026
75aabcc
improve OI
mtorabi59 Mar 23, 2026
50bb99f
correct OI
mtorabi59 Mar 23, 2026
2a7dcaf
Merge remote-tracking branch 'upstream/main' into task_dFC
mtorabi59 Apr 1, 2026
973b0af
add tsnr script
mtorabi59 Apr 11, 2026
66fc9a2
fix bug
mtorabi59 Apr 12, 2026
e808c01
update embed visual to include PCA and PLS
mtorabi59 Apr 12, 2026
3248d7e
minor
mtorabi59 Apr 12, 2026
b00d58f
update sample_matrix_visual to use PLS
mtorabi59 Apr 12, 2026
f7501f3
fix bug
mtorabi59 Apr 12, 2026
9c947b6
improve performance_factor visualization
mtorabi59 Apr 15, 2026
25161ad
minor fix
mtorabi59 Apr 15, 2026
2ee236f
minor improvement
mtorabi59 Apr 15, 2026
29de31c
change session handling in load_TS
mtorabi59 Apr 24, 2026
50fb71b
Merge branch 'main' of https://github.com/mtorabi59/dFC
mtorabi59 Apr 24, 2026
1a3bd87
Merge branch 'main' into task_dFC
mtorabi59 Apr 24, 2026
73cae4c
float32 for saving dFC in dFC_assessment.py
mtorabi59 Apr 25, 2026
6f721a8
improve measure handling in ml_utils
mtorabi59 Apr 26, 2026
f8e5b04
minor change in dfc_visualization
mtorabi59 Apr 27, 2026
ef0223e
improve cohensd supp figure
mtorabi59 Jun 10, 2026
af302d6
improve cohensd boxplot
mtorabi59 Jun 11, 2026
f485826
convert run scripts to templates for publication
mtorabi59 Jun 11, 2026
edcfab3
minor
mtorabi59 Jun 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ignore =
E731,
E713,
E714,
E722,
E741,
F403,
F405,
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
args: [--toml, pyproject.toml]
args: [--toml, pyproject.toml, -L, whis]
additional_dependencies: [tomli]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
Expand Down
2 changes: 2 additions & 0 deletions pydfc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@
"dfc_methods",
"dfc_utils",
"comparison",
"task_utils",
"simul_utils",
]
76 changes: 41 additions & 35 deletions pydfc/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,63 +527,69 @@ def multi_nifti2timeseries(
def load_TS(
data_root,
file_name,
SESSIONs,
subj_id2load=None,
task=None,
session=None,
run=None,
):
"""
load a TIME_SERIES object from a .npy file
if SESSIONs is a list, it will load all the sessions,
if it is a string, it will load that session
if subj_id2load is None, it will load all the subjects
file_name: name of the file to load
format example: {subj_id}_{task}_{run}_time-series.npy
format example: {subj_id}_{session}_{task}_{run}_time-series.npy
(keep the {} for the variables)
"""
# check if SESSIONs is a list or a string
flag = False
if type(SESSIONs) is str:
SESSIONs = [SESSIONs]
flag = True

if subj_id2load is None:
SUBJECTS = find_subj_list(data_root)
else:
assert "sub-" in subj_id2load, "subj_id2load must start with 'sub-'"
SUBJECTS = [subj_id2load]

TS = {}
for session in SESSIONs:
TS[session] = None
for subj in SUBJECTS:
subj_fldr = subj
# make the file_name
TS_file = deepcopy(file_name)
if "{subj_id}" in file_name:
TS_file = TS_file.replace("{subj_id}", subj)
if "{task}" in file_name:
assert task is not None, "task must be provided"
TS_file = TS_file.replace("{task}", task)
if "{run}" in file_name:
assert run is not None, "run must be provided"
TS_file = TS_file.replace("{run}", run)

try:
TS = None
for subj in SUBJECTS:
subj_fldr = subj
# make the file_name
TS_file = deepcopy(file_name)
if "{subj_id}" in file_name:
TS_file = TS_file.replace("{subj_id}", subj)
if "{task}" in file_name:
assert task is not None, "task must be provided"
TS_file = TS_file.replace("{task}", task)
if "{session}" in file_name:
assert session is not None, "session must be provided"
TS_file = TS_file.replace("{session}", session)
if "{run}" in file_name:
assert run is not None, "run must be provided"
TS_file = TS_file.replace("{run}", run)

try:
if session is None:
time_series = np.load(
f"{data_root}/{subj_fldr}/{TS_file}", allow_pickle="True"
).item()
except FileNotFoundError:
print(f"File {TS_file} not found for {subj}")
continue

if TS[session] is None:
TS[session] = time_series
else:
TS[session].concat_ts(time_series)
time_series = np.load(
f"{data_root}/{subj_fldr}/{session}/{TS_file}",
allow_pickle="True",
).item()
except FileNotFoundError:
print(f"File {TS_file} not found for {subj}")
continue

if TS is None:
TS = time_series
else:
try:
TS.concat_ts(time_series)
except AssertionError as e:
# print the error message
print(f"Error in concatenating time series for {subj}: {e}")
# raise error with a message and stop the program
raise Exception(
f"Fs of subj {subj} TS is {time_series.Fs} while the group Fs is {TS.Fs}"
)

if flag:
return TS[SESSIONs[0]]
return TS


Expand Down
Loading
Loading