-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- create abstract stardist class for the two concrete stardist variant classes, because most of the functionality is identical
- Loading branch information
Showing
14 changed files
with
78 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Stardist } from "../AbstractStardist"; | ||
import { loadStardistFluo } from "./loadStardistFluo"; | ||
import { ModelTask } from "../../enums"; | ||
|
||
/* | ||
* Stardist (Versatile) Fluorescence Nuclei Segmentation | ||
* https://zenodo.org/records/6348085 | ||
* https://bioimage.io/#/?tags=stardist&id=10.5281%2Fzenodo.6348084 | ||
* https://github.com/stardist/stardist/blob/master/README.md#pretrained-models-for-2d | ||
* Stardist: model for object detection / instance segmentation with star-convex shapes | ||
* This pretrained model: meant to segment individual cell nuclei from single channel fluorescence data (2018 DSB) | ||
*/ | ||
export class StardistFluo extends Stardist { | ||
constructor() { | ||
super({ | ||
name: "StardistFluo", | ||
task: ModelTask.Segmentation, | ||
graph: true, | ||
pretrained: true, | ||
trainable: false, | ||
requiredChannels: 3, | ||
}); | ||
} | ||
|
||
public async loadModel() { | ||
if (this._model) return; | ||
// inputs: [ {name: 'input', shape: [-1,-1,-1,1], dtype: 'float32'} ] | ||
// outputs: [ {name: 'concatenate_4/concat', shape: [-1, -1, -1, 33], dtype: 'float32'} ] | ||
// where each -1 matches on input and output of corresponding dim/axis | ||
// 33 -> 1 probability score, followed by 32 radial equiangular distances of rays | ||
this._model = await loadStardistFluo(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Stardist } from "../AbstractStardist"; | ||
import { loadStardistVHE } from "./loadStardistVHE"; | ||
import { ModelTask } from "../../enums"; | ||
|
||
/* | ||
* Stardist (Versatile) H&E Nuclei Segmentation | ||
* https://zenodo.org/record/6338615 | ||
* https://bioimage.io/#/?tags=stardist&id=10.5281%2Fzenodo.6338614&type=model | ||
* https://github.com/stardist/stardist/blob/master/README.md#pretrained-models-for-2d | ||
* Stardist: model for object detection / instance segmentation with star-convex shapes | ||
* This pretrained model: meant to segment individual cell nuclei from brightfield images with H&E staining | ||
*/ | ||
export class StardistVHE extends Stardist { | ||
constructor() { | ||
super({ | ||
name: "StardistVHE", | ||
task: ModelTask.Segmentation, | ||
graph: true, | ||
pretrained: true, | ||
trainable: false, | ||
requiredChannels: 3, | ||
}); | ||
} | ||
|
||
public async loadModel() { | ||
if (this._model) return; | ||
// inputs: [ {name: 'input', shape: [-1,-1,-1,3], dtype: 'float32'} ] | ||
// outputs: [ {name: 'concatenate_4/concat', shape: [-1, -1, -1, 33], dtype: 'float32'} ] | ||
// where each -1 matches on input and output of corresponding dim/axis | ||
// 33 -> 1 probability score, followed by 32 radial equiangular distances of rays | ||
this._model = await loadStardistVHE(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { StardistFluo } from "./StardistFluo"; | ||
export { StardistVHE } from "./StardistVHE"; |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.