napari_cellseg3d.code_plugins.plugin_review_dock
Widget opened when a new Review session is started.
Classes:
| Name | Description |
|---|---|
Datamanager |
A widget with a single checkbox that allows to store the status of a slice in csv file (checked/not checked). |
Attributes:
| Name | Type | Description |
|---|---|---|
logger |
plugin_dock.py |
logger
module-attribute
logger = utils.LOGGER
plugin_dock.py
Definition of Datamanager widget, for saving labels status in csv file
Datamanager
Bases: QWidget
A widget with a single checkbox that allows to store the status of a slice in csv file (checked/not checked).
Methods:
| Name | Description |
|---|---|
__init__ |
Creates the datamanager widget in the specified viewer window. |
create_csv |
Create a new dataframe and save the csv. |
load_csv |
Loads newest csv or create new csv. |
pause_timer |
Pause the timer for the review time. |
prepare |
Initialize the Datamanager, which loads the csv file and updates it with the index of the current slice. |
update_dm |
Updates the Datamanager with the index of the current slice. |
Attributes:
| Name | Type | Description |
|---|---|---|
as_folder |
Whether to load as folder or single file |
|
viewer |
napari.viewer.Viewer: viewer in which the widget is displayed |
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |
as_folder
instance-attribute
as_folder = False
Whether to load as folder or single file
viewer
instance-attribute
viewer = parent
napari.viewer.Viewer: viewer in which the widget is displayed
__init__
__init__(parent: Viewer, image_shape=None)
Creates the datamanager widget in the specified viewer window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Viewer
|
napari Viewer for the widget to be displayed in |
required |
image_shape
|
tuple
|
shape of the reviewed volume. Defaults to the shape of the viewer's first layer, which is only right when the viewer holds nothing but the review. |
None
|
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
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 | |
create_csv
create_csv(label_dir, model_type)
Create a new dataframe and save the csv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_dir
|
str
|
label path |
required |
model_type
|
str
|
model type |
required |
Returns: (pandas.DataFrame, str): dataframe, csv path.
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
load_csv
load_csv(label_dir, model_type, checkbox)
Loads newest csv or create new csv.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_dir
|
str
|
label path |
required |
model_type
|
str
|
model type |
required |
checkbox
|
bool
|
create new dataset or not |
required |
Returns:
| Type | Description |
|---|---|
|
(pandas.DataFrame, str) dataframe、csv path |
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
pause_timer
pause_timer()
Pause the timer for the review time.
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
prepare
prepare(label_dir, filetype, model_type, checkbox, slice_num=None)
Initialize the Datamanager, which loads the csv file and updates it with the index of the current slice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label_dir
|
str
|
label path |
required |
filetype (str)
|
file extension |
required | |
model_type
|
str
|
model type |
required |
checkbox
|
bool
|
create new dataset or not |
required |
slice_num
|
int
|
current slice of the reviewed volume. Defaults to the viewer's first axis, which is only correct if only review layers are present. |
None
|
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
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 | |
update_dm
update_dm(slice_num)
Updates the Datamanager with the index of the current slice.
Also updates the text with the status contained in the csv (e.g. checked/not checked).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slice_num
|
int
|
index of the current slice |
required |
Source code in napari_cellseg3d/code_plugins/plugin_review_dock.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | |