Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate CIFTI and TSV versions of coverage, timeseries, and correlation files #785

Merged
merged 43 commits into from
Feb 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0d13045
Start working on it.
tsalo Feb 1, 2023
4c96db8
Use correlations tsv in matrix_plot.
tsalo Feb 2, 2023
5513894
Update connectivity.py
tsalo Feb 2, 2023
484036d
Fix things.
tsalo Feb 2, 2023
c7f148a
Something like this?
tsalo Feb 2, 2023
24dde5a
Fix iterfields.
tsalo Feb 2, 2023
0a69fb5
Add node label files.
tsalo Feb 2, 2023
dbf68ff
Fix bug maybe.
tsalo Feb 2, 2023
606fca1
Update connectivity.py
tsalo Feb 2, 2023
4953609
blahblah
tsalo Feb 2, 2023
c9e1b12
Fix the coverage file bug.
tsalo Feb 3, 2023
754c37e
Add min_coverage input.
tsalo Feb 3, 2023
89f7239
Link to Software Support NeuroStars category.
tsalo Feb 3, 2023
cd80dca
Fix things more?
tsalo Feb 3, 2023
2f3d88e
Update tests.
tsalo Feb 3, 2023
395ba3e
Fix list of outputs.
tsalo Feb 3, 2023
9231050
Get the test passing.
tsalo Feb 3, 2023
b15a5f9
Remove unused CiftiCorrelation interface.
tsalo Feb 3, 2023
7e7f691
Update workbench.py
tsalo Feb 3, 2023
3b3d92d
Fix up NiftiConnect.
tsalo Feb 3, 2023
09c0d38
Fix.
tsalo Feb 3, 2023
7e155d0
Don't expect concatenated timeseries tsv files.
tsalo Feb 4, 2023
5944a0c
Check coverage array.
tsalo Feb 4, 2023
e9c0b3c
Fix test.
tsalo Feb 4, 2023
ee084ee
Update test_workflows_connectivity.py
tsalo Feb 4, 2023
0ef155e
Update.
tsalo Feb 4, 2023
1c3d3c0
Use n/a instead of NaN.
tsalo Feb 4, 2023
8af63a3
Hahahahahahaha I fixed the bug!
tsalo Feb 5, 2023
f66d519
Update test_workflows_connectivity.py
tsalo Feb 5, 2023
d6e7973
Fix test.
tsalo Feb 5, 2023
072e94e
Add tests for utils.atlas module.
tsalo Feb 6, 2023
57b2a51
Address review.
tsalo Feb 6, 2023
246b646
Merge remote-tracking branch 'upstream/main' into write-out-everything
tsalo Feb 7, 2023
9d05b01
Update cifti.py
tsalo Feb 7, 2023
ce59537
I got the dims mixed up.
tsalo Feb 7, 2023
08fe0c9
Merge branch 'main' into write-out-everything
tsalo Feb 7, 2023
d4c9e85
Merge remote-tracking branch 'upstream/main' into write-out-everything
tsalo Feb 7, 2023
9d0ac4b
Round coverage values.
tsalo Feb 7, 2023
cd4e099
No need to round.
tsalo Feb 8, 2023
7aba0c5
Merge remote-tracking branch 'upstream/main' into write-out-everything
tsalo Feb 8, 2023
f9c1c29
Merge remote-tracking branch 'upstream/main' into write-out-everything
tsalo Feb 12, 2023
8f10f6a
Merge remote-tracking branch 'upstream/main' into write-out-everything
tsalo Feb 16, 2023
c9244d0
Merge branch 'main' into write-out-everything
tsalo Feb 21, 2023
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
Prev Previous commit
Next Next commit
Update test_workflows_connectivity.py
tsalo committed Feb 4, 2023
commit ee084eeb66e9da3e246815f290f72db900c0576f
6 changes: 3 additions & 3 deletions xcp_d/tests/test_workflows_connectivity.py
Original file line number Diff line number Diff line change
@@ -73,15 +73,15 @@ def test_nifti_conn(fmriprep_with_freesurfer_data, tmp_path_factory):
coverage_arr = pd.read_table(coverage, index_col="Node").to_numpy()
correlations_arr = pd.read_table(correlations, index_col="Node").to_numpy()
assert correlations_arr.shape == (1000, 1000)
available_parcels = np.where(~np.isnan(np.diag(correlations_arr)))[0]
available_parcels = np.where(np.squeeze(coverage_arr) > 0)[0]

# Parcels with <50% coverage should have NaNs
assert np.array_equal(np.squeeze(coverage_arr) < 0.5, np.isnan(np.diag(correlations_arr)))

# Drop missing parcels (there are 34 for the 1000parcel )
correlations_arr = correlations_arr[available_parcels, :]
correlations_arr = correlations_arr[:, available_parcels]
assert correlations_arr.shape == (966, 966)
assert correlations_arr.shape == (998, 998)

# Now let's get the ground truth. First, we should locate the atlas
atlas_file = os.path.join(
@@ -103,7 +103,7 @@ def test_nifti_conn(fmriprep_with_freesurfer_data, tmp_path_factory):

# The "ground truth" matrix
calculated_correlations = np.corrcoef(signals.T)
assert calculated_correlations.shape == (966, 966)
assert calculated_correlations.shape == (998, 998)

# If we replace the bad parcels' results in the "ground truth" matrix with NaNs,
# the resulting matrix should match the workflow-generated one.