antspymm 1.3.7__tar.gz → 1.3.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {antspymm-1.3.7/antspymm.egg-info → antspymm-1.3.9}/PKG-INFO +1 -1
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm/mm.py +35 -4
- {antspymm-1.3.7 → antspymm-1.3.9/antspymm.egg-info}/PKG-INFO +1 -1
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm.egg-info/SOURCES.txt +17 -17
- {antspymm-1.3.7 → antspymm-1.3.9}/pyproject.toml +1 -1
- antspymm-1.3.9/tests/test_reference_run.py +20 -0
- antspymm-1.3.7/tests/test_00_setup.py +0 -7
- {antspymm-1.3.7 → antspymm-1.3.9}/LICENSE +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/MANIFEST.in +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/README.md +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm/__init__.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm.egg-info/dependency_links.txt +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm.egg-info/requires.txt +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/antspymm.egg-info/top_level.txt +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/adni_rsfmri_2_nrg_conversion.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/antspymm_data_dictionary.csv +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/bids_cohort_example.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/blind_qc.Rmd +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/blind_qc.html +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/convert_adni_dti_to_nrg.R +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/deepnbm.jpg +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/example_antspymm_output.csv +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/example_run_from_directory.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/make_dict_table.Rmd +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/make_dict_table.html +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/nrg_cohort_example.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/ptbp_nrg.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/roi_visualization.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/roi_visualization_ppmi.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/step1_blind_qc.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/step2_outlierness.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/step3_mm_nrg_csv.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/step4_aggregate.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/ukbb_to_nrg_processing.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/docs/ukbb_to_nrg_processing2.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/setup.cfg +0 -0
- /antspymm-1.3.7/tests/test_bids_2_nrg.py → /antspymm-1.3.9/tests/bids_2_nrg.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/blind_qc.py +0 -0
- /antspymm-1.3.7/tests/test_deformation_gradient_reo.py → /antspymm-1.3.9/tests/deformation_gradient_reo.py +0 -0
- /antspymm-1.3.7/tests/test_dti_recon.py → /antspymm-1.3.9/tests/dti_recon.py +0 -0
- /antspymm-1.3.7/tests/test_dti_reg.py → /antspymm-1.3.9/tests/dti_reg.py +0 -0
- /antspymm-1.3.7/tests/test_dwi_rebasing.py → /antspymm-1.3.9/tests/dwi_rebasing.py +0 -0
- /antspymm-1.3.7/tests/test_dwi_run.py → /antspymm-1.3.9/tests/dwi_run.py +0 -0
- /antspymm-1.3.7/tests/test_dwi_run_ptbp_scrub.py → /antspymm-1.3.9/tests/dwi_run_ptbp_scrub.py +0 -0
- /antspymm-1.3.7/tests/test_flair_run.py → /antspymm-1.3.9/tests/flair_run.py +0 -0
- /antspymm-1.3.7/tests/test_joint_dti_recon.py → /antspymm-1.3.9/tests/joint_dti_recon.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/mm.py +0 -0
- /antspymm-1.3.7/tests/test_mm_csv.py → /antspymm-1.3.9/tests/mm_csv.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/mm_nrg.py +0 -0
- /antspymm-1.3.7/tests/test_nrg_validation.py → /antspymm-1.3.9/tests/nrg_validation.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/outlierness.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/parallel_study_aggregation_example.py +0 -0
- /antspymm-1.3.7/tests/test_perfusion_ptbp.py → /antspymm-1.3.9/tests/perfusion_ptbp.py +0 -0
- /antspymm-1.3.7/tests/test_perfusion_run.py → /antspymm-1.3.9/tests/perfusion_run.py +0 -0
- /antspymm-1.3.7/tests/test_rsfmri_run.py → /antspymm-1.3.9/tests/rsfmri_run.py +0 -0
- /antspymm-1.3.7/tests/test_rsfmri_run_minimal.py → /antspymm-1.3.9/tests/rsfmri_run_minimal.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/testsr.py +0 -0
- /antspymm-1.3.7/tests/test_ukbb_rsfmri.py → /antspymm-1.3.9/tests/ukbb_rsfmri.py +0 -0
- {antspymm-1.3.7 → antspymm-1.3.9}/tests/visualize_tractogram.py +0 -0
@@ -5017,8 +5017,6 @@ def neuromelanin( list_nm_images, t1, t1_head, t1lab, brain_stem_dilation=8,
|
|
5017
5017
|
nmdf_wide = antspyt1w.merge_hierarchical_csvs_to_wide_format(
|
5018
5018
|
{'NM' : nmdf},
|
5019
5019
|
col_names = ['Mean'] )
|
5020
|
-
if verbose:
|
5021
|
-
print( "nm done" )
|
5022
5020
|
|
5023
5021
|
rr_mask = ants.mask_image( labels2nm, labels2nm, [33,34] , binarize=True )
|
5024
5022
|
sn_mask = ants.mask_image( labels2nm, labels2nm, [7,9,23,25] , binarize=True )
|
@@ -5028,7 +5026,8 @@ def neuromelanin( list_nm_images, t1, t1_head, t1lab, brain_stem_dilation=8,
|
|
5028
5026
|
rravg = nm_avg_cropped[ rr_mask == 1].mean()
|
5029
5027
|
snstd = nm_avg_cropped[ sn_mask == 1].std()
|
5030
5028
|
rrstd = nm_avg_cropped[ rr_mask == 1].std()
|
5031
|
-
|
5029
|
+
vol_element = np.prod( ants.get_spacing(sn_mask) )
|
5030
|
+
snvol = vol_element * sn_mask.sum()
|
5032
5031
|
|
5033
5032
|
# get the mean voxel position of the SN
|
5034
5033
|
if snvol > 0:
|
@@ -5037,7 +5036,34 @@ def neuromelanin( list_nm_images, t1, t1_head, t1lab, brain_stem_dilation=8,
|
|
5037
5036
|
else:
|
5038
5037
|
sn_z = math.nan
|
5039
5038
|
|
5040
|
-
nm_evr =
|
5039
|
+
nm_evr = 0.0
|
5040
|
+
if cropper2nm.sum() > 0:
|
5041
|
+
nm_evr = antspyt1w.patch_eigenvalue_ratio( nm_avg, 512, [6,6,6],
|
5042
|
+
evdepth = 0.9, mask=cropper2nm )
|
5043
|
+
|
5044
|
+
simg = ants.smooth_image( nm_avg_cropped, np.min(ants.get_spacing(nm_avg_cropped)) )
|
5045
|
+
k = 2.0
|
5046
|
+
rrthresh = (rravg + k * rrstd)
|
5047
|
+
nmabovekthresh_mask = sn_mask * ants.threshold_image( simg, rrthresh, math.inf)
|
5048
|
+
snvolabovethresh = vol_element * nmabovekthresh_mask.sum()
|
5049
|
+
snintmeanabovethresh = float( ( simg * nmabovekthresh_mask ).mean() )
|
5050
|
+
snintsumabovethresh = float( ( simg * nmabovekthresh_mask ).sum() )
|
5051
|
+
|
5052
|
+
k = 3.0
|
5053
|
+
rrthresh = (rravg + k * rrstd)
|
5054
|
+
nmabovekthresh_mask3 = sn_mask * ants.threshold_image( simg, rrthresh, math.inf)
|
5055
|
+
snvolabovethresh3 = vol_element * nmabovekthresh_mask3.sum()
|
5056
|
+
|
5057
|
+
k = 4.0
|
5058
|
+
rrthresh = (rravg + k * rrstd)
|
5059
|
+
nmabovekthresh_mask4 = sn_mask * ants.threshold_image( simg, rrthresh, math.inf)
|
5060
|
+
snvolabovethresh4 = vol_element * nmabovekthresh_mask4.sum()
|
5061
|
+
|
5062
|
+
if verbose:
|
5063
|
+
print( "nm vol @2std above rrmean: " + str( snvolabovethresh ) )
|
5064
|
+
print( "nm intmean @2std above rrmean: " + str( snintmeanabovethresh ) )
|
5065
|
+
print( "nm intsum @2std above rrmean: " + str( snintsumabovethresh ) )
|
5066
|
+
print( "nm done" )
|
5041
5067
|
|
5042
5068
|
return{
|
5043
5069
|
'NM_avg' : nm_avg,
|
@@ -5053,6 +5079,11 @@ def neuromelanin( list_nm_images, t1, t1_head, t1lab, brain_stem_dilation=8,
|
|
5053
5079
|
'NM_avg_substantianigra' : snavg,
|
5054
5080
|
'NM_std_substantianigra' : snstd,
|
5055
5081
|
'NM_volume_substantianigra' : snvol,
|
5082
|
+
'NM_volume_substantianigra_2std' : snvolabovethresh,
|
5083
|
+
'NM_intmean_substantianigra_2std' : snintmeanabovethresh,
|
5084
|
+
'NM_intsum_substantianigra_2std' : snintsumabovethresh,
|
5085
|
+
'NM_volume_substantianigra_3std' : snvolabovethresh3,
|
5086
|
+
'NM_volume_substantianigra_4std' : snvolabovethresh4,
|
5056
5087
|
'NM_avg_refregion' : rravg,
|
5057
5088
|
'NM_std_refregion' : rrstd,
|
5058
5089
|
'NM_min' : nm_avg_cropped.min(),
|
@@ -30,27 +30,27 @@ docs/step3_mm_nrg_csv.py
|
|
30
30
|
docs/step4_aggregate.py
|
31
31
|
docs/ukbb_to_nrg_processing.py
|
32
32
|
docs/ukbb_to_nrg_processing2.py
|
33
|
+
tests/bids_2_nrg.py
|
33
34
|
tests/blind_qc.py
|
35
|
+
tests/deformation_gradient_reo.py
|
36
|
+
tests/dti_recon.py
|
37
|
+
tests/dti_reg.py
|
38
|
+
tests/dwi_rebasing.py
|
39
|
+
tests/dwi_run.py
|
40
|
+
tests/dwi_run_ptbp_scrub.py
|
41
|
+
tests/flair_run.py
|
42
|
+
tests/joint_dti_recon.py
|
34
43
|
tests/mm.py
|
44
|
+
tests/mm_csv.py
|
35
45
|
tests/mm_nrg.py
|
46
|
+
tests/nrg_validation.py
|
36
47
|
tests/outlierness.py
|
37
48
|
tests/parallel_study_aggregation_example.py
|
38
|
-
tests/
|
39
|
-
tests/
|
40
|
-
tests/
|
41
|
-
tests/
|
42
|
-
tests/
|
43
|
-
tests/test_dwi_rebasing.py
|
44
|
-
tests/test_dwi_run.py
|
45
|
-
tests/test_dwi_run_ptbp_scrub.py
|
46
|
-
tests/test_flair_run.py
|
47
|
-
tests/test_joint_dti_recon.py
|
48
|
-
tests/test_mm_csv.py
|
49
|
-
tests/test_nrg_validation.py
|
50
|
-
tests/test_perfusion_ptbp.py
|
51
|
-
tests/test_perfusion_run.py
|
52
|
-
tests/test_rsfmri_run.py
|
53
|
-
tests/test_rsfmri_run_minimal.py
|
54
|
-
tests/test_ukbb_rsfmri.py
|
49
|
+
tests/perfusion_ptbp.py
|
50
|
+
tests/perfusion_run.py
|
51
|
+
tests/rsfmri_run.py
|
52
|
+
tests/rsfmri_run_minimal.py
|
53
|
+
tests/test_reference_run.py
|
55
54
|
tests/testsr.py
|
55
|
+
tests/ukbb_rsfmri.py
|
56
56
|
tests/visualize_tractogram.py
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import sys, os
|
2
|
+
import unittest
|
3
|
+
os.environ["TF_NUM_INTEROP_THREADS"] = "8"
|
4
|
+
os.environ["TF_NUM_INTRAOP_THREADS"] = "8"
|
5
|
+
os.environ["ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS"] = "8"
|
6
|
+
import tempfile
|
7
|
+
import shutil
|
8
|
+
import antspyt1w
|
9
|
+
import antspynet
|
10
|
+
import antspymm
|
11
|
+
import ants
|
12
|
+
import re
|
13
|
+
import pandas as pd
|
14
|
+
# just test that things loaded ok
|
15
|
+
if os.getenv('CI') == 'true' and os.getenv('CIRCLECI') == 'true':
|
16
|
+
def test_simple():
|
17
|
+
assert os.getenv('CI') == 'true' and os.getenv('CIRCLECI') == 'true'
|
18
|
+
else:
|
19
|
+
def test_simple():
|
20
|
+
assert os.getenv('CI') != 'true' and os.getenv('CIRCLECI') != 'true'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/antspymm-1.3.7/tests/test_dwi_run_ptbp_scrub.py → /antspymm-1.3.9/tests/dwi_run_ptbp_scrub.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/antspymm-1.3.7/tests/test_rsfmri_run_minimal.py → /antspymm-1.3.9/tests/rsfmri_run_minimal.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|