antspymm 1.3.6__py3-none-any.whl → 1.3.8__py3-none-any.whl

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/mm.py CHANGED
@@ -154,11 +154,11 @@ def version( ):
154
154
  """
155
155
  import pkg_resources
156
156
  return {
157
- 'tensorflow': pkg_resources.require("tensorflow")[0].version,
158
- 'antspyx': pkg_resources.require("antspyx")[0].version,
159
- 'antspynet': pkg_resources.require("antspynet")[0].version,
160
- 'antspyt1w': pkg_resources.require("antspyt1w")[0].version,
161
- 'antspymm': pkg_resources.require("antspymm")[0].version
157
+ 'tensorflow': pkg_resources.get_distribution("tensorflow").version,
158
+ 'antspyx': pkg_resources.get_distribution("antspyx").version,
159
+ 'antspynet': pkg_resources.get_distribution("antspynet").version,
160
+ 'antspyt1w': pkg_resources.get_distribution("antspyt1w").version,
161
+ 'antspymm': pkg_resources.get_distribution("antspymm").version
162
162
  }
163
163
 
164
164
  def nrg_filename_to_subjectvisit(s, separator='-'):
@@ -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
- snvol = np.prod( ants.get_spacing(sn_mask) ) * sn_mask.sum()
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,24 @@ 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 = antspyt1w.patch_eigenvalue_ratio( nm_avg, 512, [6,6,6], evdepth = 0.9, mask=cropper2nm )
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 = ( simg * nmabovekthresh_mask ).mean()
5050
+ snintsumabovethresh = ( simg * nmabovekthresh_mask ).sum()
5051
+
5052
+ if verbose:
5053
+ print( "nm vol @2std above rrmean: " + str( snvolabovethresh ) )
5054
+ print( "nm intmean @2std above rrmean: " + str( snintmeanabovethresh ) )
5055
+ print( "nm intsum @2std above rrmean: " + str( snintsumabovethresh ) )
5056
+ print( "nm done" )
5041
5057
 
5042
5058
  return{
5043
5059
  'NM_avg' : nm_avg,
@@ -5053,6 +5069,9 @@ def neuromelanin( list_nm_images, t1, t1_head, t1lab, brain_stem_dilation=8,
5053
5069
  'NM_avg_substantianigra' : snavg,
5054
5070
  'NM_std_substantianigra' : snstd,
5055
5071
  'NM_volume_substantianigra' : snvol,
5072
+ 'NM_volume_substantianigra_above_k_thresh' : snvolabovethresh,
5073
+ 'NM_intmean_substantianigra_above_k_thresh' : snintmeanabovethresh,
5074
+ 'NM_intsum_substantianigra_above_k_thresh' : snintsumabovethresh,
5056
5075
  'NM_avg_refregion' : rravg,
5057
5076
  'NM_std_refregion' : rrstd,
5058
5077
  'NM_min' : nm_avg_cropped.min(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: antspymm
3
- Version: 1.3.6
3
+ Version: 1.3.8
4
4
  Summary: multi-channel/time-series medical image processing with antspyx
5
5
  Author-email: "Avants, Gosselin, Tustison, Reardon" <stnava@gmail.com>
6
6
  License: Apache 2.0
@@ -10,8 +10,8 @@ License-File: LICENSE
10
10
  Requires-Dist: h5py >=2.10.0
11
11
  Requires-Dist: numpy >=1.19.4
12
12
  Requires-Dist: pandas >=1.0.1
13
- Requires-Dist: antspyx
14
- Requires-Dist: antspynet >=0.2.5
13
+ Requires-Dist: antspyx >=0.4.2
14
+ Requires-Dist: antspynet >=0.2.8
15
15
  Requires-Dist: antspyt1w >=0.9.3
16
16
  Requires-Dist: pathlib
17
17
  Requires-Dist: dipy
@@ -22,6 +22,8 @@ Requires-Dist: scikit-learn
22
22
 
23
23
  # ANTsPyMM
24
24
 
25
+ [![CircleCI](https://dl.circleci.com/status-badge/img/gh/ANTsX/ANTsPyMM/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/ANTsX/ANTsPyMM/tree/main)
26
+
25
27
  ![mapping](https://i.imgur.com/qKqYjU9.jpeg)
26
28
 
27
29
  ## processing utilities for timeseries/multichannel images - mostly neuroimaging
@@ -0,0 +1,7 @@
1
+ antspymm/__init__.py,sha256=1fHqufHndrkJwz473av8qOf5-1xm5r-aKHuMAETGIiE,4462
2
+ antspymm/mm.py,sha256=72293DXAlbeKXj75j5d_SYeiH2uKK9-XnpZh6YLIpwY,480752
3
+ antspymm-1.3.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
+ antspymm-1.3.8.dist-info/METADATA,sha256=P1Q9RDLvhqAQalZfVewHpbbvTPzsYBo91cTpBtGrOSw,14866
5
+ antspymm-1.3.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ antspymm-1.3.8.dist-info/top_level.txt,sha256=iyD1sRhCKzfwKRJLq5ZUeV9xsv1cGQl8Ejp6QwXM1Zg,9
7
+ antspymm-1.3.8.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- antspymm/__init__.py,sha256=1fHqufHndrkJwz473av8qOf5-1xm5r-aKHuMAETGIiE,4462
2
- antspymm/mm.py,sha256=4g15BkmRyIn-ZTB7DOT9ggTDt-Ma3be44zKpCTALikY,479806
3
- antspymm-1.3.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
4
- antspymm-1.3.6.dist-info/METADATA,sha256=CRZs-L_1fv4rQPaKsMDPK0_9SHr6BLEyieHo30fLctw,14684
5
- antspymm-1.3.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- antspymm-1.3.6.dist-info/top_level.txt,sha256=iyD1sRhCKzfwKRJLq5ZUeV9xsv1cGQl8Ejp6QwXM1Zg,9
7
- antspymm-1.3.6.dist-info/RECORD,,