Skip to content

Commit

Permalink
keep adding javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Sep 30, 2024
1 parent 4e17e9f commit 0327607
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/bioimage/modelrunner/model/Stardist2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ private Stardist2D(ModelDescriptor descriptor) {
* @param modelPath
* path to the Bioimage.io model
* @return an instance of a Stardist2D model ready to be used
* @throws ModelSpecsException if there is any error in the configuration of the specs rdf.yaml file of the Bioimage.io
* @throws IOException
* @throws FileNotFoundException
* @throws ModelSpecsException If there is any error in the configuration of the specs rdf.yaml file of the Bioimage.io.
* @throws FileNotFoundException If the model file is not found.
* @throws IOException If there's an I/O error.
*/
public static Stardist2D fromBioimageioModel(String modelPath) throws ModelSpecsException, FileNotFoundException, IOException {
ModelDescriptor descriptor = ModelDescriptorFactory.readFromLocalFile(modelPath + File.separator + Constants.RDF_FNAME);
Expand Down
35 changes: 31 additions & 4 deletions src/main/java/io/bioimage/modelrunner/model/Stardist3D.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,34 @@
import net.imglib2.view.Views;

/**
* Implementation of an API to run Stardist 3D models out of the box with little configuration.
* This class provides an implementation of an API to run Stardist 3D models, including pre-
* and post-processing, with minimal configuration. The class allows for loading pretrained
* models from Bioimage.io and also includes methods for running predictions using 3D images.
*
* <p>Stardist is a deep learning model specialized in detecting object shapes, particularly
* star-convex shapes in images, which is especially useful in biomedical imaging applications
* such as cell nuclei detection.</p>
*
* <p>The Stardist3D class includes methods for installing the necessary requirements (such as
* Python environments), running predictions, and handling Stardist-specific post-processing.</p>
*
* <p>TODO: add support for fine-tuning models and Mac ARM processors.</p>
*
* Example usage:
* <pre>
* {@code
* Stardist3D.installRequirements();
* Stardist3D model = Stardist3D.fromPretained("StarDist Plant Nuclei 3D ResNet", false);
* RandomAccessibleInterval<FloatType> img = ArrayImgs.floats(new long[] {116, 120, 66});
* RandomAccessibleInterval<FloatType> res = model.predict(img);
* }
* </pre>
*
* @see io.bioimage.modelrunner.model.ModelDescriptor
* @see io.bioimage.modelrunner.bioimageio.description.ModelDescriptorFactory
* @see io.bioimage.modelrunner.exceptions.LoadModelException
* @see io.bioimage.modelrunner.exceptions.RunModelException
* @see io.bioimage.modelrunner.runmode.ops.GenericOp
*
*TODO add fine tuning
*TODO add support for Mac arm
Expand Down Expand Up @@ -112,9 +139,9 @@ private Stardist3D(ModelDescriptor descriptor) {
* @param modelPath
* path to the Bioimage.io model
* @return an instance of a Stardist3D model ready to be used
* @throws ModelSpecsException if there is any error in the configuration of the specs rdf.yaml file of the Bioimage.io
* @throws IOException
* @throws FileNotFoundException
* @throws ModelSpecsException if the model configuration is incorrect in the specs file (rdf.yaml).
* @throws FileNotFoundException if the model file is not found in the specified path.
* @throws IOException if there is an issue reading the model file.
*/
public static Stardist3D fromBioimageioModel(String modelPath) throws ModelSpecsException, FileNotFoundException, IOException {
ModelDescriptor descriptor = ModelDescriptorFactory.readFromLocalFile(modelPath + File.separator + Constants.RDF_FNAME);
Expand Down

0 comments on commit 0327607

Please sign in to comment.