From d6c2cf48f6fe4ff7da57e80e66915d3621a7b107 Mon Sep 17 00:00:00 2001 From: Ashesh Date: Wed, 11 Sep 2024 14:17:22 +0200 Subject: [PATCH 1/6] bug fix to avoid adding more noise to target. This affected LC based setups with synthetic noise --- src/careamics/lvae_training/dataset/lc_dataset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/careamics/lvae_training/dataset/lc_dataset.py b/src/careamics/lvae_training/dataset/lc_dataset.py index 596337c10..c2cdb4c70 100644 --- a/src/careamics/lvae_training/dataset/lc_dataset.py +++ b/src/careamics/lvae_training/dataset/lc_dataset.py @@ -227,6 +227,7 @@ def __getitem__(self, index: Union[int, Tuple[int, int]]): factor = np.sqrt(2) if self._input_is_sum else 1.0 input_tuples = [] for x in img_tuples: + x = x.copy() # to avoid changing the original image since it is later used for target # NOTE: other LC levels already have noise added. So, we just need to add noise to the highest resolution. x[0] = x[0] + noise_tuples[0] * factor input_tuples.append(x) From 0c11d6c853a6d8b1dde192938e4161e1e8fd1022 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:20:09 +0000 Subject: [PATCH 2/6] style(pre-commit.ci): auto fixes [...] --- src/careamics/lvae_training/dataset/lc_dataset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/careamics/lvae_training/dataset/lc_dataset.py b/src/careamics/lvae_training/dataset/lc_dataset.py index c2cdb4c70..316d093ad 100644 --- a/src/careamics/lvae_training/dataset/lc_dataset.py +++ b/src/careamics/lvae_training/dataset/lc_dataset.py @@ -227,7 +227,9 @@ def __getitem__(self, index: Union[int, Tuple[int, int]]): factor = np.sqrt(2) if self._input_is_sum else 1.0 input_tuples = [] for x in img_tuples: - x = x.copy() # to avoid changing the original image since it is later used for target + x = ( + x.copy() + ) # to avoid changing the original image since it is later used for target # NOTE: other LC levels already have noise added. So, we just need to add noise to the highest resolution. x[0] = x[0] + noise_tuples[0] * factor input_tuples.append(x) From ff52714cfb2aac5ea8ed8d6caeaefdecea788a75 Mon Sep 17 00:00:00 2001 From: Ashesh Date: Wed, 13 Nov 2024 11:22:34 +0100 Subject: [PATCH 3/6] adding a enum for a new task --- src/careamics/lvae_training/dataset/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/careamics/lvae_training/dataset/types.py b/src/careamics/lvae_training/dataset/types.py index 4174afe4b..6927d65a3 100644 --- a/src/careamics/lvae_training/dataset/types.py +++ b/src/careamics/lvae_training/dataset/types.py @@ -15,6 +15,7 @@ class DataType(Enum): OptiMEM100_014 = 10 SeparateTiffData = 11 BioSR_MRC = 12 + MultiCropDset = 13 # for the case when we have a set of differently sized crops for each channel. class DataSplitType(Enum): From 2d52d36043fab52f2d80b8194a0b0ca0955a90c8 Mon Sep 17 00:00:00 2001 From: Ashesh Date: Wed, 13 Nov 2024 13:57:34 +0100 Subject: [PATCH 4/6] types --- src/careamics/lvae_training/dataset/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/careamics/lvae_training/dataset/types.py b/src/careamics/lvae_training/dataset/types.py index 6927d65a3..756034cda 100644 --- a/src/careamics/lvae_training/dataset/types.py +++ b/src/careamics/lvae_training/dataset/types.py @@ -15,7 +15,7 @@ class DataType(Enum): OptiMEM100_014 = 10 SeparateTiffData = 11 BioSR_MRC = 12 - MultiCropDset = 13 # for the case when we have a set of differently sized crops for each channel. + PunctaRemoval = 13 # for the case when we have a set of differently sized crops for each channel. class DataSplitType(Enum): From 24a8c05e808460b6672b7978ba0f14219aaa8306 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:04:23 +0000 Subject: [PATCH 5/6] style(pre-commit.ci): auto fixes [...] --- src/careamics/lvae_training/dataset/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/careamics/lvae_training/dataset/types.py b/src/careamics/lvae_training/dataset/types.py index 756034cda..5d0d9e0d9 100644 --- a/src/careamics/lvae_training/dataset/types.py +++ b/src/careamics/lvae_training/dataset/types.py @@ -15,7 +15,7 @@ class DataType(Enum): OptiMEM100_014 = 10 SeparateTiffData = 11 BioSR_MRC = 12 - PunctaRemoval = 13 # for the case when we have a set of differently sized crops for each channel. + PunctaRemoval = 13 # for the case when we have a set of differently sized crops for each channel. class DataSplitType(Enum): From db28c803e7b3ffa12758e91c7cf57ff958489520 Mon Sep 17 00:00:00 2001 From: Ashesh Date: Wed, 27 Nov 2024 14:25:53 +0100 Subject: [PATCH 6/6] types.py --- src/careamics/lvae_training/dataset/types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/careamics/lvae_training/dataset/types.py b/src/careamics/lvae_training/dataset/types.py index 5d0d9e0d9..7ae1230b5 100644 --- a/src/careamics/lvae_training/dataset/types.py +++ b/src/careamics/lvae_training/dataset/types.py @@ -16,6 +16,7 @@ class DataType(Enum): SeparateTiffData = 11 BioSR_MRC = 12 PunctaRemoval = 13 # for the case when we have a set of differently sized crops for each channel. + Care3D = 14 class DataSplitType(Enum):