piscis
======

.. py:module:: piscis


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/piscis/__main__/index
   /autoapi/piscis/convert/index
   /autoapi/piscis/core/index
   /autoapi/piscis/data/index
   /autoapi/piscis/downloads/index
   /autoapi/piscis/losses/index
   /autoapi/piscis/metrics/index
   /autoapi/piscis/models/index
   /autoapi/piscis/networks/index
   /autoapi/piscis/paths/index
   /autoapi/piscis/training/index
   /autoapi/piscis/transforms/index
   /autoapi/piscis/utils/index


Classes
-------

.. autoapisummary::

   piscis.Piscis
   piscis.PiscisLegacy


Package Contents
----------------

.. py:class:: Piscis(model_name: str = '20251212', batch_size: int = 1, input_size: Optional[Tuple[int, int]] = None, device: Optional[Union[str, torch.device]] = None)

   Bases: :py:obj:`_Piscis`


   
   Class for running the Piscis algorithm.



   :Attributes:

       **model_name** : str
           Model name.

       **batch_size** : int
           Batch size for the CNN.

       **adjustment** : str
           Adjustment type applied to images during preprocessing.

       **input_size** : Tuple[int, int]
           Input size for the CNN.

       **dilation_iterations** : int
           Number of iterations used to dilate ground truth labels during training.

       **channels** : int
           Number of channels in the input images.

       **device** : Optional[Union[str, torch.device]]
           Device to run the model on.

       **pooling** : str
           Pooling type applied to labels.

       **model** : SpotsModel
           Model.













   ..
       !! processed by numpydoc !!

   .. py:method:: predict(x: Union[numpy.ndarray, dask.array.Array], stack: bool = False, scale: float = 1.0, threshold: float = 0.5, min_distance: int = 1, intermediates: bool = False) -> Union[Tuple[numpy.ndarray, xarray.DataArray], numpy.ndarray]

      
      Predict spots in an image or stack of images.


      :Parameters:

          **x** : np.ndarray or da.Array
              Image or stack of images.

          **stack** : bool, optional
              Whether `x` is a stack of images. Default is False.

          **scale** : float, optional
              Scale factor for rescaling `x`. Default is 1.

          **threshold** : float, optional
              Spot detection threshold. Default is 0.5.

          **min_distance** : int, optional
              Minimum distance between spots. Default is 1.

          **intermediates** : bool, optional
              Whether to return intermediate feature maps. Default is False.



      :Returns:

          **coords** : np.ndarray
              Predicted spot coordinates.

          **y** : np.ndarray, optional
              Intermediate feature maps. Only returned if `intermediates` is True.











      ..
          !! processed by numpydoc !!


.. py:class:: PiscisLegacy(model_name: str = '20230905', batch_size: int = 1, input_size: Optional[Tuple[int, int]] = None, device: Optional[Union[str, torch.device]] = None)

   Bases: :py:obj:`_Piscis`


   
   Class for running the PyTorch port of the legacy Piscis algorithm originally implemented in JAX.



   :Attributes:

       **model_name** : str
           Model name.

       **batch_size** : int
           Batch size for the CNN.

       **adjustment** : str
           Adjustment type applied to images during preprocessing.

       **input_size** : Tuple[int, int]
           Input size for the CNN.

       **dilation_iterations** : int
           Number of iterations used to dilate ground truth labels during training.

       **channels** : int
           Number of channels in the input images.

       **device** : Optional[Union[str, torch.device]]
           Device to run the model on.

       **pooling** : str
           Pooling type applied to labels.

       **model** : SpotsModel
           Model.













   ..
       !! processed by numpydoc !!

   .. py:method:: predict(x: Union[numpy.ndarray, dask.array.Array], stack: bool = False, scale: float = 1.0, threshold: float = 1.0, min_distance: int = 1, intermediates: bool = False) -> Union[Tuple[numpy.ndarray, xarray.DataArray], numpy.ndarray]

      
      Predict spots in an image or stack of images.


      :Parameters:

          **x** : np.ndarray or da.Array
              Image or stack of images.

          **stack** : bool, optional
              Whether `x` is a stack of images. Default is False.

          **scale** : float, optional
              Scale factor for rescaling `x`. Default is 1.

          **threshold** : float, optional
              Spot detection threshold. Can be interpreted as the minimum number of fully confident pixels necessary to
              identify a spot. Default is 1.0.

          **min_distance** : int, optional
              Minimum distance between spots. Default is 1.

          **intermediates** : bool, optional
              Whether to return intermediate feature maps. Default is False.



      :Returns:

          **coords** : np.ndarray
              Predicted spot coordinates.

          **y** : np.ndarray, optional
              Intermediate feature maps. Only returned if `intermediates` is True.











      ..
          !! processed by numpydoc !!


