Skip to content

Commit

Permalink
updated figures/notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBowring committed Jun 11, 2021
1 parent ec6731d commit 93f5da3
Show file tree
Hide file tree
Showing 22 changed files with 479 additions and 199 deletions.
Binary file modified figures/All_comparison_figures.pdf
Binary file not shown.
Binary file modified figures/ds001_AFNI_FSL/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_AFNI_FSL/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_AFNI_FSL_comparisons.pdf
Binary file not shown.
Binary file modified figures/ds001_SPM_FSL/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_SPM_FSL/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_SPM_FSL_comparisons.pdf
Binary file not shown.
490 changes: 365 additions & 125 deletions figures/ds001_notebook.ipynb

Large diffs are not rendered by default.

Binary file modified figures/ds001_permutation_AFNI_FSL/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_permutation_AFNI_FSL/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_permutation_AFNI_FSL_comparisons.pdf
Binary file not shown.
Binary file modified figures/ds001_permutation_SPM_FSL/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_permutation_SPM_FSL/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/ds001_permutation_SPM_FSL_comparisons.pdf
Binary file not shown.
Binary file modified figures/ds109_AFNI_FSL_comparisons.pdf
Binary file not shown.
Binary file modified figures/ds109_SPM_FSL_comparisons.pdf
Binary file not shown.
133 changes: 73 additions & 60 deletions figures/ds109_notebook.ipynb

Large diffs are not rendered by default.

Binary file modified figures/ds109_permutation_AFNI_FSL_comparisons.pdf
Binary file not shown.
Binary file modified figures/ds109_permutation_SPM_FSL_comparisons.pdf
Binary file not shown.
30 changes: 16 additions & 14 deletions figures/ds120_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 2,
"metadata": {
"scrolled": false
},
Expand Down Expand Up @@ -67,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -76,7 +76,7 @@
"'./input/ds120/spm_afni_subject_level_mask.nii.gz'"
]
},
"execution_count": 33,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -192,7 +192,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -214,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -249,7 +249,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -335,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -367,7 +367,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -402,13 +402,15 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"pixdim[1,2,3] should be positive; setting to abs of pixdim values\n",
"pixdim[1,2,3] should be positive; setting to abs of pixdim values\n",
"/Users/maullz/Desktop/SC2/figures/lib/bland_altman.py:98: RuntimeWarning: invalid value encountered in greater_equal\n",
" white_matter_mask = white_matter >= 0.5\n",
"/Users/maullz/Desktop/SC2/figures/lib/bland_altman.py:100: RuntimeWarning: invalid value encountered in greater_equal\n",
Expand Down Expand Up @@ -447,7 +449,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand All @@ -471,7 +473,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -495,7 +497,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -544,7 +546,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
"version": "3.6.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 2 additions & 0 deletions figures/lib/consensus_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def consensus_analysis(t_stat_maps, N, study, max_activation, x_coords, y_coord
tdata = timg.get_fdata()[:, :, :, 0]
threshdata = (pdata > 0.95)*tdata
threshimg = nibabel.Nifti1Image(np.nan_to_num(threshdata), affine=timg.affine)
thresimg_file = threshimg.to_filename('./img/' + study + '_consensus_t_thresholded.nii.gz')

pmap_neg = os.path.join('img', study + '_consensus_1-fdr_neg.nii.gz')
tmap_neg = os.path.join('img', study + '_consensus_t_neg.nii.gz')
Expand All @@ -180,6 +181,7 @@ def consensus_analysis(t_stat_maps, N, study, max_activation, x_coords, y_coord
tdata_neg = timg_neg.get_fdata()[:, :, :, 0]
threshdata_neg = (pdata_neg > 0.95)*tdata_neg
threshimg_neg = nibabel.Nifti1Image(np.nan_to_num(threshdata_neg), affine=timg_neg.affine)
threshimg_neg_file = threshimg_neg.to_filename('./img/' + study + '_consensus_t_neg_thresholded.nii.gz')


# Combine activations and deactivations in a single image
Expand Down
23 changes: 23 additions & 0 deletions figures/lib/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ def download_data(nv_collection, study, output_dir):
# ds120 uses F-stats no T-stats
(('Positive_clustered_t_stat.nii.gz', 'afni_exc_set_pos.nii.gz'),) +
(('3dMEMA_result_t_stat_masked.nii.gz', 'afni_stat.nii.gz'),))
if study not in ('ds109'):
# We also need to download the 'old' results for ds001
afni_images = (
afni_images +
# There is no deactivations in ds120 with AFNI
(('Negative_clustered_t_stat_1.nii.gz', 'old_afni_exc_set_neg.nii.gz'),) +
# ds120 uses F-stats no T-stats
(('Positive_clustered_t_stat_1.nii.gz', 'old_afni_exc_set_pos.nii.gz'),) +
(('3dMEMA_result_t_stat_masked_1.nii.gz', 'old_afni_stat.nii.gz'),) +
(('mask_1.nii.gz', 'old_afni_mask.nii.gz'),))
else:
# ds120 uses F-stats no T-stats
afni_images = (
Expand Down Expand Up @@ -143,6 +153,18 @@ def download_data(nv_collection, study, output_dir):
('05FWECorrected_OneSampT_pos_exc_set_6.nii.gz', 'fsl_spm_subject_level_perm_exc_set_pos.nii.gz'),
('05FWECorrected_OneSampT_neg_exc_set_6.nii.gz', 'fsl_spm_subject_level_perm_exc_set_neg.nii.gz'),
)
if study not in ('ds109'):
# Download 'old' ds001 results
perm_images = ( perm_images +
(('perm_ttest++_Clustsim_result_t_stat_masked_1.nii.gz', 'old_afni_perm.nii.gz'),) +
(('perm_Positive_clustered_t_stat_1.nii.gz', 'old_afni_perm_exc_set_pos.nii.gz'),) +
(('perm_Negative_clustered_t_stat_1.nii.gz', 'old_afni_perm_exc_set_neg.nii.gz'),) +
(('OneSampT_tstat1_7.nii.gz', 'old_fsl_perm.nii.gz'),) +
(('05FWECorrected_OneSampT_pos_exc_set_7.nii.gz', 'old_fsl_perm_exc_set_pos.nii.gz'),) +
(('05FWECorrected_OneSampT_neg_exc_set_7.nii.gz', 'old_fsl_perm_exc_set_neg.nii.gz'),) +
(('snpmT%2B_1.nii.gz', 'old_spm_perm.nii.gz'),) +
(('SnPM_pos_filtered_1.nii.gz', 'old_spm_perm_exc_set_pos.nii.gz'),) +
(('SnPM_neg_filtered_1.nii.gz', 'old_spm_perm_exc_set_neg.nii.gz'),))
else:
# No permutation analyses for ds120
perm_images = ()
Expand Down Expand Up @@ -173,6 +195,7 @@ def download_data(nv_collection, study, output_dir):

to_download = (
afni_images + perm_images)
print(to_download)

for image, local_name in to_download:
url = "http://neurovault.org/media/images/" + nv_collection + '/' + image
Expand Down

0 comments on commit 93f5da3

Please sign in to comment.