From e47edeaacd4329895408522bac17bd40452af7ed Mon Sep 17 00:00:00 2001 From: Arthur Imbert Date: Thu, 14 May 2020 17:53:34 +0200 Subject: [PATCH] misc --- bigfish/detection/__init__.py | 4 ++-- bigfish/detection/cluster_decomposition.py | 5 +++-- bigfish/detection/tests/test_cluster_decomposition.py | 2 +- bigfish/detection/tests/test_foci_detection.py | 2 +- bigfish/detection/tests/test_spot_detection.py | 2 +- bigfish/detection/tests/test_utils.py | 2 +- bigfish/detection/utils.py | 4 ++-- bigfish/plot/__init__.py | 2 +- bigfish/plot/plot_classification.py | 3 +++ bigfish/plot/plot_images.py | 4 ++-- bigfish/plot/utils.py | 4 +++- bigfish/segmentation/__init__.py | 4 ++-- bigfish/segmentation/test/test_cell_segmentation.py | 2 +- bigfish/segmentation/test/test_nuc_segmentation.py | 2 +- bigfish/segmentation/test/test_utils.py | 2 +- bigfish/segmentation/utils.py | 2 +- bigfish/stack/__init__.py | 4 ++-- bigfish/stack/filter.py | 2 +- bigfish/stack/postprocess.py | 2 +- bigfish/stack/preprocess.py | 2 +- bigfish/stack/tests/test_augmentation.py | 2 +- bigfish/stack/tests/test_filter.py | 2 +- bigfish/stack/tests/test_io.py | 2 +- bigfish/stack/tests/test_postprocess.py | 2 +- bigfish/stack/tests/test_preprocess.py | 2 +- bigfish/stack/tests/test_projection.py | 2 +- bigfish/stack/tests/test_utils.py | 2 +- bigfish/stack/utils.py | 2 +- data/__init__.py | 2 +- data/utils.py | 3 ++- 30 files changed, 42 insertions(+), 35 deletions(-) diff --git a/bigfish/detection/__init__.py b/bigfish/detection/__init__.py index 7888672b..00875583 100644 --- a/bigfish/detection/__init__.py +++ b/bigfish/detection/__init__.py @@ -3,8 +3,8 @@ # License: BSD 3 clause """ -The bigfish.detection module includes function to detect RNA spot in 2-d and -3-d. +The bigfish.detection subpackage includes function to detect RNA spot in 2-d +and 3-d. """ from .utils import get_sigma diff --git a/bigfish/detection/cluster_decomposition.py b/bigfish/detection/cluster_decomposition.py index 85e18304..1fcdd8d6 100644 --- a/bigfish/detection/cluster_decomposition.py +++ b/bigfish/detection/cluster_decomposition.py @@ -20,10 +20,11 @@ from skimage.measure import label -# ### Main function ### - # TODO add parameter to detect more or less clusters # TODO add parameter to fit more or less spots in a cluster + +# ### Main function ### + def decompose_cluster(image, spots, voxel_size_z=None, voxel_size_yx=100, psf_z=None, psf_yx=200): """Detect potential regions with clustered spots and fit as many reference diff --git a/bigfish/detection/tests/test_cluster_decomposition.py b/bigfish/detection/tests/test_cluster_decomposition.py index 2087f21d..0ce88d8a 100644 --- a/bigfish/detection/tests/test_cluster_decomposition.py +++ b/bigfish/detection/tests/test_cluster_decomposition.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.cluster_decomposition submodule. +Unitary tests for bigfish.stack.cluster_decomposition module. """ # TODO test bigfish.detection.decompose_cluster diff --git a/bigfish/detection/tests/test_foci_detection.py b/bigfish/detection/tests/test_foci_detection.py index 9dfe777e..61714196 100644 --- a/bigfish/detection/tests/test_foci_detection.py +++ b/bigfish/detection/tests/test_foci_detection.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.foci_detection submodule. +Unitary tests for bigfish.stack.foci_detection module. """ # TODO test bigfish.detection.detect_foci diff --git a/bigfish/detection/tests/test_spot_detection.py b/bigfish/detection/tests/test_spot_detection.py index bd77fc38..bd55c8ab 100644 --- a/bigfish/detection/tests/test_spot_detection.py +++ b/bigfish/detection/tests/test_spot_detection.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.spot_detection submodule. +Unitary tests for bigfish.stack.spot_detection module. """ # TODO test bigfish.detection.spot_detector diff --git a/bigfish/detection/tests/test_utils.py b/bigfish/detection/tests/test_utils.py index 33261d45..cca5a1aa 100644 --- a/bigfish/detection/tests/test_utils.py +++ b/bigfish/detection/tests/test_utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.utils submodule. +Unitary tests for bigfish.stack.utils module. """ # TODO test bigfish.utils.get_sigma diff --git a/bigfish/detection/utils.py b/bigfish/detection/utils.py index 75414afb..d7ac8e4a 100644 --- a/bigfish/detection/utils.py +++ b/bigfish/detection/utils.py @@ -3,16 +3,16 @@ # License: BSD 3 clause """ -Utility functions for bigfish.stack submodule. +Utility functions for bigfish.stack subpackage. """ import bigfish.stack as stack import numpy as np + # TODO add function to calibrate psf # TODO add function to compute signal-to-noise ratio - # ### Signal-to-Noise ratio ### def compute_snr(image, sigma, minimum_distance=1, diff --git a/bigfish/plot/__init__.py b/bigfish/plot/__init__.py index ec42cf35..d706aff6 100644 --- a/bigfish/plot/__init__.py +++ b/bigfish/plot/__init__.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -The bigfish.plot module includes functions to plot images and results. +The bigfish.plot subpackage includes functions to plot images and results. """ from .plot_images import plot_yx diff --git a/bigfish/plot/plot_classification.py b/bigfish/plot/plot_classification.py index c0ac2b8a..56335230 100644 --- a/bigfish/plot/plot_classification.py +++ b/bigfish/plot/plot_classification.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- +# Author: Arthur Imbert +# License: BSD 3 clause """ Functions to plot results from classification model. """ + import matplotlib.pyplot as plt import numpy as np diff --git a/bigfish/plot/plot_images.py b/bigfish/plot/plot_images.py index 64bec6ce..68b24f48 100644 --- a/bigfish/plot/plot_images.py +++ b/bigfish/plot/plot_images.py @@ -10,11 +10,11 @@ import bigfish.stack as stack +from .utils import save_plot, get_minmax_values + import matplotlib.pyplot as plt import numpy as np -from .utils import save_plot, get_minmax_values - from skimage.segmentation import find_boundaries from matplotlib.colors import ListedColormap from matplotlib.patches import RegularPolygon diff --git a/bigfish/plot/utils.py b/bigfish/plot/utils.py index 16f0fe10..d71f8bc3 100644 --- a/bigfish/plot/utils.py +++ b/bigfish/plot/utils.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- +# Author: Arthur Imbert +# License: BSD 3 clause """ -Utility functions for bigfish.plot submodule. +Utility functions for bigfish.plot subpackage. """ import matplotlib.pyplot as plt diff --git a/bigfish/segmentation/__init__.py b/bigfish/segmentation/__init__.py index dc0744cf..fd12e5fb 100644 --- a/bigfish/segmentation/__init__.py +++ b/bigfish/segmentation/__init__.py @@ -3,8 +3,8 @@ # License: BSD 3 clause """ -The bigfish.segmentation module includes functions to segment or label nuclei -and cells. +The bigfish.segmentation subpackage includes functions to segment or label +nuclei and cells. """ from .utils import label_instances diff --git a/bigfish/segmentation/test/test_cell_segmentation.py b/bigfish/segmentation/test/test_cell_segmentation.py index 87f6dac5..334c45a3 100644 --- a/bigfish/segmentation/test/test_cell_segmentation.py +++ b/bigfish/segmentation/test/test_cell_segmentation.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.segmentation.cell_segmentation submodule. +Unitary tests for bigfish.segmentation.cell_segmentation module. """ diff --git a/bigfish/segmentation/test/test_nuc_segmentation.py b/bigfish/segmentation/test/test_nuc_segmentation.py index 302ce73e..efbcc08e 100644 --- a/bigfish/segmentation/test/test_nuc_segmentation.py +++ b/bigfish/segmentation/test/test_nuc_segmentation.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.segmentation.nuc_segmentation submodule. +Unitary tests for bigfish.segmentation.nuc_segmentation module. """ diff --git a/bigfish/segmentation/test/test_utils.py b/bigfish/segmentation/test/test_utils.py index 71c3a27b..c1a45681 100644 --- a/bigfish/segmentation/test/test_utils.py +++ b/bigfish/segmentation/test/test_utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.segmentation.utils submodule. +Unitary tests for bigfish.segmentation.utils module. """ diff --git a/bigfish/segmentation/utils.py b/bigfish/segmentation/utils.py index f3a986d7..46a793b5 100644 --- a/bigfish/segmentation/utils.py +++ b/bigfish/segmentation/utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Utility functions for nuclei and cytoplasm segmentation. +Utility functions for bigfish.segmentation subpackage. """ import bigfish.stack as stack diff --git a/bigfish/stack/__init__.py b/bigfish/stack/__init__.py index aa368db1..09f6e3ff 100644 --- a/bigfish/stack/__init__.py +++ b/bigfish/stack/__init__.py @@ -3,8 +3,8 @@ # License: BSD 3 clause """ -The bigfish.stack module includes functions to read data, preprocess them and -build stack of images. +The bigfish.stack subpackage includes functions to read data, preprocess them +and build stack of images. """ from .utils import check_array diff --git a/bigfish/stack/filter.py b/bigfish/stack/filter.py index 8aa6cafd..5cbe2d0e 100644 --- a/bigfish/stack/filter.py +++ b/bigfish/stack/filter.py @@ -2,7 +2,7 @@ # Author: Arthur Imbert # License: BSD 3 clause -"""Filter functions.""" +"""Filtering functions.""" import numpy as np diff --git a/bigfish/stack/postprocess.py b/bigfish/stack/postprocess.py index 760554bd..9745b391 100644 --- a/bigfish/stack/postprocess.py +++ b/bigfish/stack/postprocess.py @@ -17,10 +17,10 @@ from skimage.measure import regionprops, find_contours from skimage.draw import polygon_perimeter + # TODO extract cell-RNAs matrix # TODO sum up extraction results in a (csv) file - # ### Transcription sites ### def identify_transcription_site(nuc_mask, foci): diff --git a/bigfish/stack/preprocess.py b/bigfish/stack/preprocess.py index 3069d1dd..77950fd1 100644 --- a/bigfish/stack/preprocess.py +++ b/bigfish/stack/preprocess.py @@ -27,10 +27,10 @@ from skimage import img_as_uint from skimage.exposure import rescale_intensity + # TODO only read in memory one or several channels (and not the entire image) # TODO allow new keys to define a recipe - # ### Building stack ### def build_stacks(data_map, input_dimension=None, sanity_check=False, diff --git a/bigfish/stack/tests/test_augmentation.py b/bigfish/stack/tests/test_augmentation.py index c285a488..0dbb6a90 100644 --- a/bigfish/stack/tests/test_augmentation.py +++ b/bigfish/stack/tests/test_augmentation.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.augmentation submodule. +Unitary tests for bigfish.stack.augmentation module. """ import pytest diff --git a/bigfish/stack/tests/test_filter.py b/bigfish/stack/tests/test_filter.py index 308e275d..a57ad1cc 100644 --- a/bigfish/stack/tests/test_filter.py +++ b/bigfish/stack/tests/test_filter.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.filter submodule. +Unitary tests for bigfish.stack.filter module. """ import pytest diff --git a/bigfish/stack/tests/test_io.py b/bigfish/stack/tests/test_io.py index 18567ec7..5795af23 100644 --- a/bigfish/stack/tests/test_io.py +++ b/bigfish/stack/tests/test_io.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.io submodule. +Unitary tests for bigfish.stack.io module. """ import os diff --git a/bigfish/stack/tests/test_postprocess.py b/bigfish/stack/tests/test_postprocess.py index be89fc72..2765a999 100644 --- a/bigfish/stack/tests/test_postprocess.py +++ b/bigfish/stack/tests/test_postprocess.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.postprocess submodule. +Unitary tests for bigfish.stack.postprocess module. """ # TODO add test bigfish.stack.identify_transcription_site diff --git a/bigfish/stack/tests/test_preprocess.py b/bigfish/stack/tests/test_preprocess.py index e3a26a1b..4ebae81b 100644 --- a/bigfish/stack/tests/test_preprocess.py +++ b/bigfish/stack/tests/test_preprocess.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.preprocess submodule. +Unitary tests for bigfish.stack.preprocess module. """ import os diff --git a/bigfish/stack/tests/test_projection.py b/bigfish/stack/tests/test_projection.py index 265e80d3..1a8bb444 100644 --- a/bigfish/stack/tests/test_projection.py +++ b/bigfish/stack/tests/test_projection.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.projection submodule. +Unitary tests for bigfish.stack.projection module. """ import pytest diff --git a/bigfish/stack/tests/test_utils.py b/bigfish/stack/tests/test_utils.py index 60e48f3d..60b0ec65 100644 --- a/bigfish/stack/tests/test_utils.py +++ b/bigfish/stack/tests/test_utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Unitary tests for bigfish.stack.utils submodule. +Unitary tests for bigfish.stack.utils module. """ import os diff --git a/bigfish/stack/utils.py b/bigfish/stack/utils.py index 0b2c374c..1d6e1198 100644 --- a/bigfish/stack/utils.py +++ b/bigfish/stack/utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Utility functions for bigfish.stack submodule. +Utility functions for bigfish.stack subpackage. """ import os diff --git a/data/__init__.py b/data/__init__.py index a34d993b..ac850cad 100644 --- a/data/__init__.py +++ b/data/__init__.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -The bigfish.data module includes functions to load data. +The bigfish.data subpackage includes functions to load data. """ from .utils import check_input_data diff --git a/data/utils.py b/data/utils.py index 65beda44..8fab9d97 100644 --- a/data/utils.py +++ b/data/utils.py @@ -3,7 +3,7 @@ # License: BSD 3 clause """ -Utility functions for bigfish.data submodule. +Utility functions for bigfish.data subpackage. """ import os @@ -29,6 +29,7 @@ def check_input_data(input_directory): ------- input_directory : str Path of the input data directory. + """ # check if input dapi image exists path = os.path.join(input_directory, filename_input_dapi)