-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from fish-quant/multistack
Multistack subpackage
- Loading branch information
Showing
23 changed files
with
2,404 additions
and
1,972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
# Author: Arthur Imbert <[email protected]> | ||
# License: BSD 3 clause | ||
|
||
""" | ||
Utility functions for bigfish.detection subpackage. | ||
""" | ||
|
||
|
||
def convert_spot_coordinates(spots, voxel_size_z, voxel_size_yx): | ||
"""Convert spots coordinates from pixel to nanometer. | ||
Parameters | ||
---------- | ||
spots : np.ndarray, np.int64 | ||
Coordinates of the detected spots with shape (nb_spots, 3) or | ||
(nb_spots, 2). | ||
voxel_size_z : int or float | ||
Height of a voxel, along the z axis, in nanometer. | ||
voxel_size_yx : int or float | ||
Size of a voxel on the yx plan, in nanometer. | ||
Returns | ||
------- | ||
spots_nanometer : np.ndarray, np.int64 | ||
Coordinates of the detected spots with shape (nb_spots, 3) or | ||
(nb_spots, 3), in nanometer. | ||
""" | ||
# convert spots coordinates in nanometer | ||
spots_nanometer = spots.copy() | ||
if spots.shape[1] == 3: | ||
spots_nanometer[:, 0] *= voxel_size_z | ||
spots_nanometer[:, 1:] *= voxel_size_yx | ||
|
||
else: | ||
spots_nanometer *= voxel_size_yx | ||
|
||
return spots_nanometer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# Author: Arthur Imbert <[email protected]> | ||
# License: BSD 3 clause | ||
|
||
""" | ||
The bigfish.multistack subpackage includes function to process input and output | ||
from different channels. | ||
""" | ||
|
||
from .utils import check_recipe | ||
from .utils import check_datamap | ||
|
||
from .preprocess import build_stacks | ||
from .preprocess import build_stack | ||
from .preprocess import build_stack_no_recipe | ||
|
||
from .colocalization import detect_spots_colocalization | ||
from .colocalization import get_elbow_value_colocalized | ||
|
||
from .cell_extraction import identify_objects_in_region | ||
from .cell_extraction import remove_transcription_site | ||
from .cell_extraction import match_nuc_cell | ||
from .cell_extraction import extract_cell | ||
from .cell_extraction import extract_spots_from_frame | ||
from .cell_extraction import summarize_extraction_results | ||
|
||
_utils = [ | ||
"check_recipe", | ||
"check_datamap"] | ||
|
||
_preprocess = [ | ||
"build_stacks", | ||
"build_stack", | ||
"build_stack_no_recipe"] | ||
|
||
_colocalization = [ | ||
"detect_spots_colocalization", | ||
"get_elbow_value_colocalized"] | ||
|
||
_postprocess = [ | ||
"identify_objects_in_region", | ||
"remove_transcription_site", | ||
"match_nuc_cell", | ||
"extract_cell", | ||
"extract_spots_from_frame", | ||
"summarize_extraction_results"] | ||
|
||
__all__ = _utils + _preprocess + _colocalization + _postprocess |
Oops, something went wrong.