You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The 4D image is first segmented (using otsu threshold) to segment the brain voxels from the background. (x)
4
+
5
+
I. Median absolute deviation over voxels and median absolute deviation over time points
4
6
2. The median(med_voxel(x)) and median absolute deviation(mad_voxel(x)) is calculated for each of the brain voxels.
5
7
3. The brain voxels lying outside the interval [med_voxel(x)-a*mad_voxel(x), med_voxel(x)+a*mad_voxel(x)] are considered as outliers. a = 3.5
6
8
4. For each time t, the number of outlying voxels n(t) is counted.
7
9
5. The median (n_med) and MAD (n_mad) of n(t) are calculated. Any time t with n(t)>n_med+3.5*n_mad are considered as outliers.
8
10
11
+
II. DVARS and median absolute deviation over time points
12
+
6. The dvars(t) of the brain voxels are calculated.
13
+
7. The median (dvars_med) and MAD (dvars_mad) of dvars(t) are calculated. Any time t with |dvars(t)-dvars_med|>3.5*dvars_mad are considered as outliers.
14
+
15
+
III. Sliding window and median absolute deviation over time points
16
+
8. A fraction of the time points are chosen using a sliding window, mean over voxel intensities for each time point (m(t)) in this sliding window is calculated.
17
+
9. The median (m_med) and MAD (m_mad) of m(t) in this sliding window are calculated. Any time t with |m(t)-m_med|>3.5*m_mad are considered as outliers.
18
+
10. This is repeated till the sliding window covers all the time points.
19
+
11. All the outliers in each sliding window are merged.
20
+
21
+
12. The outliers from the I approach is a more global approach and filters a lot of time-points as outliers.
22
+
13. The outliers from the II(DVARS) approach compares successive volumes and if the difference is large considers the preceding volumes as outliers.
23
+
14. The outliers from the III(sliding window) approach compares volumes within a certain range and then detect outliers. This is mostly done to take care of drift.
24
+
25
+
15. Outliers from I and II are merged (o_total) (Global + Local). If these o_total agree with the outliers from sliding window, they are classified as final outliers (o_final).
26
+
9
27
References:
10
28
1. Cox, R.W. Outlier Detection in FMRl Time Series. ISMRM(2002).
# Return indices of True values from Boolean array.
64
-
returnnp.nonzero(outliers_time)[0]
62
+
returnnp.nonzero(outliers_time)
63
+
64
+
defdetect_outliers_mad_dvars_mask(fname):
65
+
""" Detect outliers given image file path 'filename'
66
+
67
+
Parameters
68
+
----------
69
+
fname : str or Path
70
+
Filename of 4D image, as string or Path object
71
+
72
+
Returns
73
+
-------
74
+
outliers : array
75
+
Indices of outlier volumes.
76
+
"""
77
+
# A mask is used to first segment the brain regions from the background, dvars is calculated and then median absolute deviation is used to detect outliers
""" Detect outliers given image file path 'filename'
92
+
93
+
Parameters
94
+
----------
95
+
fname : str or Path
96
+
Filename of 4D image, as string or Path object
97
+
98
+
Returns
99
+
-------
100
+
outliers : array
101
+
Indices of outlier volumes.
102
+
"""
103
+
# A mask is used to first segment the brain regions from the background, sliding window approach is used to detect outliers in each window using median absolute deviation
0 commit comments