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
"""Defines whether a brain a mask is applied to the CBFMapping
64
-
calculation
63
+
"""Defines a brain mask to limit CBF mapping calculations to specific regions.
64
+
65
+
A brain mask significantly improves processing speed by limiting calculations
66
+
to brain tissue voxels and excluding background regions. It also improves
67
+
the quality of results by focusing the fitting algorithm on relevant tissue.
65
68
66
69
A image mask is simply an image that defines the voxels where the ASL
67
-
calculation should be made. Basically any integer value can be used as
68
-
proper label mask.
70
+
calculation should be made. The mask should have the same spatial dimensions
71
+
as the M0 reference image.
69
72
70
73
A most common approach is to use a binary image (zeros for background
71
-
and 1 for the brain tissues). Anyway, the default behavior of the
72
-
method can transform a integer-pixel values image to a binary mask with
73
-
the `label` parameter provided by the user
74
+
and 1 for brain tissues). However, the method can also handle multi-label
75
+
masks by specifying which label value represents brain tissue.
74
76
75
77
Args:
76
-
brain_mask (np.ndarray): The image representing the brain mask label (int, optional): The label value used to define the foreground tissue (brain). Defaults to 1.
78
+
brain_mask (np.ndarray): The image representing the brain mask.
79
+
Must match the spatial dimensions of the M0 image.
80
+
label (int, optional): The label value used to define the foreground
81
+
tissue (brain). Defaults to 1. Voxels with this value will be
82
+
included in processing.
83
+
84
+
Examples:
85
+
Use a binary brain mask:
86
+
>>> from asltk.asldata import ASLData
87
+
>>> from asltk.reconstruction import CBFMapping
88
+
>>> import numpy as np
89
+
>>> asl_data = ASLData(
90
+
... pcasl='./tests/files/pcasl_mte.nii.gz',
91
+
... m0='./tests/files/m0.nii.gz',
92
+
... ld_values=[1.8], pld_values=[1.8]
93
+
... )
94
+
>>> cbf_mapper = CBFMapping(asl_data)
95
+
>>> # Create a simple brain mask (center region only)
96
+
>>> mask_shape = asl_data('m0').shape # Get M0 dimensions
97
+
>>> brain_mask = np.zeros(mask_shape)
98
+
>>> brain_mask[2:6, 10:25, 10:25] = 1 # Define brain region
"""Defines whether a brain a mask is applied to the MultiDW_ASLMapping
56
-
calculation
107
+
"""Set brain mask for MultiDW-ASL processing (strongly recommended).
57
108
58
-
A image mask is simply an image that defines the voxels where the ASL
59
-
calculation should be made. Basically any integer value can be used as
60
-
proper label mask.
109
+
A brain mask is especially important for multi-diffusion-weighted ASL
110
+
processing as it significantly reduces computation time by limiting
111
+
the intensive voxel-wise fitting to brain tissue regions only.
61
112
62
-
A most common approach is to use a binary image (zeros for background
63
-
and 1 for the brain tissues). Anyway, the default behavior of the
64
-
method can transform a integer-pixel values image to a binary mask with
65
-
the `label` parameter provided by the user
113
+
Without a brain mask, processing time can be prohibitively long (hours)
114
+
for whole-volume analysis. A proper brain mask can reduce processing
115
+
time by 5-10x while maintaining analysis quality.
66
116
67
117
Args:
68
-
brain_mask (np.ndarray): The image representing the brain mask label (int, optional): The label value used to define the foreground tissue (brain). Defaults to 1.
118
+
brain_mask (np.ndarray): The image representing the brain mask.
119
+
Must match the spatial dimensions of the M0 image.
120
+
label (int, optional): The label value used to define brain tissue.
121
+
Defaults to 1. Voxels with this value will be processed.
122
+
123
+
Examples:
124
+
Set a brain mask for efficient processing:
125
+
>>> from asltk.asldata import ASLData
126
+
>>> from asltk.reconstruction import MultiDW_ASLMapping
0 commit comments