addRoiImage
addRoiImage ¶
addRoiImage(
imagePath,
data,
roi=None,
outputDir=None,
show=True,
returnData=False,
returnFig=False,
sdataTable=None,
**kwargs
)
Attach ROI polygons to the cell table.
scimap's addROI_image opened the raw image in napari and let you draw regions
by hand. scimappro takes the polygons as data instead: pass a roi table (the
same shape sp.helpers.addROI_omero takes,
i.e. an OMERO ROI export) and each cell is labelled by the region it falls in.
With roi=None the table is returned unchanged, which makes the function safe
to leave in a pipeline whose ROIs have not been drawn yet.
Note that imagePath is the first parameter here — this is the one function
in scimappro where data is not first, because the image is what identifies the
ROIs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
imagePath
|
(str, required)
|
Path to the image the ROIs were drawn on. Recorded for provenance; the image is not read. |
required |
data
|
(AnnData | SpatialData | str, required)
|
The cell table. An |
required |
roi
|
DataFrame | str
|
ROI polygons to apply, in the OMERO export format. |
None
|
outputDir
|
str
|
Directory to write the updated object to. With |
None
|
show
|
bool
|
Accepted for signature compatibility with scimap; nothing is drawn. |
True
|
returnData
|
bool
|
Return |
False
|
returnFig
|
bool
|
Return |
False
|
sdataTable
|
str
|
Which |
None
|
**kwargs
|
dict
|
Forwarded to
|
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
result |
AnnData | SpatialData | DataFrame | tuple
|
The updated object by default; |