generateCSScore
Short Description
The generateCSScore
function calculates CSPOT Score
for each cell by using
both the generated probability masks and pre-computed segmentation masks as inputs
Function¶
generateCSScore(probabilityMaskPath, segmentationMaskPath, feature='median', verbose=True, markerNames=None, projectDir=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
probabilityMaskPath |
str
|
Supply the path of the probability map image produced by |
required |
segmentationMaskPath |
str
|
Supply the path of the pre-computed segmentation mask. |
required |
feature |
str
|
Calculates the |
'median'
|
verbose |
bool
|
If True, print detailed information about the process to the console. |
True
|
markerNames |
list
|
The program searches for marker names in the meta data (description section)
of the tiff files created by |
None
|
projectDir |
str
|
Provide the path to the output directory. The result will be located at
|
None
|
Returns:
Name | Type | Description |
---|---|---|
CSV |
dataframe
|
The |
Example
# global path
projectDir = '/Users/aj/Documents/cspotExampleData'
# Path to all the files that are necessary files for running generateCSScore
segmentationPath = projectDir + '/segmentation/exampleSegmentationMask.tif'
probabilityMaskPath = projectDir + '/CSPOT/csPredict/exampleImage_cspotPredict.ome.tif'
cs.generateCSScore(probabilityMaskPath=probabilityMaskPath,
segmentationMaskPath=segmentationPath,
feature='median',
projectDir=projectDir)
# Same function if the user wants to run it via Command Line Interface
python generateCSScore.py --probabilityMaskPath /Users/aj/Documents/cspotExampleData/CSPOT/csPredict/exampleImage_cspotPredict.ome.tif --segmentationMaskPath /Users/aj/Documents/cspotExampleData/segmentation/exampleSegmentationMask.tif --projectDir /Users/aj/Documents/cspotExampleData
Source code in cspot/generateCSScore.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
|