Writing Custom Cell Pick Functions
When using the cell picker in the ROI/Stimulus Group Editor, custom segmentation routines can be selected from the New ROI panel when in cell picker mode by choosing Custom... from the Selection Mode drop down. When Custom... is selected, it will prompt you to enter a matlab function. This must be a function on the current function path with the following function signature:
function xyPoints = cellPickFunc(operation, imageData, xyPoints)
The operation parameter indicates why the function is being called. It can be any of the following
- 'pick' - This indicates the user clicked in a context image to attempt to pick a cell. imData contains an array representing the image data of the context image. The xyPoints input will contain the pixel location where the user clicked. When called for this operation, the function should execute its segmentation routine to indentify a cell at the specified location. If a cell is found, it should return a Nx2 matrix of XY points that define the cell in the context image. If a cell was not found, an empty array should be returned.
- 'dilate' - This indicates the user clicked the Dilate button on a previously selected cell. imData contains an array representing the image data of the context image. xyPoints contains an Nx2 matrix of all the XY points that currently define the cell. When called for this operation, the function should return a new matrix of XY points for the same cell increased in size. You can define your own custom behavior for determining how much larger the cell should be.
- 'erode' - This indicates the user clicked the Erode button on a previously selected cell. imData contains an array representing the image data of the context image. xyPoints contains an Nx2 matrix of all the XY points that currently define the cell. When called for this operation, the function should return a new matrix of XY points for the same cell decreased in size. You can define your own custom behavior for determining how much smaller the cell should be.
Attachments:
RoiDisp.png (image/png)
main.png (image/png)
ROI.png (image/png)
rge.png (image/png)
image2016-6-10 17:49:3.png (image/png)
stimpwr.png (image/png)
stimrot.png (image/png)
stimsz.png (image/png)
stimpos.png (image/png)
stimreps.png (image/png)
stimdur.png (image/png)
stimparams.png (image/png)
stimchse.png (image/png)
stimrem.png (image/png)
stimadd.png (image/png)
stimdefpwr.png (image/png)
stimdefrot.png (image/png)
stimdefsz.png (image/png)
stimdefreps.png (image/png)
stimdefdur.png (image/png)
stimdefparams.png (image/png)
stimdefchse.png (image/png)
pixpermic.png (image/png)
pxpersz.png (image/png)
frac.png (image/png)
rotation.png (image/png)
pixelcount.png (image/png)
remsf.png (image/png)
Addsf.png (image/png)
defpix.png (image/png)
defsize.png (image/png)
fix.png (image/png)
discrete.png (image/png)
movedn.png (image/png)
move up.png (image/png)
remove.png (image/png)
types.png (image/png)
times.png (image/png)
roigname.png (image/png)
selectedroi.png (image/png)
zcontrol.png (image/png)
zcontrolbygroup.png (image/png)
zcontrolbyseries.png (image/png)
ctxim.png (image/png)
add.png (image/png)
saveload.png (image/png)
minmax.png (image/png)
pts.png (image/png)
displays.png (image/png)
enables.png (image/png)
main.png (image/png)
ROI.png (image/png)
rge.png (image/png)
image2016-6-10 17:49:3.png (image/png)
stimpwr.png (image/png)
stimrot.png (image/png)
stimsz.png (image/png)
stimpos.png (image/png)
stimreps.png (image/png)
stimdur.png (image/png)
stimparams.png (image/png)
stimchse.png (image/png)
stimrem.png (image/png)
stimadd.png (image/png)
stimdefpwr.png (image/png)
stimdefrot.png (image/png)
stimdefsz.png (image/png)
stimdefreps.png (image/png)
stimdefdur.png (image/png)
stimdefparams.png (image/png)
stimdefchse.png (image/png)
pixpermic.png (image/png)
pxpersz.png (image/png)
frac.png (image/png)
rotation.png (image/png)
pixelcount.png (image/png)
remsf.png (image/png)
Addsf.png (image/png)
defpix.png (image/png)
defsize.png (image/png)
fix.png (image/png)
discrete.png (image/png)
movedn.png (image/png)
move up.png (image/png)
remove.png (image/png)
types.png (image/png)
times.png (image/png)
roigname.png (image/png)
selectedroi.png (image/png)
zcontrol.png (image/png)
zcontrolbygroup.png (image/png)
zcontrolbyseries.png (image/png)
ctxim.png (image/png)
add.png (image/png)
saveload.png (image/png)
minmax.png (image/png)
pts.png (image/png)
displays.png (image/png)
enables.png (image/png)