From 280492be8a84f2d6b8b270d6addf69f3c39bc9c2 Mon Sep 17 00:00:00 2001 From: rhoadesScholar Date: Fri, 26 Jul 2024 14:31:01 +0000 Subject: [PATCH] deploy: 68c11d099ebf404cffb6603bd885578c69868c76 --- .buildinfo | 2 +- _modules/cellmap_data/dataloader.html | 69 ++----------- _modules/cellmap_data/dataset.html | 69 ++----------- _modules/cellmap_data/datasplit.html | 69 ++----------- _modules/cellmap_data/image.html | 81 +++------------- _modules/cellmap_data/multidataset.html | 69 ++----------- _modules/cellmap_data/subdataset.html | 69 ++----------- .../transforms/augment/gaussian_noise.html | 69 ++----------- .../transforms/augment/nan_to_num.html | 69 ++----------- .../transforms/augment/normalize.html | 69 ++----------- .../transforms/augment/random_contrast.html | 69 ++----------- .../transforms/augment/random_gamma.html | 69 ++----------- .../transforms/targets/cellpose.html | 75 +++------------ .../transforms/targets/distance.html | 85 ++++------------ _modules/cellmap_data/utils/dtype.html | 69 ++----------- _modules/cellmap_data/utils/figs.html | 69 ++----------- _modules/index.html | 69 ++----------- _sources/index.rst | 7 ++ cellmap_data.CellMapDataLoader.html | 81 +++------------- cellmap_data.CellMapDataSplit.html | 91 +++--------------- cellmap_data.CellMapDataset.html | 91 +++--------------- cellmap_data.CellMapImage.html | 91 +++--------------- cellmap_data.CellMapMultiDataset.html | 91 +++--------------- cellmap_data.CellMapSubset.html | 91 +++--------------- cellmap_data.dataloader.html | 89 ++--------------- cellmap_data.dataset.html | 89 ++--------------- cellmap_data.datasplit.html | 89 ++--------------- cellmap_data.html | 89 ++--------------- cellmap_data.image.html | 89 ++--------------- cellmap_data.multidataset.html | 89 ++--------------- cellmap_data.subdataset.html | 89 ++--------------- ...ata.transforms.augment.gaussian_noise.html | 89 ++--------------- cellmap_data.transforms.augment.html | 89 ++--------------- ...ap_data.transforms.augment.nan_to_num.html | 89 ++--------------- ...map_data.transforms.augment.normalize.html | 89 ++--------------- ...ta.transforms.augment.random_contrast.html | 89 ++--------------- ..._data.transforms.augment.random_gamma.html | 89 ++--------------- cellmap_data.transforms.html | 89 ++--------------- cellmap_data.transforms.targets.cellpose.html | 89 ++--------------- cellmap_data.transforms.targets.distance.html | 89 ++--------------- cellmap_data.transforms.targets.html | 89 ++--------------- cellmap_data.utils.dtype.html | 89 ++--------------- cellmap_data.utils.figs.html | 89 ++--------------- cellmap_data.utils.html | 89 ++--------------- genindex.html | 69 ++----------- index.html | 84 +++------------- modules.html | 69 ++----------- objects.inv | Bin 2527 -> 2537 bytes py-modindex.html | 69 ++----------- search.html | 69 ++----------- searchindex.js | 2 +- 51 files changed, 468 insertions(+), 3357 deletions(-) diff --git a/.buildinfo b/.buildinfo index c37cbac..396d03e 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: dfea3737e91c2b1d2c45602070b0e8ef +config: fbb4a0474d649aef965cde0860227e97 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_modules/cellmap_data/dataloader.html b/_modules/cellmap_data/dataloader.html index e122534..b4403fc 100644 --- a/_modules/cellmap_data/dataloader.html +++ b/_modules/cellmap_data/dataloader.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/dataset.html b/_modules/cellmap_data/dataset.html index eec99a9..49ef031 100644 --- a/_modules/cellmap_data/dataset.html +++ b/_modules/cellmap_data/dataset.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/datasplit.html b/_modules/cellmap_data/datasplit.html index 307b1d0..2e0d40e 100644 --- a/_modules/cellmap_data/datasplit.html +++ b/_modules/cellmap_data/datasplit.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/image.html b/_modules/cellmap_data/image.html index e3d574e..e7f3dd5 100644 --- a/_modules/cellmap_data/image.html +++ b/_modules/cellmap_data/image.html @@ -154,66 +154,15 @@ @@ -750,12 +699,12 @@

