Commit 3101d39c authored by aknecht2's avatar aknecht2
Browse files

Documentation update for imgproc functions, and workflow examples.

parent 79cad3a1
...@@ -420,332 +420,331 @@ are defined for each image type -- as a result the template is quite long. Here ...@@ -420,332 +420,331 @@ are defined for each image type -- as a result the template is quite long. Here
.. code-block:: javascript .. code-block:: javascript
{ {
"workflows": { "workflows": {
"fluosv": [ "fluosv": [
{ {
"name": "pot_filter_1", "name": "pot_filter_1",
"executable": "ih-color-filter", "executable": "ih-color-filter",
"inputs": ["base", "/work/walia/common/ih/workflows/0184/input/fluosv_pot1.json"], "inputs": ["base", "/work/walia/common/workflows/0184/input/fluosv_pot1.json"],
"outputs": ["pot1"], "outputs": ["pot1"],
"arguments": { "arguments": {
"--logic": "(((((((r - g) < 30) and (((r + g) + b) < 110)) or ((((r + g) + b) > 110) and ((r - g) < 50))) or (((r - g) < 25) and ((g - r) < 25))) or (g > 60)) not 1)" "--logic": "(((((((r - g) < 30) and (((r + g) + b) < 110)) or ((((r + g) + b) > 110) and ((r - g) < 50))) or (((r - g) < 25) and ((g - r) < 25))) or (g > 60)) not 1)"
}
},
{
"name": "pot_filter_2",
"executable": "ih-color-filter",
"inputs": ["pot1", "/work/walia/common/ih/workflows/0184/input/fluosv_pot2.json"],
"outputs": ["pot2"],
"arguments": {
"--logic": "(((r + g) + b) > 120)"
},
"depends": ["pot_filter_1"]
},
{
"name": "main_filter",
"executable": "ih-color-filter",
"inputs": ["pot2"],
"outputs": ["filter"],
"arguments": {
"--logic": "((r - g) > 10)"
},
"depends": ["pot_filter_2"]
},
{
"name": "crop",
"executable": "ih-crop",
"inputs": ["filter", "/work/walia/common/ih/workflows/0184/input/fluosv_edge.json"],
"outputs": ["edged"],
"arguments": {},
"depends": ["main_filter"]
},
{
"name": "cut",
"executable": "ih-contour-cut",
"inputs": ["edged", "edged"],
"outputs": ["final"],
"arguments": {
"--resize": "",
"--basemin": 75
},
"depends": ["crop"]
} }
], },
"rgbtv": [ {
{ "name": "pot_filter_2",
"name": "normalize", "executable": "ih-color-filter",
"executable": "ih-normalize-intensity", "inputs": ["pot1", "/work/walia/common/workflows/0184/input/fluosv_pot2.json"],
"inputs": ["base"], "outputs": ["pot2"],
"outputs": ["normal"], "arguments": {
"arguments": {} "--logic": "(((r + g) + b) > 120)"
},
{
"name": "meanshift",
"executable": "ih-meanshift",
"inputs": ["normal"],
"outputs": ["shift"],
"arguments": {
"--spatial_radius": 4,
"--range_radius": 4,
"--min_density": 40
},
"depends": ["normalize"]
},
{
"name": "main_filter",
"executable": "ih-color-filter",
"inputs": ["shift"],
"outputs": ["filter"],
"arguments": {
"--logic": "(((g > r) and (g > b)) and ((((b max g) max r) - ((b min g) min r)) > 20))"
},
"depends": ["meanshift"]
},
{
"name": "closing",
"executable": "ih-morphology",
"inputs": ["filter"],
"outputs": ["morphed"],
"arguments": {
"--ktype": "ellipse",
"--kwidth": 5,
"--kheight": 5,
"--morphType": "close"
},
"depends": ["main_filter"]
}, },
{ "depends": ["pot_filter_1"]
"name": "crop", },
"executable": "ih-crop", {
"inputs": ["morphed", "/work/walia/common/ih/workflows/0184/input/rgbtv_edge.json"], "name": "main_filter",
"outputs": ["edged"], "executable": "ih-color-filter",
"arguments": {}, "inputs": ["pot2"],
"depends": ["closing"] "outputs": ["filter"],
"arguments": {
"--logic": "((r - g) > 10)"
}, },
{ "depends": ["pot_filter_2"]
"name": "reconstitute", },
"executable": "ih-bitwise-and", {
"inputs": ["edged", "base"], "name": "crop",
"outputs": ["recolor"], "executable": "ih-crop",
"arguments": {}, "inputs": ["filter", "/work/walia/common/workflows/0184/input/fluosv_edge.json"],
"depends": ["crop"] "outputs": ["edged"],
"arguments": {},
"depends": ["main_filter"]
},
{
"name": "cut",
"executable": "ih-contour-cut",
"inputs": ["edged", "edged"],
"outputs": ["final"],
"arguments": {
"--basemin": 75
}, },
{ "depends": ["crop"]
"name": "cut", }
"executable": "ih-contour-cut", ],
"inputs": ["recolor", "recolor"], "rgbtv": [
"outputs": ["final"], {
"arguments": { "name": "normalize",
"--basemin": 200, "executable": "ih-normalize-intensity",
"--resize": "" "inputs": ["base"],
}, "outputs": ["normal"],
"depends": ["reconstitute"] "arguments": {}
} },
], {
"rgbsv": [ "name": "meanshift",
{ "executable": "ih-meanshift",
"name": "pot-detect", "inputs": ["normal"],
"executable": "ih-color-filter", "outputs": ["shift"],
"inputs": ["base"], "arguments": {
"outputs": ["pot"], "--spatial_radius": 4,
"arguments": { "--range_radius": 4,
"--logic": "((((r + g) + b) < 100) or (((b - r) > 40) and ((b - g) > 30)))" "--min_density": 40
}
}, },
{ "depends": ["normalize"]
"name": "pot-crop", },
"executable": "ih-contour-cut", {
"inputs": ["pot", "pot"], "name": "main_filter",
"outputs": ["unused_1", "pot_roi"], "executable": "ih-color-filter",
"arguments": { "inputs": ["shift"],
"--basemin": 100, "outputs": ["filter"],
"--padminy": 100, "arguments": {
"--padmaxy": 2000, "--logic": "(((g > r) and (g > b)) and ((((b max g) max r) - ((b min g) min r)) > 20))"
"--padminx": -25,
"--padmaxx": -25,
"--returnBound": ""
},
"depends": ["pot-detect"]
}, },
{ "depends": ["meanshift"]
"name": "box-crop", },
"executable": "ih-contour-cut", {
"inputs": ["pot", "pot"], "name": "closing",
"outputs": ["unused_2", "box_roi"], "executable": "ih-morphology",
"arguments": { "inputs": ["filter"],
"--basemin": 100, "outputs": ["morphed"],
"--padminy": 35, "arguments": {
"--padmaxy": 2000, "--ktype": "ellipse",
"--padminx": 25, "--kwidth": 5,
"--padmaxx": 25, "--kheight": 5,
"--returnBound": "" "--morphType": "close"
},
"depends": ["pot-detect"]
}, },
{ "depends": ["main_filter"]
"name": "gray", },
"executable": "ih-convert-color", {
"inputs": ["base"], "name": "crop",
"outputs": ["grayscale"], "executable": "ih-crop",
"arguments": { "inputs": ["morphed", "/work/walia/common/workflows/0184/input/rgbtv_edge.json"],
"--intype": "bgr", "outputs": ["edged"],
"--outtype": "gray" "arguments": {},
} "depends": ["closing"]
},
{
"name": "reconstitute",
"executable": "ih-bitwise-and",
"inputs": ["edged", "base"],
"outputs": ["recolor"],
"arguments": {},
"depends": ["crop"]
},
{
"name": "cut",
"executable": "ih-contour-cut",
"inputs": ["recolor", "recolor"],
"outputs": ["final"],
"arguments": {
"--basemin": 200
}, },
{ "depends": ["reconstitute"]
"name": "blur", }
"executable": "ih-gaussian-blur", ],
"inputs": ["grayscale"], "rgbsv": [
"outputs": ["blurred"], {
"arguments": { "name": "pot-detect",
"--kwidth": 5, "executable": "ih-color-filter",
"--kheight": 5 "inputs": ["base"],
}, "outputs": ["pot"],
"depends": ["gray"] "arguments": {
"--logic": "((((r + g) + b) < 100) or (((b - r) > 40) and ((b - g) > 30)))"
}
},
{
"name": "pot-crop",
"executable": "ih-contour-cut",
"inputs": ["pot", "pot"],
"outputs": ["unused_1", "pot_roi"],
"arguments": {
"--basemin": 100,
"--padminy": 100,
"--padmaxy": 2000,
"--padminx": -25,
"--padmaxx": -25,
"--returnBound": ""
}, },
{ "depends": ["pot-detect"]
"name": "thresh", },
"executable": "ih-adaptive-threshold", {
"inputs": ["blurred"], "name": "box-crop",
"outputs": ["thresh"], "executable": "ih-contour-cut",
"arguments": { "inputs": ["pot", "pot"],
"--value": 200, "outputs": ["unused_2", "box_roi"],
"--thresholdType": "binary", "arguments": {
"--adaptiveType": "mean", "--basemin": 100,
"--blockSize": 15, "--padminy": 35,
"--C": 3 "--padmaxy": 2000,
}, "--padminx": 50,
"depends": ["blur"] "--padmaxx": 50,
"--returnBound": ""
}, },
{ "depends": ["pot-detect"]
"name": "reconstitute1", },
"executable": "ih-bitwise-and", {
"inputs": ["thresh", "base"], "name": "gray",
"outputs": ["recolor1"], "executable": "ih-convert-color",
"arguments": {}, "inputs": ["base"],
"depends": ["thresh"] "outputs": ["grayscale"],
"arguments": {
"--intype": "bgr",
"--outtype": "gray"
}
},
{
"name": "blur",
"executable": "ih-gaussian-blur",
"inputs": ["grayscale"],
"outputs": ["blurred"],
"arguments": {
"--kwidth": 5,
"--kheight": 5
}, },
{ "depends": ["gray"]
"name": "meanshift", },
"executable": "ih-meanshift", {
"inputs": ["recolor1"], "name": "thresh",
"outputs": ["shift"], "executable": "ih-adaptive-threshold",
"arguments": { "inputs": ["blurred"],
"--spatial_radius": 2, "outputs": ["thresh"],
"--range_radius": 2, "arguments": {
"--min_density": 50 "--value": 255,
}, "--thresholdType": "inverse",
"depends": ["reconstitute1"] "--adaptiveType": "mean",
"--blockSize": 15,
"--C": 3
}, },
{ "depends": ["blur"]
"name": "pot-filter", },
"executable": "ih-color-filter", {
"inputs": ["shift", "pot_roi"], "name": "reconstitute1",
"outputs": ["pot_filtered"], "executable": "ih-bitwise-and",
"arguments": { "inputs": ["thresh", "base"],
"--logic": "((((((((((r > g) and (r > b)) and (((b max g) - (b min g)) < (((r + g) + b) / 20))) or ((((b max g) max r) - ((b min g) min r)) < 10)) or ((b > r) and ((b > g) or (g > r)))) or (((r + g) + b) < 220)) or ((((r + g) + b) < 350) and ((((b max g) max r) - ((b min g) min r)) < 25))) or ((b > g) and (r > g))) or (((((r - g) > 5) and ((g - b) > 5)) and ((r - g) < 25)) and ((g - b) < 25))) not 1)" "outputs": ["recolor1"],
}, "arguments": {},
"depends": ["meanshift", "pot-crop"] "depends": ["thresh"]
},
{
"name": "meanshift",
"executable": "ih-meanshift",
"inputs": ["recolor1"],
"outputs": ["shift"],
"arguments": {
"--spatial_radius": 2,
"--range_radius": 2,
"--min_density": 50
}, },
{ "depends": ["reconstitute1"]
"name": "box-filter", },
"executable": "ih-color-filter", {
"inputs": ["pot_filtered", "box_roi"], "name": "pot-filter",
"outputs": ["box_filtered"], "executable": "ih-color-filter",
"arguments": { "inputs": ["shift", "pot_roi"],
"--logic": "(((((r > g) and (r > b)) and (((b max g) - (b min g)) < (((r + g) + b) / 20))) or ((((b max g) max r) - ((b min g) min r)) < 10)) not 1)" "outputs": ["pot_filtered"],
}, "arguments": {
"depends": ["pot-filter", "box-crop"] "--logic": "((((((((((r > g) and (r > b)) and (((b max g) - (b min g)) < (((r + g) + b) / 20))) or ((((b max g) max r) - ((b min g) min r)) < 10)) or ((b > r) and ((b > g) or (g > r)))) or (((r + g) + b) < 220)) or ((((r + g) + b) < 350) and ((((b max g) max r) - ((b min g) min r)) < 25))) or ((b > g) and (r > g))) or (((((r - g) > 5) and ((g - b) > 5)) and ((r - g) < 25)) and ((g - b) < 25))) not 1)"
}, },
{ "depends": ["meanshift", "pot-crop"]
"name": "gfilter1", },
"executable": "ih-color-filter", {
"inputs": ["box_filtered", "/work/walia/common/ih/workflows/0184/input/rgbsv_gray1.json"], "name": "box-filter",
"outputs": ["gray_filtered1"], "executable": "ih-color-filter",
"arguments": { "inputs": ["pot_filtered", "box_roi"],
"--logic": "((((b max g) max r) - ((b min g) min r)) > 50)" "outputs": ["box_filtered"],
}, "arguments": {
"depends": ["box-filter", "box-crop"] "--logic": "(((g - b) > 30) or ((r - b) > 30))"
}, },
{ "depends": ["pot-filter", "box-crop"]
"name": "gfilter2", },
"executable": "ih-color-filter", {
"inputs": ["gray_filtered1", "/work/walia/common/ih/workflows/0184/input/rgbsv_gray2.json"], "name": "gfilter1",
"outputs": ["gray_filtered2"], "executable": "ih-color-filter",
"arguments": { "inputs": ["box_filtered", "/work/walia/common/workflows/0184/input/rgbsv_gray1.json"],
"--logic": "((((b max g) max r) - ((b min g) min r)) > 100)" "outputs": ["gray_filtered1"],
}, "arguments": {
"depends": ["gfilter1"] "--logic": "((((b max g) max r) - ((b min g) min r)) > 50)"
}, },
{ "depends": ["box-filter", "box-crop"]
"name": "crop", },
"executable": "ih-crop", {
"inputs": ["gray_filtered2", "/work/walia/common/ih/workflows/0184/input/rgbsv_edge.json"], "name": "gfilter2",
"outputs": ["edged"], "executable": "ih-color-filter",
"arguments": {}, "inputs": ["gray_filtered1", "/work/walia/common/workflows/0184/input/rgbsv_gray2.json"],
"depends": ["gfilter2"] "outputs": ["gray_filtered2"],
"arguments": {
"--logic": "((((b max g) max r) - ((b min g) min r)) > 100)"
}, },
{ "depends": ["gfilter1"]
"name": "reconstitute2", },
"executable": "ih-bitwise-and", {
"inputs": ["edged", "base"], "name": "crop",
"outputs": ["recolor2"], "executable": "ih-crop",
"arguments": {}, "inputs": ["gray_filtered2", "/work/walia/common/workflows/0184/input/rgbsv_edge.json"],
"depends": ["crop"] "outputs": ["edged"],
"arguments": {},
"depends": ["gfilter2"]
},
{
"name": "reconstitute2",
"executable": "ih-bitwise-and",
"inputs": ["edged", "base"],
"outputs": ["recolor2"],
"arguments": {},
"depends": ["crop"]
},
{
"name": "cut",
"executable": "ih-contour-cut",
"inputs": ["recolor2", "recolor2"],
"outputs": ["final"],
"arguments": {
"--basemin": 50
}, },
{ "depends": ["reconstitute2"]
"name": "cut", }
"executable": "ih-contour-cut", ]
"inputs": ["recolor2", "recolor2"], },
"outputs": ["final"], "options": {
"arguments": {
"--basemin": 50,
"--resize": ""
},
"depends": ["reconstitute2"]
}
]
},
"options": {
},
"extract": {
"histogram-bin": {
"--group": {"rgb": ["rgbsv", "rgbtv"], "fluo": ["fluosv"]},
"--chunks": {"rgb": [5, 5, 5], "fluo": [0, 9, 10]},
"--channels": {"rgb": [0, 1, 2], "fluo": [1, 2]}
}, },
"extract": { "workflows": {
"histogram-bin": { "rgbsv": {
"--group": {"rgb": ["rgbsv", "rgbtv"], "fluo": ["fluosv"]}, "inputs": ["final"],
"--chunks": {"rgb": 5, "fluo": 6}, "arguments": {
"--channels": {"rgb": [0, 1, 2], "fluo": [1, 2]} "--dimfromroi": "pot_roi",
}, "--dimensions": "",
"workflows": { "--pixels": "",
"rgbsv": { "--moments": ""
"inputs": ["final"],
"arguments": {
"--dimensions": "",
"--pixels": "",
"--moments": ""
},
"depends": ["cut"]
}, },
"rgbtv": { "depends": ["cut"]
"inputs": ["final"], },
"arguments": { "rgbtv": {
"--dimensions": "", "inputs": ["final"],
"--pixels": "", "arguments": {
"--moments": "" "--dimensions": "",
}, "--pixels": "",
"depends": ["cut"] "--moments": ""
}, },
"fluosv": { "depends": ["cut"]
"inputs": ["final"], },
"arguments": { "fluosv": {
"--dimensions": "", "inputs": ["final"],
"--pixels": "", "arguments": {
"--moments": "" "--dimfromroi": "/work/walia/common/workflows/0184/input/fluosv_pot1.json",
}, "--pixels": "",
"depends": ["cut"] "--moments": ""
} },
"depends": ["cut"]
} }
} }
} }
}
Let's break it down into more manageable chunks. We will look at a few jobs from the workflows. Let's break it down into more manageable chunks. We will look at a few jobs from the workflows.
...@@ -840,14 +839,14 @@ all the numeric information you want to extract from your final images. Let's t ...@@ -840,14 +839,14 @@ all the numeric information you want to extract from your final images. Let's t
"extract": { "extract": {
"histogram-bin": { "histogram-bin": {
"--group": {"rgb": ["rgbsv", "rgbtv"], "fluo": ["fluosv"]}, "--group": {"rgb": ["rgbsv", "rgbtv"], "fluo": ["fluosv"]},
"--chunks": {"rgb": 5, "fluo": 6}, "--chunks": {"rgb": [5, 5, 5], "fluo": [0, 9, 10]},
"--channels": {"rgb": [0, 1, 2], "fluo": [1, 2]} "--channels": {"rgb": [0, 1, 2], "fluo": [1, 2]}
}, },
"workflows": { "workflows": {
"rgbsv": { "rgbsv": {
"inputs": ["final"], "inputs": ["final"],
"arguments": { "arguments": {
"--dimensions": "", "--dimfromroi": "pot_roi",
"--pixels": "", "--pixels": "",
"--moments": "" "--moments": ""
}, },
...@@ -865,7 +864,7 @@ all the numeric information you want to extract from your final images. Let's t ...@@ -865,7 +864,7 @@ all the numeric information you want to extract from your final images. Let's t
"fluosv": { "fluosv": {
"inputs": ["final"], "inputs": ["final"],
"arguments": { "arguments": {
"--dimensions": "", "--dimfromroi": "/work/walia/common/workflows/0184/input/fluosv_pot1.json",
"--pixels": "", "--pixels": "",
"--moments": "" "--moments": ""