Microscope#
- class deeptrack.optics.Microscope(sample: Feature, objective: Feature, **kwargs: Dict[str, Any])#
Bases:
StructuralFeatureSimulates imaging of a sample using an optical system.
This class combines a feature-set that defines the sample to be imaged with a feature-set defining the optical system, enabling the simulation of optical imaging processes.
Parameters#
- sample: Feature
A feature-set resolving a list of images describing the sample to be imaged.
- objective: Feature
A feature-set defining the optical device that images the sample.
Attributes#
- __distributed__: bool
If True, the feature is distributed across multiple workers.
- _sample: Feature
The feature-set defining the sample to be imaged.
- _objective: Feature
The feature-set defining the optical system imaging the sample.
Methods#
- get(image: Image or None, **kwargs: Dict[str, Any]) -> Image
Simulates the imaging process using the defined optical system and returns the resulting image.
Examples#
Simulating an image using a brightfield optical system:
>>> import deeptrack as dt
>>> scatterer = dt.PointParticle() >>> optics = dt.Brightfield() >>> microscope = dt.Microscope(sample=scatterer, objective=optics) >>> image = microscope.get(None) >>> print(image.shape) (128, 128, 1)
Methods Summary
get(image, **kwargs)Generate an image of the sample using the defined optical system.
Methods Documentation
- get(image: Image | None, **kwargs: Dict[str, Any]) Image#
Generate an image of the sample using the defined optical system.
This method processes the sample through the optical system to produce a simulated image.
Parameters#
- image: Union[Image, None]
The input image to be processed. If None, a new image is created.
- **kwargs: Dict[str, Any]
Additional parameters for the imaging process.
Returns#
- Image: Image
The processed image after applying the optical system.
Examples#
Simulating an image with specific parameters:
>>> import deeptrack as dt
>>> scatterer = dt.PointParticle() >>> optics = dt.Brightfield() >>> microscope = dt.Microscope(sample=scatterer, objective=optics) >>> image = microscope.get(None, upscale=(2, 2, 2)) >>> print(image.shape) (256, 256, 1)