projects
/
master-thesis.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the parasite detection function from Ma.
[master-thesis.git]
/
Parasitemia
/
ParasitemiaCore
/
Classifier.fs
diff --git
a/Parasitemia/ParasitemiaCore/Classifier.fs
b/Parasitemia/ParasitemiaCore/Classifier.fs
index
96532f8
..
2b6f3be
100644
(file)
--- a/
Parasitemia/ParasitemiaCore/Classifier.fs
+++ b/
Parasitemia/ParasitemiaCore/Classifier.fs
@@
-24,7
+24,7
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
then
[]
else
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)
// 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)
@@
-159,7
+159,7
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
let minX, minY, maxX, maxY = ellipseWindow e
let infectedPixels = List<Point>()
let minX, minY, maxX, maxY = ellipseWindow e
let infectedPixels = List<Point>()
- let
stain
Pixels = List<Point>()
+ let
cytoplasm
Pixels = List<Point>()
//let mutable stainPixels = 0
let mutable darkStainPixels = 0
//let mutable stainPixels = 0
let mutable darkStainPixels = 0
@@
-175,7
+175,7
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
nbElement <- nbElement + 1
let infected = infection.Data.[y, x, 0] > 0uy
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
let darkStain = parasites.darkStain.Data.[y, x, 0] > 0uy
if infected
@@
-184,19
+184,19
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
if stain
then
if stain
then
-
stain
Pixels.Add(Point(x, y))
+
cytoplasm
Pixels.Add(Point(x, y))
if darkStain
then
darkStainPixels <- darkStainPixels + 1
if darkStain
then
darkStainPixels <- darkStainPixels + 1
- let mutable
stain
Area = 0
+ let mutable
cytoplasm
Area = 0
if infectedPixels.Count > 0
then
if infectedPixels.Count > 0
then
- for
stainPixel in stain
Pixels do
- if infectedPixels.Exists(fun p -> pown (p.X -
stainPixel.X) 2 + pown (p.Y - stain
Pixel.Y) 2 <= perimeterParasiteSquared)
+ for
cytoplasmPixel in cytoplasm
Pixels do
+ if infectedPixels.Exists(fun p -> pown (p.X -
cytoplasmPixel.X) 2 + pown (p.Y - cytoplasm
Pixel.Y) 2 <= perimeterParasiteSquared)
then
then
-
stainArea <- stain
Area + 1
+
cytoplasmArea <- cytoplasm
Area + 1
let cellClass =
let cellClass =
@@
-205,9
+205,9
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
then
Peculiar
then
Peculiar
- elif infectedPixels.Count > 0 &&
stain
Area >= minimumParasiteArea
+ elif infectedPixels.Count > 0 &&
cytoplasm
Area >= minimumParasiteArea
then
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
for p in infectionToRemove do
infection.Data.[p.Y, p.X, 0] <- 0uy
InfectedRBC
@@
-217,6
+217,6
@@
let findCells (ellipses: Ellipse list) (parasites: ParasitesMarker.Result) (img:
Some { cellClass = cellClass
center = Point(roundInt e.Cx, roundInt e.Cy)
Some { cellClass = cellClass
center = Point(roundInt e.Cx, roundInt e.Cy)
-
infected
Area = if cellClass = InfectedRBC then infectedPixels.Count else 0
-
stainArea = stain
Area
+
nucleus
Area = if cellClass = InfectedRBC then infectedPixels.Count else 0
+
parasiteArea = cytoplasm
Area
elements = elements })
elements = elements })