Source code for cellmap_data.image

         # Apply and spatial transformations that require the image array (e.g. transpose)
         if self._current_spatial_transforms is not None:
             for transform, params in self._current_spatial_transforms.items():
-                if transform in self.post_image_transforms:
-                    if transform == "transpose":
-                        new_order = [params[c] for c in self.axes]
-                        data = np.transpose(data, new_order)
-                    else:
-                        raise ValueError(f"Unknown spatial transform: {transform}")
+                # if transform in self.post_image_transforms:
+                if transform == "transpose":
+                    new_order = [params[c] for c in self.axes]
+                    data = np.transpose(data, new_order)
+                    # else:
+                    #     raise ValueError(f"Unknown spatial transform: {transform}")
 
         return torch.tensor(data)
diff --git a/_modules/cellmap_data/multidataset.html b/_modules/cellmap_data/multidataset.html index c69c2ea..5b99be7 100644 --- a/_modules/cellmap_data/multidataset.html +++ b/_modules/cellmap_data/multidataset.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/subdataset.html b/_modules/cellmap_data/subdataset.html index 8ca0df4..1ec7bb9 100644 --- a/_modules/cellmap_data/subdataset.html +++ b/_modules/cellmap_data/subdataset.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/augment/gaussian_noise.html b/_modules/cellmap_data/transforms/augment/gaussian_noise.html index 4948249..4fbacd0 100644 --- a/_modules/cellmap_data/transforms/augment/gaussian_noise.html +++ b/_modules/cellmap_data/transforms/augment/gaussian_noise.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/augment/nan_to_num.html b/_modules/cellmap_data/transforms/augment/nan_to_num.html index 8068b46..5e76d34 100644 --- a/_modules/cellmap_data/transforms/augment/nan_to_num.html +++ b/_modules/cellmap_data/transforms/augment/nan_to_num.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/augment/normalize.html b/_modules/cellmap_data/transforms/augment/normalize.html index 3fe0570..ca13a63 100644 --- a/_modules/cellmap_data/transforms/augment/normalize.html +++ b/_modules/cellmap_data/transforms/augment/normalize.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/augment/random_contrast.html b/_modules/cellmap_data/transforms/augment/random_contrast.html index 9e37e01..0286593 100644 --- a/_modules/cellmap_data/transforms/augment/random_contrast.html +++ b/_modules/cellmap_data/transforms/augment/random_contrast.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/augment/random_gamma.html b/_modules/cellmap_data/transforms/augment/random_gamma.html index bb9d85a..519e3d8 100644 --- a/_modules/cellmap_data/transforms/augment/random_gamma.html +++ b/_modules/cellmap_data/transforms/augment/random_gamma.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/transforms/targets/cellpose.html b/_modules/cellmap_data/transforms/targets/cellpose.html index bbd66fc..9593d37 100644 --- a/_modules/cellmap_data/transforms/targets/cellpose.html +++ b/_modules/cellmap_data/transforms/targets/cellpose.html @@ -154,66 +154,15 @@ @@ -356,7 +305,11 @@

Source code for cellmap_data.transforms.targets.cellpose

self.device = _device def __call__(self, masks): - return self.flows_func(masks)
+ flows, centers = self.flows_func((masks > 0).squeeze().numpy()) + flows = flows[None, ...] + if self.ndim == 2: + flows = flows[None, ...] + return torch.tensor(flows) diff --git a/_modules/cellmap_data/transforms/targets/distance.html b/_modules/cellmap_data/transforms/targets/distance.html index aab3a4e..2da6016 100644 --- a/_modules/cellmap_data/transforms/targets/distance.html +++ b/_modules/cellmap_data/transforms/targets/distance.html @@ -154,66 +154,15 @@ @@ -370,10 +319,10 @@

