antspymm 1.4.1__py3-none-any.whl → 1.4.3__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 +42 -1
- {antspymm-1.4.1.dist-info → antspymm-1.4.3.dist-info}/METADATA +8 -2
- antspymm-1.4.3.dist-info/RECORD +7 -0
- {antspymm-1.4.1.dist-info → antspymm-1.4.3.dist-info}/WHEEL +1 -1
- antspymm-1.4.1.dist-info/RECORD +0 -7
- {antspymm-1.4.1.dist-info → antspymm-1.4.3.dist-info}/LICENSE +0 -0
- {antspymm-1.4.1.dist-info → antspymm-1.4.3.dist-info}/top_level.txt +0 -0
antspymm/mm.py
CHANGED
@@ -2707,7 +2707,7 @@ def template_figure_with_overlay(scalar_label_df, prefix, outputfilename=None, t
|
|
2707
2707
|
toviz = temp['overlay']
|
2708
2708
|
return { "underlay": seggm, 'overlay': toviz, 'seg': tcrop }
|
2709
2709
|
|
2710
|
-
def get_data( name=None, force_download=False, version=
|
2710
|
+
def get_data( name=None, force_download=False, version=25, target_extension='.csv' ):
|
2711
2711
|
"""
|
2712
2712
|
Get ANTsPyMM data filename
|
2713
2713
|
|
@@ -2738,11 +2738,47 @@ def get_data( name=None, force_download=False, version=24, target_extension='.cs
|
|
2738
2738
|
"""
|
2739
2739
|
os.makedirs(DATA_PATH, exist_ok=True)
|
2740
2740
|
|
2741
|
+
def mv_subfolder_files(folder, verbose=False):
|
2742
|
+
"""
|
2743
|
+
Move files from subfolders to the parent folder.
|
2744
|
+
|
2745
|
+
Parameters
|
2746
|
+
----------
|
2747
|
+
folder : str
|
2748
|
+
Path to the folder.
|
2749
|
+
verbose : bool, optional
|
2750
|
+
Print information about the files and folders being processed (default is False).
|
2751
|
+
|
2752
|
+
Returns
|
2753
|
+
-------
|
2754
|
+
None
|
2755
|
+
"""
|
2756
|
+
import os
|
2757
|
+
import shutil
|
2758
|
+
for root, dirs, files in os.walk(folder):
|
2759
|
+
if verbose:
|
2760
|
+
print(f"Processing directory: {root}")
|
2761
|
+
print(f"Subdirectories: {dirs}")
|
2762
|
+
print(f"Files: {files}")
|
2763
|
+
|
2764
|
+
for file in files:
|
2765
|
+
if root != folder:
|
2766
|
+
if verbose:
|
2767
|
+
print(f"Moving file: {file} from {root} to {folder}")
|
2768
|
+
shutil.move(os.path.join(root, file), folder)
|
2769
|
+
|
2770
|
+
for dir in dirs:
|
2771
|
+
if root != folder:
|
2772
|
+
if verbose:
|
2773
|
+
print(f"Removing directory: {dir} from {root}")
|
2774
|
+
shutil.rmtree(os.path.join(root, dir))
|
2775
|
+
|
2741
2776
|
def download_data( version ):
|
2742
2777
|
url = "https://figshare.com/ndownloader/articles/16912366/versions/" + str(version)
|
2743
2778
|
target_file_name = "16912366.zip"
|
2744
2779
|
target_file_name_path = tf.keras.utils.get_file(target_file_name, url,
|
2745
2780
|
cache_subdir=DATA_PATH, extract = True )
|
2781
|
+
mv_subfolder_files( os.path.expanduser("~/.antspymm"), False )
|
2746
2782
|
os.remove( DATA_PATH + target_file_name )
|
2747
2783
|
|
2748
2784
|
if force_download:
|
@@ -2762,6 +2798,7 @@ def get_data( name=None, force_download=False, version=24, target_extension='.cs
|
|
2762
2798
|
fname = os.path.join(DATA_PATH, fname)
|
2763
2799
|
files.append(fname)
|
2764
2800
|
|
2801
|
+
|
2765
2802
|
if name == 'all':
|
2766
2803
|
return files
|
2767
2804
|
|
@@ -10899,6 +10936,7 @@ def brainmap_figure(statistical_df, data_dictionary, output_prefix, brain_image,
|
|
10899
10936
|
anatsear=re.sub("sup.cerebellar.peduncle","sup.cereb.ped",anatsear)
|
10900
10937
|
anatsear=re.sub("inferior.cerebellar.peduncle","inf.cereb.ped",anatsear)
|
10901
10938
|
anatsear=re.sub(".crossing.tract.a.part.of.mcp.","",anatsear)
|
10939
|
+
anatsear=re.sub(".crossing.tract.a.part.of.","",anatsear)
|
10902
10940
|
anatsear=re.sub(".column.and.body.of.fornix.","",anatsear)
|
10903
10941
|
anatsear=re.sub("fronto.occipital.fasciculus.could.be.a.part.of.ant.internal.capsule","frnt.occ",anatsear)
|
10904
10942
|
anatsear=re.sub("inferior.fronto.occipital.fasciculus.could.be.a.part.of.anterior.internal.capsule","inf.frnt.occ",anatsear)
|
@@ -10914,6 +10952,9 @@ def brainmap_figure(statistical_df, data_dictionary, output_prefix, brain_image,
|
|
10914
10952
|
anatsear=re.sub("mtg.sn.snr",".snr.",anatsear)
|
10915
10953
|
anatsear=re.sub("anterior.","ant.",anatsear)
|
10916
10954
|
anatsear=re.sub("rsf.","",anatsear)
|
10955
|
+
anatsear=re.sub("fcnxpro122.","",anatsear)
|
10956
|
+
anatsear=re.sub("fcnxpro129.","",anatsear)
|
10957
|
+
anatsear=re.sub("fcnxpro134.","",anatsear)
|
10917
10958
|
anatsear=re.sub("ant.corona.radiata","ant.cor.rad",anatsear)
|
10918
10959
|
anatsear=re.sub("sup.corona.radiata","sup.cor.rad",anatsear)
|
10919
10960
|
anatsear=re.sub("posterior.thalamic.radiation.include.optic.radiation","post.thalamic.radiation",anatsear)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: antspymm
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.3
|
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
|
@@ -138,7 +138,13 @@ Diffusion processing. ANTsPyMM couples the ANTsX toolkit with the Diffusion Ima
|
|
138
138
|
<details>
|
139
139
|
<summary>Resting-state fMRI</summary>
|
140
140
|
|
141
|
-
|
141
|
+
The rsfMRI processing computes a robust summary of resting-state fMRI time series data and corrects for motion artifacts, extracts temporal statistics, and computes functional connectivity across the brain. The analysis pipeline incorporates advanced techniques for noise reduction, temporal derivative calculation, signal standardization, and the calculation of functional connectivity between brain regions using Yeo homotopic labels. This provides researchers with cleaned, standardized, and biologically meaningful data for further analysis of brain network activity.
|
142
|
+
|
143
|
+
Several preprocessing steps are included in the ANTsPyMM processing of resting state fMRI (rsfMRI) data. First, motion correction is used to align the time series to a series specific fMRI template. Distortion correction to t1 is also performed along with brain extraction. The **temporal derivative** is calculated to quantify changes over time in the signal, followed by the **temporal standard deviation (tSTD)**, which computes the variability across time for each voxel. This is done to identify regions of interest with significant signal variation. The **CompCor matrix** [1](https://pubmed.ncbi.nlm.nih.gov/17560126/) is computed using temporal standard deviation thresholds, which helps remove noise by identifying high-variance regions. Additionally, **motion correction** is a central part of the pipeline, where metrics like framewise displacement (FD) and motion-induced signal changes (DVARS) are calculated to detect and correct for artifacts caused by subject movement. **Bandpass filtering** is applied to focus the analysis on brain signals within specific frequency ranges, and **censoring** is used to exclude high-motion time points from the analysis, ensuring cleaner data. The preprocessing concludes with the calculation of **summary statistics**, including measures of signal-to-noise ratio (SNR) and motion effects, which are compiled into a dictionary for further use.
|
144
|
+
|
145
|
+
The next step in the pipeline involves computing functional connectivity through **correlation matrices** based on the **Yeo homotopic labels**, which group brain regions into homotopic (mirrored) areas across hemispheres. Time series data are averaged within each Yeo-labeled region, and pairwise **correlation matrices** are computed to assess the functional connectivity both within and between brain hemispheres. This allows for an in-depth analysis of large-scale brain networks, including symmetrical interactions between homotopic regions and connectivity within networks such as the default mode network, visual network, and others.
|
146
|
+
|
147
|
+
This provides a comprehensive framework for preprocessing resting-state fMRI data and analyzing functional connectivity across the brain. By combining robust noise reduction, motion correction, and correlation matrix computation, the pipeline ensures that the resulting data are suitable for high-quality research into brain network dynamics and resting-state connectivity. Through the use of Yeo homotopic labels and functional correlation matrices, the code offers a valuable tool for investigating symmetrical brain activity and network interactions in fMRI studies. By default, three different sets of processing parameters are employed. These were chosen based on an empirical evaluation of reproducibility in a traveling participant cohort.
|
142
148
|
|
143
149
|
</details>
|
144
150
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
antspymm/__init__.py,sha256=qUzRd3GmYB8hSO7GNaBuP7Jlm0QNMttTaUfvIpeeAig,4497
|
2
|
+
antspymm/mm.py,sha256=2X6zZaERE8tPbzkcyNGD8vIZcpA1T3ej24_jGOnESRA,504283
|
3
|
+
antspymm-1.4.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
|
+
antspymm-1.4.3.dist-info/METADATA,sha256=YSSsqoF26p_IVPzEtiShVaNwBc5Bue3FPfZY6iVaCnY,25668
|
5
|
+
antspymm-1.4.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
6
|
+
antspymm-1.4.3.dist-info/top_level.txt,sha256=iyD1sRhCKzfwKRJLq5ZUeV9xsv1cGQl8Ejp6QwXM1Zg,9
|
7
|
+
antspymm-1.4.3.dist-info/RECORD,,
|
antspymm-1.4.1.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
antspymm/__init__.py,sha256=qUzRd3GmYB8hSO7GNaBuP7Jlm0QNMttTaUfvIpeeAig,4497
|
2
|
-
antspymm/mm.py,sha256=9UZz8Q71VcA92kIBI3odttbbaePJMnJTn1cp7uVeig4,502824
|
3
|
-
antspymm-1.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
|
-
antspymm-1.4.1.dist-info/METADATA,sha256=Bs0pXkMaoVJZlIMJDnm9eqMFtGwCu9ziFZ5ZKaQ0p2Y,23118
|
5
|
-
antspymm-1.4.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
6
|
-
antspymm-1.4.1.dist-info/top_level.txt,sha256=iyD1sRhCKzfwKRJLq5ZUeV9xsv1cGQl8Ejp6QwXM1Zg,9
|
7
|
-
antspymm-1.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|