napari_bigfish.bigfishapp module
- class napari_bigfish.bigfishapp.BigfishApp[source]
Bases:
QObject
Application model for the napari FISH-spot detection widget, that runs the bigfish gaussian background correction and spot detection.
- countSpotsPerCellAndEnvironment(cytoplasmLabels, nucleiLabels)[source]
Counts the number of spots in the image and stores it in the attribute nrOfCells. Creates the cellLabelOfSpot list, that contains the cell-label for each spot and the nucleiLabelOfSpot list, that contains True for all spots that are within a nucleus.
- Parameters:
cytoplasmLabels (numpy.ndarray) – The cell-labels
nucleiLabels (numpy.ndarray) – The nuclei-mask or labels
- createEmptySpotCountReport(inputPath)[source]
Create a csv-file, containing only the column headings, for the spot-count-report and return the path to the file. The file is written into a subfolder
results
of the input folder.- Parameters:
inputPath – The path to an input image
- decomposeDenseRegions(scale)[source]
Run the decomposition of the dense regions.
- Parameters:
scale (2 or 3-tupel of float) – The scale (voxel size) of the image in the z, y and x dimensions in nm.
- detectSpots(scale)[source]
Run the spot detection step with or without automatic threshold detection.
- Parameters:
scale (2 or 3-tupel of float) – The scale (voxel size) of the image in the z, y and x dimensions in nm.
- getDecomposeSpotRadius()[source]
Answer the spot radius for the decomposition of dense regions.
- Return type:
2 or 3-tupel of float
- getScale(scale)[source]
Answer the scale (voxel-size) in nm in the different dimensions
- Return type:
2 or 3-tupel of float
- getSpotCountPerCellAndEnvironment()[source]
Returns a table containing the spot-count for each cell, with the number of cells within the nucleus, outside of the nucleus and the total number.
- Return type:
list of lists
- getSpotRadius()[source]
Return the spot radius in the z, y and x-dimension
- Return type:
2 or 3-tupel of float
- reportSpotCounts(inputPath, outputPath)[source]
Write a csv-file with the spot-counts.
- Parameters:
inputPath – The path of the input image will be reported in the csv-file
outputPath – The directory into which the csv-file will be written
- reportSpots(inputPath)[source]
Write a csv-file with the coordinates of the detected spots. The file can be opened by napari as a points-layer.
- Parameters:
inputPath – The past to the input images; the file will be written into a subdirectory “spots” of that directory.
- runBatch(scale, inputImages, cellLabels=None, nucleiMasks=None, subtractBackground=False, decomposeDenseRegions=False)[source]
Run the processing in batch-mode on the input images.
- Parameters:
scale (3-tupel of floats) – A tupel with the scales (voxel-sizes) of the images in nm for the z, y and x dimensions
inputImages – A list of paths to the input images
cellLabels – An optional list of paths to the cell label images
nucleiMasks – An optional list of paths to the nuclei mask images
subtractBackground – A boolean telling wether to subtract the background before the analysis
decomposeDenseRegion – A boolean telling wether to decompose dense regions for the spot detection
- setProgress(progress)[source]
Set the current progress and send the progressSignal with the current and the max. progress.
- setProgressMax(max)[source]
Set the max. progress and send the progressSignal with the current and the max. progress.