careamics 0.1.0rc7__py3-none-any.whl → 0.1.0rc8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of careamics might be problematic. Click here for more details.
- careamics/__init__.py +1 -14
- careamics/careamist.py +83 -62
- careamics/config/__init__.py +0 -3
- careamics/config/algorithm_model.py +8 -0
- careamics/config/architectures/architecture_model.py +1 -0
- careamics/config/architectures/custom_model.py +2 -0
- careamics/config/architectures/unet_model.py +19 -0
- careamics/config/architectures/vae_model.py +1 -0
- careamics/config/callback_model.py +76 -34
- careamics/config/configuration_factory.py +1 -79
- careamics/config/configuration_model.py +12 -7
- careamics/config/data_model.py +29 -10
- careamics/config/inference_model.py +12 -2
- careamics/config/optimizer_models.py +6 -0
- careamics/config/support/supported_data.py +29 -4
- careamics/config/tile_information.py +10 -0
- careamics/config/training_model.py +5 -1
- careamics/dataset/dataset_utils/__init__.py +0 -6
- careamics/dataset/dataset_utils/file_utils.py +1 -1
- careamics/dataset/dataset_utils/iterate_over_files.py +1 -1
- careamics/dataset/in_memory_dataset.py +37 -21
- careamics/dataset/iterable_dataset.py +38 -34
- careamics/dataset/iterable_pred_dataset.py +2 -1
- careamics/dataset/iterable_tiled_pred_dataset.py +2 -1
- careamics/dataset/patching/patching.py +53 -37
- careamics/file_io/__init__.py +7 -0
- careamics/file_io/read/__init__.py +11 -0
- careamics/file_io/read/get_func.py +56 -0
- careamics/{dataset/dataset_utils/read_tiff.py → file_io/read/tiff.py} +3 -1
- careamics/file_io/write/__init__.py +9 -0
- careamics/file_io/write/get_func.py +59 -0
- careamics/file_io/write/tiff.py +39 -0
- careamics/lightning/__init__.py +17 -0
- careamics/{lightning_module.py → lightning/lightning_module.py} +58 -85
- careamics/{lightning_prediction_datamodule.py → lightning/predict_data_module.py} +78 -116
- careamics/{lightning_datamodule.py → lightning/train_data_module.py} +134 -214
- careamics/model_io/bmz_io.py +1 -1
- careamics/model_io/model_io_utils.py +1 -1
- careamics/prediction_utils/__init__.py +0 -2
- careamics/prediction_utils/prediction_outputs.py +18 -46
- careamics/prediction_utils/stitch_prediction.py +17 -14
- careamics/utils/__init__.py +2 -0
- careamics/utils/autocorrelation.py +40 -0
- {careamics-0.1.0rc7.dist-info → careamics-0.1.0rc8.dist-info}/METADATA +1 -1
- {careamics-0.1.0rc7.dist-info → careamics-0.1.0rc8.dist-info}/RECORD +51 -46
- careamics/config/configuration_example.py +0 -86
- careamics/dataset/dataset_utils/read_utils.py +0 -27
- careamics/prediction_utils/create_pred_datamodule.py +0 -185
- /careamics/{dataset/dataset_utils/read_zarr.py → file_io/read/zarr.py} +0 -0
- /careamics/{callbacks → lightning/callbacks}/__init__.py +0 -0
- /careamics/{callbacks → lightning/callbacks}/hyperparameters_callback.py +0 -0
- /careamics/{callbacks → lightning/callbacks}/progress_bar_callback.py +0 -0
- {careamics-0.1.0rc7.dist-info → careamics-0.1.0rc8.dist-info}/WHEEL +0 -0
- {careamics-0.1.0rc7.dist-info → careamics-0.1.0rc8.dist-info}/licenses/LICENSE +0 -0
|
@@ -13,7 +13,9 @@ def convert_outputs(
|
|
|
13
13
|
predictions: List[Any], tiled: bool
|
|
14
14
|
) -> Union[List[NDArray], NDArray]:
|
|
15
15
|
"""
|
|
16
|
-
Convert the outputs to the desired form.
|
|
16
|
+
Convert the Lightning trainer outputs to the desired form.
|
|
17
|
+
|
|
18
|
+
This method allows stitching back together tiled predictions.
|
|
17
19
|
|
|
18
20
|
Parameters
|
|
19
21
|
----------
|
|
@@ -34,21 +36,10 @@ def convert_outputs(
|
|
|
34
36
|
# this layout is to stop mypy complaining
|
|
35
37
|
if tiled:
|
|
36
38
|
predictions_comb = combine_batches(predictions, tiled)
|
|
37
|
-
|
|
38
|
-
tiles = [pred[0] for pred in predictions_comb[0]]
|
|
39
|
-
tile_infos = predictions_comb[1]
|
|
40
|
-
predictions_output = stitch_prediction(tiles, tile_infos)
|
|
39
|
+
predictions_output = stitch_prediction(*predictions_comb)
|
|
41
40
|
else:
|
|
42
41
|
predictions_output = combine_batches(predictions, tiled)
|
|
43
42
|
|
|
44
|
-
# TODO: add this in? Returns output with same axes as input
|
|
45
|
-
# Won't work with tiling rn because stitch_prediction func removes S axis
|
|
46
|
-
# predictions = reshape(predictions, axes)
|
|
47
|
-
# At least make sure stitched prediction and non-tiled prediction have matching axes
|
|
48
|
-
|
|
49
|
-
# TODO: might want to remove this
|
|
50
|
-
if len(predictions_output) == 1:
|
|
51
|
-
return predictions_output[0]
|
|
52
43
|
return predictions_output
|
|
53
44
|
|
|
54
45
|
|
|
@@ -94,7 +85,7 @@ def combine_batches(
|
|
|
94
85
|
if tiled:
|
|
95
86
|
return _combine_tiled_batches(predictions)
|
|
96
87
|
else:
|
|
97
|
-
return
|
|
88
|
+
return _combine_array_batches(predictions)
|
|
98
89
|
|
|
99
90
|
|
|
100
91
|
def _combine_tiled_batches(
|
|
@@ -105,8 +96,11 @@ def _combine_tiled_batches(
|
|
|
105
96
|
|
|
106
97
|
Parameters
|
|
107
98
|
----------
|
|
108
|
-
predictions : list
|
|
109
|
-
Predictions that are output from `Trainer.predict`.
|
|
99
|
+
predictions : list of (numpy.ndarray, list of TileInformation)
|
|
100
|
+
Predictions that are output from `Trainer.predict`. For tiled batches, this is
|
|
101
|
+
a list of tuples. The first element of the tuples is the prediction output of
|
|
102
|
+
tiles with dimension (B, C, (Z), Y, X), where B is batch size. The second
|
|
103
|
+
element of the tuples is a list of TileInformation objects of length B.
|
|
110
104
|
|
|
111
105
|
Returns
|
|
112
106
|
-------
|
|
@@ -117,49 +111,27 @@ def _combine_tiled_batches(
|
|
|
117
111
|
tile_infos = [
|
|
118
112
|
tile_info for _, tile_info_list in predictions for tile_info in tile_info_list
|
|
119
113
|
]
|
|
120
|
-
prediction_tiles: List[NDArray] =
|
|
114
|
+
prediction_tiles: List[NDArray] = _combine_array_batches(
|
|
121
115
|
[preds for preds, _ in predictions]
|
|
122
116
|
)
|
|
123
117
|
return prediction_tiles, tile_infos
|
|
124
118
|
|
|
125
119
|
|
|
126
|
-
def
|
|
120
|
+
def _combine_array_batches(predictions: List[NDArray]) -> List[NDArray]:
|
|
127
121
|
"""
|
|
128
|
-
Combine batches
|
|
122
|
+
Combine batches of arrays.
|
|
129
123
|
|
|
130
124
|
Parameters
|
|
131
125
|
----------
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
predictions : list
|
|
127
|
+
Prediction arrays that are output from `Trainer.predict`. A list of arrays that
|
|
128
|
+
have dimensions (B, C, (Z), Y, X), where B is batch size.
|
|
134
129
|
|
|
135
130
|
Returns
|
|
136
131
|
-------
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
list of numpy.ndarray
|
|
133
|
+
A list of arrays with dimensions (1, C, (Z), Y, X).
|
|
139
134
|
"""
|
|
140
135
|
prediction_concat: NDArray = np.concatenate(predictions, axis=0)
|
|
141
136
|
prediction_split = np.split(prediction_concat, prediction_concat.shape[0], axis=0)
|
|
142
137
|
return prediction_split
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def reshape(predictions: List[NDArray], axes: str) -> List[NDArray]:
|
|
146
|
-
"""
|
|
147
|
-
Reshape predictions to have dimensions of input.
|
|
148
|
-
|
|
149
|
-
Parameters
|
|
150
|
-
----------
|
|
151
|
-
predictions : list
|
|
152
|
-
Predictions that are output from `Trainer.predict`.
|
|
153
|
-
axes : str
|
|
154
|
-
Axes SC(Z)YX.
|
|
155
|
-
|
|
156
|
-
Returns
|
|
157
|
-
-------
|
|
158
|
-
List[NDArray]
|
|
159
|
-
Reshaped predicitions.
|
|
160
|
-
"""
|
|
161
|
-
if "C" not in axes:
|
|
162
|
-
predictions = [pred[:, 0] for pred in predictions]
|
|
163
|
-
if "S" not in axes:
|
|
164
|
-
predictions = [pred[0] for pred in predictions]
|
|
165
|
-
return predictions
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""Prediction utility functions."""
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import builtins
|
|
4
|
+
from typing import List, Union
|
|
4
5
|
|
|
5
6
|
import numpy as np
|
|
7
|
+
from numpy.typing import NDArray
|
|
6
8
|
|
|
7
9
|
from careamics.config.tile_information import TileInformation
|
|
8
10
|
|
|
@@ -52,9 +54,9 @@ def stitch_prediction(
|
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
def stitch_prediction_single(
|
|
55
|
-
tiles: List[
|
|
57
|
+
tiles: List[NDArray],
|
|
56
58
|
tile_infos: List[TileInformation],
|
|
57
|
-
) ->
|
|
59
|
+
) -> NDArray:
|
|
58
60
|
"""
|
|
59
61
|
Stitch tiles back together to form a full image.
|
|
60
62
|
|
|
@@ -72,29 +74,30 @@ def stitch_prediction_single(
|
|
|
72
74
|
Returns
|
|
73
75
|
-------
|
|
74
76
|
numpy.ndarray
|
|
75
|
-
Full image.
|
|
77
|
+
Full image, with dimensions SC(Z)YX.
|
|
76
78
|
"""
|
|
77
79
|
# retrieve whole array size
|
|
78
80
|
input_shape = tile_infos[0].array_shape
|
|
79
81
|
predicted_image = np.zeros(input_shape, dtype=np.float32)
|
|
80
82
|
|
|
83
|
+
# reshape
|
|
84
|
+
# TODO: can be more elegantly solved if TileInformation allows singleton dims
|
|
85
|
+
singleton_dims = tuple(np.where(np.array(tiles[0].shape) == 1)[0])
|
|
86
|
+
predicted_image = np.expand_dims(predicted_image, singleton_dims)
|
|
87
|
+
|
|
81
88
|
for tile, tile_info in zip(tiles, tile_infos):
|
|
82
|
-
n_channels = tile.shape[0]
|
|
83
89
|
|
|
84
90
|
# Compute coordinates for cropping predicted tile
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
crop_slices: tuple[Union[builtins.ellipsis, slice], ...] = (
|
|
92
|
+
...,
|
|
93
|
+
*[slice(c[0], c[1]) for c in tile_info.overlap_crop_coords],
|
|
87
94
|
)
|
|
88
95
|
|
|
89
96
|
# Crop predited tile according to overlap coordinates
|
|
90
|
-
cropped_tile = tile[
|
|
97
|
+
cropped_tile = tile[crop_slices]
|
|
91
98
|
|
|
92
99
|
# Insert cropped tile into predicted image using stitch coordinates
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
...,
|
|
96
|
-
*[slice(c[0], c[1]) for c in tile_info.stitch_coords],
|
|
97
|
-
)
|
|
98
|
-
] = cropped_tile.astype(np.float32)
|
|
100
|
+
image_slices = (..., *[slice(c[0], c[1]) for c in tile_info.stitch_coords])
|
|
101
|
+
predicted_image[image_slices] = cropped_tile.astype(np.float32)
|
|
99
102
|
|
|
100
103
|
return predicted_image
|
careamics/utils/__init__.py
CHANGED
|
@@ -7,9 +7,11 @@ __all__ = [
|
|
|
7
7
|
"BaseEnum",
|
|
8
8
|
"get_logger",
|
|
9
9
|
"get_careamics_home",
|
|
10
|
+
"autocorrelation",
|
|
10
11
|
]
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
from .autocorrelation import autocorrelation
|
|
13
15
|
from .base_enum import BaseEnum
|
|
14
16
|
from .context import cwd, get_careamics_home
|
|
15
17
|
from .logging import get_logger
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Autocorrelation function."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
from numpy.typing import NDArray
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def autocorrelation(image: NDArray) -> NDArray:
|
|
8
|
+
"""Compute the autocorrelation of an image.
|
|
9
|
+
|
|
10
|
+
This method is used to explore spatial correlations in images,
|
|
11
|
+
in particular in the noise.
|
|
12
|
+
|
|
13
|
+
The autocorrelation is normalized to the zero-shift value, which is centered in
|
|
14
|
+
the resulting images.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
image : NDArray
|
|
19
|
+
Input image.
|
|
20
|
+
|
|
21
|
+
Returns
|
|
22
|
+
-------
|
|
23
|
+
numpy.ndarray
|
|
24
|
+
Autocorrelation of the input image.
|
|
25
|
+
"""
|
|
26
|
+
# normalize image
|
|
27
|
+
image = (image - np.mean(image)) / np.std(image)
|
|
28
|
+
|
|
29
|
+
# compute autocorrelation in fourier space
|
|
30
|
+
image = np.fft.fftn(image)
|
|
31
|
+
image = np.abs(image) ** 2
|
|
32
|
+
image = np.fft.ifftn(image).real
|
|
33
|
+
|
|
34
|
+
# normalize to zero shift value
|
|
35
|
+
image = image / image.flat[0]
|
|
36
|
+
|
|
37
|
+
# shift zero frequency to center
|
|
38
|
+
image = np.fft.fftshift(image)
|
|
39
|
+
|
|
40
|
+
return image
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
careamics/__init__.py,sha256=
|
|
2
|
-
careamics/careamist.py,sha256=
|
|
1
|
+
careamics/__init__.py,sha256=xBCerWN66hv3T7dRGiUYLflmbJtJt1HqbSg9JCWp8pY,391
|
|
2
|
+
careamics/careamist.py,sha256=Sk6tY8J4dErVHS3HgwCnR0in78Hh0shPB2CH3Woh-_I,26593
|
|
3
3
|
careamics/conftest.py,sha256=Od4WcaaP0UP-XUMrFr_oo4e6c2hi_RvNbuaRTopwlmI,911
|
|
4
|
-
careamics/lightning_datamodule.py,sha256=NoMJIaJU0BizBNTSC-dzR1mWED1urHMXdH6hIFi-QfE,32536
|
|
5
|
-
careamics/lightning_module.py,sha256=T1G_QmBAMHfZyynD6nywT9F6bFdjDDdXqJQnjqiODek,10483
|
|
6
|
-
careamics/lightning_prediction_datamodule.py,sha256=cZuiwImD-e4Fuy493PWfwhR0fWm_uqor8itjgsQCWos,14595
|
|
7
4
|
careamics/py.typed,sha256=esB4cHc6c07uVkGtqf8at7ttEnprwRxwk8obY8Qumq4,187
|
|
8
|
-
careamics/
|
|
9
|
-
careamics/
|
|
10
|
-
careamics/
|
|
11
|
-
careamics/config/
|
|
12
|
-
careamics/config/
|
|
13
|
-
careamics/config/
|
|
14
|
-
careamics/config/
|
|
15
|
-
careamics/config/
|
|
16
|
-
careamics/config/
|
|
17
|
-
careamics/config/
|
|
18
|
-
careamics/config/inference_model.py,sha256=3n3jy922lTD9NhnSNA876Rmrr2MavFk2pmOE967itLQ,6447
|
|
19
|
-
careamics/config/optimizer_models.py,sha256=-XVzi7CsxfcThTUjlyn4btJa6oHbFOf-q3h9qLM9t0k,5346
|
|
20
|
-
careamics/config/tile_information.py,sha256=TAqfAthPSnIqerq72qP4KlTXPqci9XE9pCVN7J3bMJ4,2246
|
|
21
|
-
careamics/config/training_model.py,sha256=oghv91J7xIdI69wpNJGmLUAwgM9l3VhMsbsOo4USqkU,1559
|
|
5
|
+
careamics/config/__init__.py,sha256=qaR98bVRFnEHYGG5EgGBIa9P9AtMRmKzpXuc1exdteo,913
|
|
6
|
+
careamics/config/algorithm_model.py,sha256=-Nx4E6M2EyBDozSTkXeYaj9b0KcIli0Gy6DE3P1WVfE,5443
|
|
7
|
+
careamics/config/callback_model.py,sha256=EeYHqpMIPQwyNxLRzzX32Uncl5mZuB1bJO76RHpNymg,4555
|
|
8
|
+
careamics/config/configuration_factory.py,sha256=Ckkv4ber2WSaa-BaoDNuyvpVMd02Q-9T27yziXJ-1Ak,18538
|
|
9
|
+
careamics/config/configuration_model.py,sha256=4LbAt3zUtx05mfTRrXBqD57iQn2s0Y93f81M8Gce4zo,18698
|
|
10
|
+
careamics/config/data_model.py,sha256=dpRthXU8lINT3laJygqka-fmUDT7U34QUHZYBX95oY8,15070
|
|
11
|
+
careamics/config/inference_model.py,sha256=UE_-ZmCX6LFCbDBOwyGnvuAboF_JNX2m2LcF0WiwgCI,6961
|
|
12
|
+
careamics/config/optimizer_models.py,sha256=p6gDYtO-jFtL7zVX0-Id-rGJWkkyhbU3EBrWD_4TxZE,5726
|
|
13
|
+
careamics/config/tile_information.py,sha256=t82zG54BBwXCwy-IEdALNx7pghEDyvXcf_nBiOhGSTw,2598
|
|
14
|
+
careamics/config/training_model.py,sha256=9I9xn1V7yIMC-1GSAxxeevDc4qQENAtCFnJVMd8haqA,1769
|
|
22
15
|
careamics/config/architectures/__init__.py,sha256=CdnViydyTdQixus3uWHBIgbgxmu9t1_ADehqpjN_57U,444
|
|
23
|
-
careamics/config/architectures/architecture_model.py,sha256=
|
|
24
|
-
careamics/config/architectures/custom_model.py,sha256=
|
|
16
|
+
careamics/config/architectures/architecture_model.py,sha256=4WvQQJGz5DLFjOUryZx0fqPuEMlF2RhtlV5XudJTIbc,922
|
|
17
|
+
careamics/config/architectures/custom_model.py,sha256=IRaequRi5BXMPL14gLr1B_27_XWPeWxQwgHF9_EJMaU,4664
|
|
25
18
|
careamics/config/architectures/register_model.py,sha256=lHH0aUPmXtI3Bq_76zkhg07_Yb_nOJZkZJLCC_G-rZM,2434
|
|
26
|
-
careamics/config/architectures/unet_model.py,sha256=
|
|
27
|
-
careamics/config/architectures/vae_model.py,sha256=
|
|
19
|
+
careamics/config/architectures/unet_model.py,sha256=8F2KosNkrXUP2bxlm-D1mowS9x3GOjyXjsEo1Kf-05k,3497
|
|
20
|
+
careamics/config/architectures/vae_model.py,sha256=iLPwjI4B_Ivv_qQNUJc4-Gwm4z8UA3P5BsKQucRFEMI,962
|
|
28
21
|
careamics/config/references/__init__.py,sha256=rZAQzmrciX5cNICcXaBH6sbE6N6L7_qYQUkasNy9y-c,763
|
|
29
22
|
careamics/config/references/algorithm_descriptions.py,sha256=wR3hIoeg5eiUEPbwTxMpQYLTKQyRl_5naSDbBZOZESU,3541
|
|
30
23
|
careamics/config/references/references.py,sha256=AXx08FJQxHb7SYOluCr_eQn_mbOris5dXqhKrCnhBTE,1573
|
|
@@ -32,7 +25,7 @@ careamics/config/support/__init__.py,sha256=pKqk76kyBraiSC1SQos-cyiQwsfOLLkLuWj6
|
|
|
32
25
|
careamics/config/support/supported_activations.py,sha256=O27_dGDgw2P-DslKJsXGVAyS2NUQM6Ta4jeo2uTQlW0,519
|
|
33
26
|
careamics/config/support/supported_algorithms.py,sha256=GCkauFDlmb2hJwFSdoIpGmpLjPeYFHOGy2NweKdw8T4,358
|
|
34
27
|
careamics/config/support/supported_architectures.py,sha256=LLD6hyje9Q0BcvA7p2E8WW_cY5yEgMI_NAP4HBi27UU,540
|
|
35
|
-
careamics/config/support/supported_data.py,sha256=
|
|
28
|
+
careamics/config/support/supported_data.py,sha256=T_mDiWLFMVji_EpjBABUObAJcnv-XBnqp9XUZP37Tdk,2902
|
|
36
29
|
careamics/config/support/supported_loggers.py,sha256=ubSOkGoYabGbm_jmyc1R3eFcvcP-sHmuyiBi_d3_wLg,197
|
|
37
30
|
careamics/config/support/supported_losses.py,sha256=TPsMCuDdgb64TRyDwonnwHb1R-rkn3OzhtHimyVtrOY,540
|
|
38
31
|
careamics/config/support/supported_optimizers.py,sha256=xxbJsyohJTlHeUz2I4eRwcE3BeACs-6PH8cpX6w2wX8,1394
|
|
@@ -48,29 +41,41 @@ careamics/config/transformations/xy_random_rotate90_model.py,sha256=6sYKmtCLvz0S
|
|
|
48
41
|
careamics/config/validators/__init__.py,sha256=iv0nVI0W7j9DxFPwh0DjRCzM9P8oLQn4Gwi5rfuFrrI,180
|
|
49
42
|
careamics/config/validators/validator_utils.py,sha256=aNFzpBVbef3BZIt6MiNMVc2kW6MJDWqQgdYkFM8Gjig,2621
|
|
50
43
|
careamics/dataset/__init__.py,sha256=NQSWdpQu6BhqGGHUYuOt1hXJrGUN1LPNCP1A8duMY84,547
|
|
51
|
-
careamics/dataset/in_memory_dataset.py,sha256=
|
|
44
|
+
careamics/dataset/in_memory_dataset.py,sha256=7YRpbKg6nqrECDhaA88HNlstyTObQxTN9jPcNlE_aWE,9906
|
|
52
45
|
careamics/dataset/in_memory_pred_dataset.py,sha256=VvwW5D8TjgO_kR8eZinP-9qepSiI6ZsUN7FZ0Rvc8Bs,2161
|
|
53
46
|
careamics/dataset/in_memory_tiled_pred_dataset.py,sha256=DANmlnlV1ysXKdwGvmJoOYKcjlgoMhnSGSDRpeK79ZA,3552
|
|
54
|
-
careamics/dataset/iterable_dataset.py,sha256=
|
|
55
|
-
careamics/dataset/iterable_pred_dataset.py,sha256=
|
|
56
|
-
careamics/dataset/iterable_tiled_pred_dataset.py,sha256=
|
|
47
|
+
careamics/dataset/iterable_dataset.py,sha256=vHwkzoQs-CvbGHcGtvYMF52dO6zLau89A13xDOWSGUU,9770
|
|
48
|
+
careamics/dataset/iterable_pred_dataset.py,sha256=2KC9C2hpZmhWSmo6w9Fhz0wjmbcsBlRy8QsYfO4dN2w,3740
|
|
49
|
+
careamics/dataset/iterable_tiled_pred_dataset.py,sha256=uNpc_13vo9REvGYOLu7lBNDh813b_UqZ9x5c4Q_udDE,4533
|
|
57
50
|
careamics/dataset/zarr_dataset.py,sha256=lojnK5bhiF1vyjuPtWXBrZ9sy5fT_rBvZJbbbnE-H_I,5665
|
|
58
|
-
careamics/dataset/dataset_utils/__init__.py,sha256=
|
|
51
|
+
careamics/dataset/dataset_utils/__init__.py,sha256=b9r_2BcrXoHNq9chXfZvgINGwZRpWfUZ_p6vikB_Kxw,507
|
|
59
52
|
careamics/dataset/dataset_utils/dataset_utils.py,sha256=zYNglet5lYKxIhTeOGG2K24oujC-m5zyYlwJcQcleVA,2662
|
|
60
|
-
careamics/dataset/dataset_utils/file_utils.py,sha256=
|
|
61
|
-
careamics/dataset/dataset_utils/iterate_over_files.py,sha256=
|
|
62
|
-
careamics/dataset/dataset_utils/read_tiff.py,sha256=emzQgodEaBsLB0ULH4lUUbsDd9PylR8DQ3rb7g0l2b8,1336
|
|
63
|
-
careamics/dataset/dataset_utils/read_utils.py,sha256=0nsfzHq3zr9kjm2qZZrMRKI5LC5MiRSH35xPBCYyBrQ,579
|
|
64
|
-
careamics/dataset/dataset_utils/read_zarr.py,sha256=2jzREAnJDQSv0qmsL-v00BxmiZ_sp0ijq667LZSQ_hY,1685
|
|
53
|
+
careamics/dataset/dataset_utils/file_utils.py,sha256=4Aq92wz9M7esrujDbOxw1WNoYLlEjBRa4sOzf2Aw61c,4070
|
|
54
|
+
careamics/dataset/dataset_utils/iterate_over_files.py,sha256=TcX24NRt2cdM9gmmQV2f5ziwXxRne2-zePzz3DDFSMA,2871
|
|
65
55
|
careamics/dataset/dataset_utils/running_stats.py,sha256=0uOLaXpNwmY4lIElsHg4Ezf1YRbHy9An8GHXGYOaYmg,5565
|
|
66
56
|
careamics/dataset/patching/__init__.py,sha256=7-s12oUAZNlMOwSkxSwbD7vojQINWYFzn_4qIJ87WBg,37
|
|
67
|
-
careamics/dataset/patching/patching.py,sha256=
|
|
57
|
+
careamics/dataset/patching/patching.py,sha256=deAxY34Iz-mguBlHQ-5EO4vRhPpR9I3LQ9onV1K_KqA,8858
|
|
68
58
|
careamics/dataset/patching/random_patching.py,sha256=61sLxA4eJN5TIWBVIDZdJahS_CkclpM7Kc_VdPj91dU,6486
|
|
69
59
|
careamics/dataset/patching/sequential_patching.py,sha256=_l3Q2uYIhjMJMaxDdSbHC9_2kRF9eLz-Xs3r9i7j3Nc,5903
|
|
70
60
|
careamics/dataset/patching/validate_patch_dimension.py,sha256=sQQ0-4b4uu60MNKkoWv95KxQ80J7Ku0CEk0-kAXlKeI,2134
|
|
71
61
|
careamics/dataset/tiling/__init__.py,sha256=XynyAz85hVfkLtrG0lrMr_aBQm_YEwfu5uFcXMGHlOA,190
|
|
72
62
|
careamics/dataset/tiling/collate_tiles.py,sha256=OrPZ-n-V3uGOc_7CcPnyEJqdbEVDlTfJfWmZnyBZ-HA,978
|
|
73
63
|
careamics/dataset/tiling/tiled_patching.py,sha256=Zhhc0TwXVy4P_tZxS3B5tQZK6SRhGiQwnzVr-1BC4ww,5952
|
|
64
|
+
careamics/file_io/__init__.py,sha256=HRLEqH04njrhP2jdqiyqSkjD4LcbvBtORqyuXzlMkKE,215
|
|
65
|
+
careamics/file_io/read/__init__.py,sha256=IlS9RKWFur-qd-uNQWd_Y8F1QuuE07vqkoc0L0YEGjE,233
|
|
66
|
+
careamics/file_io/read/get_func.py,sha256=yGXD0rTFD7u70FR0axrQtWies0aYW3iQ6f0Wfcd8z-8,1394
|
|
67
|
+
careamics/file_io/read/tiff.py,sha256=_WVqUycI4NMk2GzDBEOWcGuSr1293673A1vs7WvZbS4,1358
|
|
68
|
+
careamics/file_io/read/zarr.py,sha256=2jzREAnJDQSv0qmsL-v00BxmiZ_sp0ijq667LZSQ_hY,1685
|
|
69
|
+
careamics/file_io/write/__init__.py,sha256=QkjBFofsA40_D6lQai5t3X3Lr9rZHK-W_DhMeDFHj8w,192
|
|
70
|
+
careamics/file_io/write/get_func.py,sha256=KATtExa2l4TvQSjOgPTM0e1Yy55bKaQv9gmW7aKn1_Y,1526
|
|
71
|
+
careamics/file_io/write/tiff.py,sha256=YU0TarBCG3w1f_HMZ_Hy7ifVdadgp9CuUD1l5_IY6zg,997
|
|
72
|
+
careamics/lightning/__init__.py,sha256=IAhfuveylgTdwIqynRqmGNOGrBlNmsXNgK3TuPDqU-o,572
|
|
73
|
+
careamics/lightning/lightning_module.py,sha256=ml0aGFP6MlSRtGkcoWcmX9DAlMSqJ8rW16HObBWK9MI,8881
|
|
74
|
+
careamics/lightning/predict_data_module.py,sha256=rgHhS5fKoa5wscWyvmPP_FHHdVnDnLbF4sG7y_C7ZOM,12747
|
|
75
|
+
careamics/lightning/train_data_module.py,sha256=72G19J26fg_kkNtCO2M9pcjq9sVkchL7MvZ8wrjS1So,27891
|
|
76
|
+
careamics/lightning/callbacks/__init__.py,sha256=spxJlDByD-6QtMl9vcIty8Wb0tyHaSTKTItozHenI44,204
|
|
77
|
+
careamics/lightning/callbacks/hyperparameters_callback.py,sha256=ODJpwwdgc1-Py8yEUpXLar8_IOAcfR7lF3--6LfSiGc,1496
|
|
78
|
+
careamics/lightning/callbacks/progress_bar_callback.py,sha256=8HvNSWZldixd6pjz0dLDo0apIbzTovv5smKmZ6tZQ8U,2444
|
|
74
79
|
careamics/losses/__init__.py,sha256=kVEwfZ2xXfd8x0n-VHGKm6qvzbto5pIIJYP_jN-bCtw,89
|
|
75
80
|
careamics/losses/loss_factory.py,sha256=vaMlxH5oescWTKlK1adWwbeD9tW4Ti-p7qKmc1iHCi0,1005
|
|
76
81
|
careamics/losses/losses.py,sha256=DKwHZ9ifVe6wMd3tBOiswLC-saU1bj1RCcXGOkREmKU,2328
|
|
@@ -84,8 +89,8 @@ careamics/lvae_training/metrics.py,sha256=KTDAKhe3vh-YxzGibjtkIG2nnUyujbnwqX4xGw
|
|
|
84
89
|
careamics/lvae_training/train_lvae.py,sha256=Eu--3-RHSfhQVsJ-CTDXhUeoM1fzf_H9IGtBaNPOsHI,11044
|
|
85
90
|
careamics/lvae_training/train_utils.py,sha256=e-d4QsF-li8MmAPkAmB1daHpkuU16nBTnQFZYqpTjn4,3567
|
|
86
91
|
careamics/model_io/__init__.py,sha256=HITzjiuZQwo-rQ2_Ma3bz9l7PDANv1_S489E-tffV9s,155
|
|
87
|
-
careamics/model_io/bmz_io.py,sha256=
|
|
88
|
-
careamics/model_io/model_io_utils.py,sha256=
|
|
92
|
+
careamics/model_io/bmz_io.py,sha256=53PvOMTZ3ZkSgFg-OtGopuf_vJ51xs6nfv1v0tufd7g,7041
|
|
93
|
+
careamics/model_io/model_io_utils.py,sha256=EebZL3t6oIHY0kuTKacmAEriTQ4B77KuAQ84UHG7XW4,2357
|
|
89
94
|
careamics/model_io/bioimage/__init__.py,sha256=r94nu8WDAvj0Fbu4C-iJXdOhfSQXeZBvN3UKsLG0RNI,298
|
|
90
95
|
careamics/model_io/bioimage/_readme_factory.py,sha256=LZAuEiWNBTPaD8KrLPMq16yJuOPKDZiGQuTMHKLvoT4,3514
|
|
91
96
|
careamics/model_io/bioimage/bioimage_utils.py,sha256=nlW0J1daYyLbL6yVN3QSn3HhA2joMjIG-thK64lpVTY,1085
|
|
@@ -101,10 +106,9 @@ careamics/models/lvae/likelihoods.py,sha256=FRFTh34FaBLGxn9OXFzqFyHhhJMSKYhgqxwG
|
|
|
101
106
|
careamics/models/lvae/lvae.py,sha256=5RlK4-h55dGz9UMCh8JCbLsaaIQ5S2IKGeI9d4nD5dA,40167
|
|
102
107
|
careamics/models/lvae/noise_models.py,sha256=yotY5gkPAowbI7esOmHlzBWcSsZlH2G3U7uYIWghGwY,15703
|
|
103
108
|
careamics/models/lvae/utils.py,sha256=muy4nLHmnB3BPAI0tQbJK_vVtBZOLBvhrJigHIOx5V4,11542
|
|
104
|
-
careamics/prediction_utils/__init__.py,sha256=
|
|
105
|
-
careamics/prediction_utils/
|
|
106
|
-
careamics/prediction_utils/
|
|
107
|
-
careamics/prediction_utils/stitch_prediction.py,sha256=VRJc51KHg_3gWTCNdvQpHfrGaNqDHd9hHhnvqxg2cjE,3081
|
|
109
|
+
careamics/prediction_utils/__init__.py,sha256=uYKzirlF-unFL9GbDPxFnYgOwSjGAtik9fonU7DfuEY,270
|
|
110
|
+
careamics/prediction_utils/prediction_outputs.py,sha256=cHbt45txofkMBWMUpJmdwOgHgG2By1gwnR6ZQv4n5qU,4104
|
|
111
|
+
careamics/prediction_utils/stitch_prediction.py,sha256=XSu2aSEbX1oXaXxhkXMnmhy2gKE8W28CmzH_bNc1Cm8,3369
|
|
108
112
|
careamics/transforms/__init__.py,sha256=VIHIsC8sMAh1TCm67ifB816Zp-LRo6rAONPuT2Qs3bs,483
|
|
109
113
|
careamics/transforms/compose.py,sha256=mTkhoxvgvsBqNoz9RWpJ_tqsDl1CDp0-UARTjUuBRf4,3477
|
|
110
114
|
careamics/transforms/n2v_manipulate.py,sha256=Gty7Jtu-RiFb1EnlrOi652qAOGKU5ZHvidRvykWqJxg,5438
|
|
@@ -115,7 +119,8 @@ careamics/transforms/transform.py,sha256=cEqc4ci8na70i-HIGYC7udRfVa8D_8OjdRVrr3t
|
|
|
115
119
|
careamics/transforms/tta.py,sha256=78S7Df9rLHmEVSQSI1qDcRrRJGauyG3oaIrXkckCkmw,2335
|
|
116
120
|
careamics/transforms/xy_flip.py,sha256=Q1kKTa2kE3W1P3dlpT4GAVSSHM3TebnrvIyWh75Fnko,3443
|
|
117
121
|
careamics/transforms/xy_random_rotate90.py,sha256=zWdBROLLjgxTMSQEQesJr17j84BmZhKWCMVVONHU8mw,2781
|
|
118
|
-
careamics/utils/__init__.py,sha256=
|
|
122
|
+
careamics/utils/__init__.py,sha256=rG_dnqX7rdyNTFWlDkIdNtDwwMQBpg_ym14ZFeYrWfs,402
|
|
123
|
+
careamics/utils/autocorrelation.py,sha256=M_WYzrEOQngc5iSXWar4S3-EOnK6DfYHPC2vVMeu_Bs,945
|
|
119
124
|
careamics/utils/base_enum.py,sha256=bz1D8mDx5V5hdnJ3WAzJXWHJTbgwAky5FprUt9F5cMA,1387
|
|
120
125
|
careamics/utils/context.py,sha256=Ljf70OR1FcYpsVpxb5Sr2fzmPVIZgDS1uZob_3BcELg,1409
|
|
121
126
|
careamics/utils/logging.py,sha256=coIscjkDYpqcsGnsONuYOdIYd6_gHxdnYIZ-e9Y2Ybg,10322
|
|
@@ -124,7 +129,7 @@ careamics/utils/path_utils.py,sha256=8AugiG5DOmzgSnTCJI8vypXaPE0XhnR-9pzeiFUZ-0I
|
|
|
124
129
|
careamics/utils/ram.py,sha256=tksyn8dVX_iJXmrDZDGub32hFZWIaNxnMheO5G1p43I,244
|
|
125
130
|
careamics/utils/receptive_field.py,sha256=Y2h4c8S6glX3qcx5KHDmO17Kkuyey9voxfoXyqcAfiM,3296
|
|
126
131
|
careamics/utils/torch_utils.py,sha256=g1zxdlM7_BA7mMLcCzmrxZX4LmH__KXlJibC95muVaA,3014
|
|
127
|
-
careamics-0.1.
|
|
128
|
-
careamics-0.1.
|
|
129
|
-
careamics-0.1.
|
|
130
|
-
careamics-0.1.
|
|
132
|
+
careamics-0.1.0rc8.dist-info/METADATA,sha256=7hTsctBI62YC9wmgYwUaByOXUJzKrlHLV8iMpnTNY00,3525
|
|
133
|
+
careamics-0.1.0rc8.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
134
|
+
careamics-0.1.0rc8.dist-info/licenses/LICENSE,sha256=6zdNW-k_xHRKYWUf9tDI_ZplUciFHyj0g16DYuZ2udw,1509
|
|
135
|
+
careamics-0.1.0rc8.dist-info/RECORD,,
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"""Example of configurations."""
|
|
2
|
-
|
|
3
|
-
from .algorithm_model import AlgorithmConfig
|
|
4
|
-
from .architectures import UNetModel
|
|
5
|
-
from .configuration_model import Configuration
|
|
6
|
-
from .data_model import DataConfig
|
|
7
|
-
from .optimizer_models import LrSchedulerModel, OptimizerModel
|
|
8
|
-
from .support import (
|
|
9
|
-
SupportedActivation,
|
|
10
|
-
SupportedAlgorithm,
|
|
11
|
-
SupportedArchitecture,
|
|
12
|
-
SupportedData,
|
|
13
|
-
SupportedLogger,
|
|
14
|
-
SupportedLoss,
|
|
15
|
-
SupportedOptimizer,
|
|
16
|
-
SupportedPixelManipulation,
|
|
17
|
-
SupportedScheduler,
|
|
18
|
-
SupportedTransform,
|
|
19
|
-
)
|
|
20
|
-
from .training_model import TrainingConfig
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def full_configuration_example() -> Configuration:
|
|
24
|
-
"""Return a dictionnary representing a full configuration example.
|
|
25
|
-
|
|
26
|
-
Returns
|
|
27
|
-
-------
|
|
28
|
-
Configuration
|
|
29
|
-
Full configuration example.
|
|
30
|
-
"""
|
|
31
|
-
experiment_name = "Full example"
|
|
32
|
-
algorithm_model = AlgorithmConfig(
|
|
33
|
-
algorithm=SupportedAlgorithm.N2V.value,
|
|
34
|
-
loss=SupportedLoss.N2V.value,
|
|
35
|
-
model=UNetModel(
|
|
36
|
-
architecture=SupportedArchitecture.UNET.value,
|
|
37
|
-
in_channels=1,
|
|
38
|
-
num_classes=1,
|
|
39
|
-
depth=2,
|
|
40
|
-
num_channels_init=32,
|
|
41
|
-
final_activation=SupportedActivation.NONE.value,
|
|
42
|
-
n2v2=True,
|
|
43
|
-
),
|
|
44
|
-
optimizer=OptimizerModel(
|
|
45
|
-
name=SupportedOptimizer.ADAM.value, parameters={"lr": 0.0001}
|
|
46
|
-
),
|
|
47
|
-
lr_scheduler=LrSchedulerModel(
|
|
48
|
-
name=SupportedScheduler.REDUCE_LR_ON_PLATEAU.value,
|
|
49
|
-
),
|
|
50
|
-
)
|
|
51
|
-
data_model = DataConfig(
|
|
52
|
-
data_type=SupportedData.ARRAY.value,
|
|
53
|
-
patch_size=(256, 256),
|
|
54
|
-
batch_size=8,
|
|
55
|
-
axes="YX",
|
|
56
|
-
transforms=[
|
|
57
|
-
{
|
|
58
|
-
"name": SupportedTransform.XY_FLIP.value,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"name": SupportedTransform.XY_RANDOM_ROTATE90.value,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": SupportedTransform.N2V_MANIPULATE.value,
|
|
65
|
-
"roi_size": 11,
|
|
66
|
-
"masked_pixel_percentage": 0.2,
|
|
67
|
-
"strategy": SupportedPixelManipulation.MEDIAN.value,
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
mean=0.485,
|
|
71
|
-
std=0.229,
|
|
72
|
-
dataloader_params={
|
|
73
|
-
"num_workers": 4,
|
|
74
|
-
},
|
|
75
|
-
)
|
|
76
|
-
training_model = TrainingConfig(
|
|
77
|
-
num_epochs=30,
|
|
78
|
-
logger=SupportedLogger.WANDB.value,
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
return Configuration(
|
|
82
|
-
experiment_name=experiment_name,
|
|
83
|
-
algorithm_config=algorithm_model,
|
|
84
|
-
data_config=data_model,
|
|
85
|
-
training_config=training_model,
|
|
86
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"""Read function utilities."""
|
|
2
|
-
|
|
3
|
-
from typing import Callable, Union
|
|
4
|
-
|
|
5
|
-
from careamics.config.support import SupportedData
|
|
6
|
-
|
|
7
|
-
from .read_tiff import read_tiff
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def get_read_func(data_type: Union[SupportedData, str]) -> Callable:
|
|
11
|
-
"""
|
|
12
|
-
Get the read function for the data type.
|
|
13
|
-
|
|
14
|
-
Parameters
|
|
15
|
-
----------
|
|
16
|
-
data_type : SupportedData
|
|
17
|
-
Data type.
|
|
18
|
-
|
|
19
|
-
Returns
|
|
20
|
-
-------
|
|
21
|
-
Callable
|
|
22
|
-
Read function.
|
|
23
|
-
"""
|
|
24
|
-
if data_type == SupportedData.TIFF:
|
|
25
|
-
return read_tiff
|
|
26
|
-
else:
|
|
27
|
-
raise NotImplementedError(f"Data type {data_type} is not supported.")
|