Hive_ML.feature_generation.perfusion_features module#
- Hive_ML.feature_generation.perfusion_features.extract_cbf(array, acc='max', timepoints=None)[source]#
Extract 3D CBF map for a given 4D array.
\[CBF_{i,j,k} = acc(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
array (
ndarray) – Input Arrayacc (
str) – Accumulator to use for extracting gradient. Default: “max” (maximum gradient value).timepoints (
Union[list,ndarray]) – Timepoints array, used to map the CBF values to the timepoints.
- Returns:
3-D CBF Map
- Hive_ML.feature_generation.perfusion_features.extract_cbv(array)[source]#
Extract 3D CBV map for a given 4D array.
\[CBV_{i,j,k} = \sum_{t=0}^{N} I_{i,j,k,t}\]- Parameters:
array (
ndarray) – Input Array- Returns:
3-D CBV Map
- Hive_ML.feature_generation.perfusion_features.extract_mtt(array, acc='max', timepoints=None)[source]#
Extract 3D MTT map for a given 4D array.
\[MTT_{i,j,k} = \frac{CBV_{i,j,k}}{CBF_{i,j,k}}\]- Parameters:
array (
ndarray) – Input Arrayacc (
str) – Accumulator to use for extracting gradient for CBF computation. Default: “max” (maximum gradient value).timepoints (
Union[list,ndarray]) – Timepoints array, used to map the MTT values to the timepoints.
- Returns:
3-D MTT Map
- Hive_ML.feature_generation.perfusion_features.extract_ttcbf(array, acc='argmax')[source]#
Extract 3D TTCBF (Time-to-CBF) map for a given 4D array.
\[TTCBF_{i,j,k} = acc(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
array (
ndarray) – Input Arrayacc (
str) – Accumulator to use for extracting gradient for CBF computation. Default: “argmax” (maximum gradient index).
- Returns:
3-D TTCBF Map
- Hive_ML.feature_generation.perfusion_features.extract_ttp(array, timepoints=None)[source]#
Extract 3D TTP (Time-to-Peak) map for a given 4D array.
\[TTP_{i,j,k} = argmax(I_{i,j,k,t})\]- Parameters:
array (
ndarray) – Input Arraytimepoints (
Union[list,ndarray]) – Timepoints array, used to map the TTP values to the timepoints.
- Returns:
3-D TTP Map
- Hive_ML.feature_generation.perfusion_features.generate_acbf_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D Average CBF map (average gradient) from a given 4D Volume, preserving only the values in the mask region.
\[ACBF_{i,j,k} = \mu(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel ACBF values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the ACBF map.
- Hive_ML.feature_generation.perfusion_features.generate_amtt_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D AMTT map (Average Mean Transit Time) from a given 4D Volume, preserving only the values in the mask region.
\[AMTT_{i,j,k} = \frac{CBV_{i,j,k}}{ACBF_{i,j,k}}\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel AMTT values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the AMTT map.
- Hive_ML.feature_generation.perfusion_features.generate_cbf_image(image_filename, mask_filename, output_filename, timepoints=None)[source]#
Generate a 3D CBF map (maximum gradient) from a given 4D Volume, preserving only the values in the mask region.
\[CBF_{i,j,k} = \max(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel CBF values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the CBF map.timepoints (
Union[list,ndarray]) – Timepoints array, used to map the CBF values to the timepoints.
- Hive_ML.feature_generation.perfusion_features.generate_cbv_image(image_filename, mask_filename, output_filename, timepoints=None)[source]#
Generate a 3D CBV map from a given 4D Volume, preserving only the values in the mask region.
\[CBV_{i,j,k} = \sum_{t=0}^{N} I_{i,j,k,t}\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel CBV values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the CBV map.
- Hive_ML.feature_generation.perfusion_features.generate_distance_map(image_filename, mask_filename, output_filename)[source]#
Generate a Distance map for a given binary mask.
- Parameters:
image_filename (
Union[str,Path]) – Image filename, not used.mask_filename (
Union[str,Path]) – Mask filename to compute the distance map.output_filename (
Union[str,Path]) – Filename where to save the distance map.
- Hive_ML.feature_generation.perfusion_features.generate_distance_map_depth(image_filename, mask_filename, output_filename, n_bins=5)[source]#
Generate a discrete distance map, equally distributing the distance map values in
n_bins, and labelling the voxels with discrete values, according to the corresponding bin, from 1 ton_bins.- Parameters:
image_filename (
Union[str,Path]) – Image filename, not used.mask_filename (
Union[str,Path]) – Mask filename to compute the discrete distance map.output_filename (
Union[str,Path]) – Filename where to save the discrete distance map.n_bins (
int) – Number of splits for the distance map histogram.
- Hive_ML.feature_generation.perfusion_features.generate_mtt_image(image_filename, mask_filename, output_filename, timepoints=None)[source]#
Generate a 3D MTT map (Mean Transit Time) from a given 4D Volume, preserving only the values in the mask region.
\[MTT_{i,j,k} = \frac{CBV_{i,j,k}}{CBF_{i,j,k}}\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel MTT values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the MTT map.timepoints (
Union[list,ndarray]) – Timepoints array, used to map the MTT values to the timepoints.
- Hive_ML.feature_generation.perfusion_features.generate_ncbf_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D Negative CBF map (minimum gradient) from a given 4D Volume, preserving only the values in the mask region.
\[NCBF_{i,j,k} = \min(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel NCBF values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the NCBF map.
- Hive_ML.feature_generation.perfusion_features.generate_nmtt_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D NMTT map (Negative Mean Transit Time) from a given 4D Volume, preserving only the values in the mask region.
\[NMTT_{i,j,k} = \frac{CBV_{i,j,k}}{NCBF_{i,j,k}}\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel NMTT values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the NMTT map.
- Hive_ML.feature_generation.perfusion_features.generate_sdcbf_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D SD CBF map (Standard Deviation gradient) from a given 4D Volume, preserving only the values in the mask region.
\[ACBF_{i,j,k} = \sigma(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel SDCBF values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the SDCBF map.
- Hive_ML.feature_generation.perfusion_features.generate_sdmtt_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D SDMTT map (Standard Deviation Mean Transit Time) from a given 4D Volume, preserving only the values in the mask region.
\[SDMTT_{i,j,k} = \frac{CBV_{i,j,k}}{SDCBF_{i,j,k}}\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel SDMTT values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the SDMTT map.
- Hive_ML.feature_generation.perfusion_features.generate_ttcbf_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D TTCBF map from a given 4D Volume, preserving only the values in the mask region.
\[TTCBF_{i,j,k} = argmax(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel TTCBF values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the TTCBF map.
- Hive_ML.feature_generation.perfusion_features.generate_ttncbf_image(image_filename, mask_filename, output_filename)[source]#
Generate a 3D TTNCBF (Time-to-NCBF) map from a given 4D Volume, preserving only the values in the mask region.
\[TTNCBF_{i,j,k} = argmin(\frac{\nabla I_{i,j,k,t}}{ \nabla t})\]- Parameters:
image_filename – Image filename, containing the 4D array.
mask_filename – Mask filename, used to filter the voxel TTNCBF values in the mask region.
output_filename – Filename where to save the TTNCBF map.
- Hive_ML.feature_generation.perfusion_features.generate_ttp_image(image_filename, mask_filename, output_filename, timepoints=None)[source]#
Generate a 3D TTP map from a given 4D Volume, preserving only the values in the mask region.
\[TTP_{i,j,k} = argmax(I_{i,j,k,t})\]- Parameters:
image_filename (
Union[str,Path]) – Image filename, containing the 4D array.mask_filename (
Union[str,Path]) – Mask filename, used to filter the voxel TTP values in the mask region.output_filename (
Union[str,Path]) – Filename where to save the TTP map.timepoints (
Union[list,ndarray]) – Timepoints array, used to map the TTP values to the timepoints.