Source code for cellmap_data.transforms.targets.distance

def forward(self, x: torch.Tensor): """Forward pass.""" # TODO: Need to figure out how to prevent having inaccurate distance values at the edges --> precompute - # distance = self._transform(x[b, class_ind].nan_to_num(0)) - distance = self._transform(x[b, class_ind]) - distance[x[b, class_ind].isnan()] = torch.nan - x[b, class_ind] = distance + # distance = self._transform(x.nan_to_num(0)) + distance = self._transform(x) + distance[x.isnan()] = torch.nan + x = distance return x
@@ -426,10 +375,10 @@

Source code for cellmap_data.transforms.targets.distance

def forward(self, x: torch.Tensor): """Forward pass.""" # TODO: Need to figure out how to prevent having inaccurate distance values at the edges --> precompute - # distance = self._transform(x[b, class_ind].nan_to_num(0)) - distance = self._transform(x[b, class_ind]) - distance[x[b, class_ind].isnan()] = torch.nan - x[b, class_ind] = distance + # distance = self._transform(x.nan_to_num(0)) + distance = self._transform(x) + distance[x.isnan()] = torch.nan + x = distance return x
diff --git a/_modules/cellmap_data/utils/dtype.html b/_modules/cellmap_data/utils/dtype.html index b3ebc53..c101f46 100644 --- a/_modules/cellmap_data/utils/dtype.html +++ b/_modules/cellmap_data/utils/dtype.html @@ -154,66 +154,15 @@ diff --git a/_modules/cellmap_data/utils/figs.html b/_modules/cellmap_data/utils/figs.html index 2c78ae9..9b2c5c5 100644 --- a/_modules/cellmap_data/utils/figs.html +++ b/_modules/cellmap_data/utils/figs.html @@ -154,66 +154,15 @@ diff --git a/_modules/index.html b/_modules/index.html index ea56ae6..54d93fa 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -154,66 +154,15 @@ diff --git a/_sources/index.rst b/_sources/index.rst index 33023ab..534c4ca 100644 --- a/_sources/index.rst +++ b/_sources/index.rst @@ -10,7 +10,11 @@ CellMap-Data: the Docs This library provides a collection of classes and functions for working with cellmap data, specifically for the CellMap project team training machine learning models. The capabilities include loading data from the CellMap ZarrDataset, transforming data, and splitting data into training and validation sets. Functionality is not provided for writing data. + +Contents +============== .. autosummary:: + :recursive: :toctree: @@ -25,6 +29,9 @@ This library provides a collection of classes and functions for working with cel cellmap_data.utils +.. include:: ../../README.md + :parser: recommonmark + Links ================== diff --git a/cellmap_data.CellMapDataLoader.html b/cellmap_data.CellMapDataLoader.html index 75b6897..81f1c8d 100644 --- a/cellmap_data.CellMapDataLoader.html +++ b/cellmap_data.CellMapDataLoader.html @@ -44,7 +44,6 @@ - @@ -107,6 +106,8 @@ + +
@@ -154,66 +155,15 @@
@@ -469,15 +419,6 @@

cellmap_data.CellMapDataLoader diff --git a/cellmap_data.CellMapDataSplit.html b/cellmap_data.CellMapDataSplit.html index b281727..192fe9f 100644 --- a/cellmap_data.CellMapDataSplit.html +++ b/cellmap_data.CellMapDataSplit.html @@ -44,8 +44,6 @@ - - @@ -108,6 +106,8 @@ + +
@@ -155,66 +155,15 @@
@@ -718,24 +667,6 @@

