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
Deform a dictionary of NII objects using random grid deformation. Requires elasticdeform. 'pip install elasticdeform'
21
+
22
+
IMPORTANT: Normalize your image data to 0,1. The .seg property of NII shows if this is a segmentation. (NII is form our TPTBox and is a wrapper for nibable)
23
+
24
+
This function takes a dictionary of NII objects and applies random grid deformation to each object
25
+
using specified deformation parameters or, if not provided, random parameters generated based on
26
+
the `deform_factor`. The deformed objects are returned as a dictionary.
27
+
28
+
Args:
29
+
arr_dic (dict[str, NII]): A dictionary containing NII objects to be deformed.
30
+
sigma (float, optional): The standard deviation of the deformation field. If not provided,
31
+
it will be generated based on the `deform_factor`.
32
+
points (int, optional): The number of control points for the deformation grid. If not provided,
33
+
it will be generated based on the `deform_factor`.
34
+
deform_factor (float, optional): A factor used to determine the deformation parameters if
35
+
`sigma` and `points` are not specified. Larger values result in stronger deformations.
36
+
deform_padding (int, optional): The padding added to the deformed objects to avoid edge artifacts.
37
+
verbose (bool, optional): If True, enable verbose logging. Default is True.
38
+
39
+
Returns:
40
+
dict[str, NII]: A dictionary where keys correspond to the input dictionary keys, and values
41
+
correspond to the deformed NII objects.
42
+
43
+
Example:
44
+
# Deform a dictionary of NII objects using default deformation parameters
45
+
deformed_data = deformed_NII(arr_dic)
46
+
47
+
# Deform a dictionary of NII objects with specific deformation parameters
0 commit comments