Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ ci:

repos:
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.25
rev: '0.26'
hooks:
- id: validate-pyproject

- repo: https://github.com/adhtruong/mirrors-typos
rev: v1.47.2
rev: v1.50.3
hooks:
- id: typos
args: [--force-exclude] # omitting --write-changes

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.19
rev: v0.16.10
hooks:
- id: ruff-check
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.1.0
rev: v2.4.0
hooks:
- id: mypy
files: "^src/"
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ from microsim.util import ortho_plot
# define the parameters of the simulation
sim = ms.Simulation(
truth_space=ms.ShapeScaleSpace(shape=(128, 512, 512), scale=(0.02, 0.01, 0.01)),
output_space={'downscale': 8},
sample=ms.Sample(
labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]
),
output_space={"downscale": 8},
sample=ms.Sample(labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]),
modality=ms.Confocal(pinhole_au=0.2),
output_path="au02.tiff",
)
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Simulation(
truth_space=ms.ShapeScaleSpace(shape=(256, 1024, 1024), scale=(0.02, 0.01, 0.01)),
# downscale output to 160nm x 80nm x 80nm pixels with shape (32, 128, 128)
output_space=ms.DownscaledSpace(downscale=8),
sample=ms.Sample(labels=[]) # ...
sample=ms.Sample(labels=[]), # ...
)
```

Expand Down
26 changes: 12 additions & 14 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ Construct and run a [`microsim.Simulation`][] object.

sim = ms.Simulation(
truth_space=ms.ShapeScaleSpace(shape=(128, 512, 512), scale=(0.02, 0.01, 0.01)),
output_space={'downscale': 8},
sample=ms.Sample(
labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]
),
output_space={"downscale": 8},
sample=ms.Sample(labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]),
modality=ms.Confocal(pinhole_au=0.2),
)
result = sim.run()
Expand All @@ -67,20 +65,20 @@ Construct and run a [`microsim.Simulation`][] object.
from microsim.util import ortho_plot

sim = Simulation(
truth_space={'shape': (128, 512, 512), 'scale': (0.02, 0.01, 0.01)},
output_space={'downscale': 8},
truth_space={"shape": (128, 512, 512), "scale": (0.02, 0.01, 0.01)},
output_space={"downscale": 8},
sample=dict(
labels=[
{
'type': 'matslines',
'density': 0.5,
'length': 30,
'azimuth': 5,
'max_r': 1,
{
"type": "matslines",
"density": 0.5,
"length": 30,
"azimuth": 5,
"max_r": 1,
}
]
),
modality={'type': 'confocal', 'pinhole_au': 0.2}
modality={"type": "confocal", "pinhole_au": 0.2},
)
result = sim.run()
ortho_plot(result)
Expand Down Expand Up @@ -126,7 +124,7 @@ the result of the simulation to a file.
from microsim import Simulation
from pathlib import Path

spec = Path('confocal.json').read_text()
spec = Path("confocal.json").read_text()
sim = Simulation.model_validate_json(spec)
sim.run()
```
Expand Down
35 changes: 27 additions & 8 deletions docs/stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stage, this volume will be downsampled to the final image shape and scale
from microsim import Simulation

sim = Simulation(
truth_space={'shape': (512, 1024, 1024), 'scale': (0.04, 0.02, 0.02)},
truth_space={"shape": (512, 1024, 1024), "scale": (0.04, 0.02, 0.02)},
output_space={"downscale": 4},
)
```
Expand Down Expand Up @@ -75,10 +75,15 @@ fluorophores present at each voxel in the volume.
sim = Simulation(
# ...,
sample={
'labels': [
"labels": [
{
'distribution': {'type': 'matslines', 'density': 0.5, 'length': 30, 'azimuth': 5},
'fluorophore': 'EGFP'
"distribution": {
"type": "matslines",
"density": 0.5,
"length": 30,
"azimuth": 5,
},
"fluorophore": "EGFP",
}
],
},
Expand Down Expand Up @@ -240,9 +245,19 @@ channel 1. This is why both F and C remain at this stage.
{
"name": "Green",
"filters": [
{"type": "bandpass", "bandcenter": 470, "bandwidth": 40, "placement": "EX"},
{
"type": "bandpass",
"bandcenter": 470,
"bandwidth": 40,
"placement": "EX",
},
{"type": "longpass", "cuton": 495, "placement": "BS"},
{"type": "bandpass", "bandcenter": 525, "bandwidth": 50, "placement": "EM"}
{
"type": "bandpass",
"bandcenter": 525,
"bandwidth": 50,
"placement": "EM",
},
],
}
],
Expand Down Expand Up @@ -350,8 +365,12 @@ bin in the detector.
sim = Simulation(
# ...,
channels=["4yL4ggAo::491"],
objective_lens={"numerical_aperture": 1.4, "immersion_medium_ri": 1.515, 'specimen_ri': 1.33},
modality={"type": "confocal", 'pinhole_au': 1.2},
objective_lens={
"numerical_aperture": 1.4,
"immersion_medium_ri": 1.515,
"specimen_ri": 1.33,
},
modality={"type": "confocal", "pinhole_au": 1.2},
)
```

Expand Down
Loading