cellmap_data.CellMapDataSplit diff --git a/cellmap_data.CellMapDataset.html b/cellmap_data.CellMapDataset.html index 36ded81..6131ba8 100644 --- a/cellmap_data.CellMapDataset.html +++ b/cellmap_data.CellMapDataset.html @@ -44,8 +44,6 @@ - - @@ -108,6 +106,8 @@ + +
@@ -155,66 +155,15 @@
@@ -817,24 +766,6 @@

cellmap_data.CellMapDataset diff --git a/cellmap_data.CellMapImage.html b/cellmap_data.CellMapImage.html index bc9f21c..e0777d1 100644 --- a/cellmap_data.CellMapImage.html +++ b/cellmap_data.CellMapImage.html @@ -44,8 +44,6 @@ - - @@ -108,6 +106,8 @@ + +
@@ -155,66 +155,15 @@
@@ -716,24 +665,6 @@

cellmap_data.CellMapImage diff --git a/cellmap_data.CellMapMultiDataset.html b/cellmap_data.CellMapMultiDataset.html index 1e56751..efae104 100644 --- a/cellmap_data.CellMapMultiDataset.html +++ b/cellmap_data.CellMapMultiDataset.html @@ -44,8 +44,6 @@ - - @@ -108,6 +106,8 @@ + +
@@ -155,66 +155,15 @@
@@ -734,24 +683,6 @@

cellmap_data.CellMapMultiDataset diff --git a/cellmap_data.CellMapSubset.html b/cellmap_data.CellMapSubset.html index e24d054..bd04565 100644 --- a/cellmap_data.CellMapSubset.html +++ b/cellmap_data.CellMapSubset.html @@ -44,8 +44,6 @@ - - @@ -108,6 +106,8 @@ + +
@@ -155,66 +155,15 @@
@@ -536,24 +485,6 @@

cellmap_data.CellMapSubset diff --git a/cellmap_data.dataloader.html b/cellmap_data.dataloader.html index bcaabc8..15b59ab 100644 --- a/cellmap_data.dataloader.html +++ b/cellmap_data.dataloader.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -442,24 +389,6 @@

Contents

diff --git a/cellmap_data.dataset.html b/cellmap_data.dataset.html index 00cd2c6..f581eba 100644 --- a/cellmap_data.dataset.html +++ b/cellmap_data.dataset.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -723,24 +670,6 @@

Contents

diff --git a/cellmap_data.datasplit.html b/cellmap_data.datasplit.html index ae7298d..534e8ce 100644 --- a/cellmap_data.datasplit.html +++ b/cellmap_data.datasplit.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -604,24 +551,6 @@

Contents

diff --git a/cellmap_data.html b/cellmap_data.html index 2d317ae..569f183 100644 --- a/cellmap_data.html +++ b/cellmap_data.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -411,24 +358,6 @@

cellmap_data

diff --git a/cellmap_data.image.html b/cellmap_data.image.html index 515b15d..2ff65b8 100644 --- a/cellmap_data.image.html +++ b/cellmap_data.image.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -721,24 +668,6 @@

Contents

diff --git a/cellmap_data.multidataset.html b/cellmap_data.multidataset.html index fc8db70..b80b1b3 100644 --- a/cellmap_data.multidataset.html +++ b/cellmap_data.multidataset.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -673,24 +620,6 @@

Contents

diff --git a/cellmap_data.subdataset.html b/cellmap_data.subdataset.html index 0a9c0b9..09c0621 100644 --- a/cellmap_data.subdataset.html +++ b/cellmap_data.subdataset.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -496,24 +443,6 @@

Contents

diff --git a/cellmap_data.transforms.augment.gaussian_noise.html b/cellmap_data.transforms.augment.gaussian_noise.html index cf033e5..7002c14 100644 --- a/cellmap_data.transforms.augment.gaussian_noise.html +++ b/cellmap_data.transforms.augment.gaussian_noise.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -420,24 +367,6 @@

Contents

