ssl_radiomics_dataset
SSLRadiomicsDataset
Bases: Dataset
Dataset class for SSL Radiomics dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to the dataset. |
required |
label
|
str
|
The label column name in the dataset annotations. Default is None. |
None
|
radius
|
int
|
The radius around the centroid for positive patch extraction. Default is 25. |
25
|
orient
|
bool
|
Whether to orient the images to LPI orientation. Default is False. |
False
|
resample_spacing
|
float or tuple
|
The desired spacing for resampling the images. Default is None. |
None
|
enable_negatives
|
bool
|
Whether to include negative samples. Default is True. |
True
|
transform
|
callable
|
A function/transform to apply on the images. Default is None. |
None
|
Source code in fmcib/datasets/ssl_radiomics_dataset.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
__getitem__(idx)
Implement how to load the data corresponding to the idx element in the dataset from your data source.
Source code in fmcib/datasets/ssl_radiomics_dataset.py
__init__(path, label=None, radius=25, orient=False, resample_spacing=None, enable_negatives=True, transform=None, orient_patch=True, input_is_target=False)
Creates an instance of the SSLRadiomicsDataset class with the given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to the dataset. |
required |
label
|
Optional[str]
|
The label to use for the dataset. Defaults to None. |
None
|
radius
|
int
|
The radius parameter. Defaults to 25. |
25
|
orient
|
bool
|
True if the dataset should be oriented, False otherwise. Defaults to False. |
False
|
resample_spacing
|
Optional[...]
|
The resample spacing parameter. Defaults to None. |
None
|
enable_negatives
|
bool
|
True if negatives are enabled, False otherwise. Defaults to True. |
True
|
transform
|
The transformation to apply to the dataset. Defaults to None. |
None
|
|
orient_patch
|
bool
|
True if the patch should be oriented, False otherwise. Defaults to True. |
True
|
input_is_target
|
bool
|
True if the input is the target, False otherwise. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
None. |
Source code in fmcib/datasets/ssl_radiomics_dataset.py
__len__()
get_labels()
Function to get labels for when they are available in the dataset.
Returns:
Type | Description |
---|---|
None |
Source code in fmcib/datasets/ssl_radiomics_dataset.py
get_negative_sample(image)
Extract a negative sample from the image background with no overlap to the positive sample.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
Image to extract sample |
required | |
positive_patch_idx
|
Index of the positive patch in [(xmin, xmax), (ymin, ymax), (zmin, zmax)] |
required |
Source code in fmcib/datasets/ssl_radiomics_dataset.py
get_rows()
Get the rows of the annotations as a list of dictionaries.
Returns:
Type | Description |
---|---|
list of dict: The rows of the annotations as dictionaries. |