then
[]
else
- let infection = parasites.infection.Copy() // To avoid to modify the parameter.
+ let infection = parasites.nucleus.Copy() // To avoid to modify the parameter.
// This is the minimum window size to check if other ellipses touch 'e'.
let searchRegion (e: Ellipse) = { KdTree.minX = e.Cx - (e.A + config.RBCRadius.Max)
let minX, minY, maxX, maxY = ellipseWindow e
let infectedPixels = List<Point>()
- let stainPixels = List<Point>()
+ let cytoplasmPixels = List<Point>()
//let mutable stainPixels = 0
let mutable darkStainPixels = 0
nbElement <- nbElement + 1
let infected = infection.Data.[y, x, 0] > 0uy
- let stain = parasites.stain.Data.[y, x, 0] > 0uy
+ let stain = parasites.cytoplasm.Data.[y, x, 0] > 0uy
let darkStain = parasites.darkStain.Data.[y, x, 0] > 0uy
if infected
if stain
then
- stainPixels.Add(Point(x, y))
+ cytoplasmPixels.Add(Point(x, y))
if darkStain
then
darkStainPixels <- darkStainPixels + 1
- let mutable stainArea = 0
+ let mutable cytoplasmArea = 0
if infectedPixels.Count > 0
then
- for stainPixel in stainPixels do
- if infectedPixels.Exists(fun p -> pown (p.X - stainPixel.X) 2 + pown (p.Y - stainPixel.Y) 2 <= perimeterParasiteSquared)
+ for cytoplasmPixel in cytoplasmPixels do
+ if infectedPixels.Exists(fun p -> pown (p.X - cytoplasmPixel.X) 2 + pown (p.Y - cytoplasmPixel.Y) 2 <= perimeterParasiteSquared)
then
- stainArea <- stainArea + 1
+ cytoplasmArea <- cytoplasmArea + 1
let cellClass =
then
Peculiar
- elif infectedPixels.Count > 0 && stainArea >= minimumParasiteArea
+ elif infectedPixels.Count > 0 && cytoplasmArea >= minimumParasiteArea
then
- let infectionToRemove = ImgTools.connectedComponents parasites.stain infectedPixels
+ let infectionToRemove = ImgTools.connectedComponents parasites.cytoplasm infectedPixels
for p in infectionToRemove do
infection.Data.[p.Y, p.X, 0] <- 0uy
InfectedRBC
Some { cellClass = cellClass
center = Point(roundInt e.Cx, roundInt e.Cy)
- infectedArea = if cellClass = InfectedRBC then infectedPixels.Count else 0
- stainArea = stainArea
+ nucleusArea = if cellClass = InfectedRBC then infectedPixels.Count else 0
+ parasiteArea = cytoplasmArea
elements = elements })