diff --git a/cellmap_data.transforms.augment.html b/cellmap_data.transforms.augment.html index cdc7c9e..1c9405d 100644 --- a/cellmap_data.transforms.augment.html +++ b/cellmap_data.transforms.augment.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -399,24 +346,6 @@

cellmap_data.transforms.augment

diff --git a/cellmap_data.transforms.augment.nan_to_num.html b/cellmap_data.transforms.augment.nan_to_num.html index 4f8e8e0..e8eb782 100644 --- a/cellmap_data.transforms.augment.nan_to_num.html +++ b/cellmap_data.transforms.augment.nan_to_num.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -408,24 +355,6 @@

Contents

diff --git a/cellmap_data.transforms.augment.normalize.html b/cellmap_data.transforms.augment.normalize.html index 6229bf7..0735965 100644 --- a/cellmap_data.transforms.augment.normalize.html +++ b/cellmap_data.transforms.augment.normalize.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -403,24 +350,6 @@

Contents

diff --git a/cellmap_data.transforms.augment.random_contrast.html b/cellmap_data.transforms.augment.random_contrast.html index e6c8dcf..ba31b6f 100644 --- a/cellmap_data.transforms.augment.random_contrast.html +++ b/cellmap_data.transforms.augment.random_contrast.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -422,24 +369,6 @@

Contents

diff --git a/cellmap_data.transforms.augment.random_gamma.html b/cellmap_data.transforms.augment.random_gamma.html index 6cfe9e4..7663681 100644 --- a/cellmap_data.transforms.augment.random_gamma.html +++ b/cellmap_data.transforms.augment.random_gamma.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -422,24 +369,6 @@

Contents

diff --git a/cellmap_data.transforms.html b/cellmap_data.transforms.html index 25e181a..d6eb0bf 100644 --- a/cellmap_data.transforms.html +++ b/cellmap_data.transforms.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -390,24 +337,6 @@

cellmap_data.transforms

diff --git a/cellmap_data.transforms.targets.cellpose.html b/cellmap_data.transforms.targets.cellpose.html index ad39c93..1ce134c 100644 --- a/cellmap_data.transforms.targets.cellpose.html +++ b/cellmap_data.transforms.targets.cellpose.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -412,24 +359,6 @@

Contents

diff --git a/cellmap_data.transforms.targets.distance.html b/cellmap_data.transforms.targets.distance.html index 9c49c6c..0a4cf57 100644 --- a/cellmap_data.transforms.targets.distance.html +++ b/cellmap_data.transforms.targets.distance.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -472,24 +419,6 @@

Contents

diff --git a/cellmap_data.transforms.targets.html b/cellmap_data.transforms.targets.html index b798a02..2f19bb8 100644 --- a/cellmap_data.transforms.targets.html +++ b/cellmap_data.transforms.targets.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -390,24 +337,6 @@

cellmap_data.transforms.targets

diff --git a/cellmap_data.utils.dtype.html b/cellmap_data.utils.dtype.html index 2bee043..476da36 100644 --- a/cellmap_data.utils.dtype.html +++ b/cellmap_data.utils.dtype.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -414,24 +361,6 @@

Contents

diff --git a/cellmap_data.utils.figs.html b/cellmap_data.utils.figs.html index dd64e4c..970b579 100644 --- a/cellmap_data.utils.figs.html +++ b/cellmap_data.utils.figs.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -461,24 +408,6 @@

Contents

diff --git a/cellmap_data.utils.html b/cellmap_data.utils.html index d073eaf..d981c53 100644 --- a/cellmap_data.utils.html +++ b/cellmap_data.utils.html @@ -44,8 +44,6 @@ - - @@ -155,66 +153,15 @@ @@ -390,24 +337,6 @@

cellmap_data.utils

diff --git a/genindex.html b/genindex.html index 771bfb4..d401409 100644 --- a/genindex.html +++ b/genindex.html @@ -154,66 +154,15 @@ diff --git a/index.html b/index.html index 183287b..8770a91 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,6 @@ - @@ -156,66 +155,15 @@ @@ -363,6 +311,7 @@

Contents