utils
is_overlapping(patch1, patch2)
Check if two patches are overlapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
patch1
|
list of tuples
|
A list of tuples representing the ranges of each axis in patch1. |
required |
patch2
|
list of tuples
|
A list of tuples representing the ranges of each axis in patch2. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the two patches overlap, False otherwise. |
Note
This function assumes that each patch is represented by a list of tuples, where each tuple represents the range of an axis in the patch. The range of an axis is represented by a tuple (start, end), where start is the start value of the range and end is the end value of the range. The patches are considered overlapping if there is any overlap in the ranges of their axes.
Source code in fmcib/datasets/utils.py
resample_image_to_spacing(image, new_spacing, default_value, interpolator='linear')
Resample an image to a new spacing.
Source code in fmcib/datasets/utils.py
slice_image(image, patch_idx)
Slice an image.