Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This file is part of libtcspc
# Copyright 2019-2024 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: MIT
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

---
BasedOnStyle: LLVM
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

name: CI

on:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

# VSCode specific files
.vscode/
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand All @@ -8,3 +11,7 @@ repos:
rev: v23.1.1
hooks:
- id: clang-format
- repo: https://github.com/fsfe/reuse-tool
rev: v6.2.0
hooks:
- id: reuse-lint-file
15 changes: 2 additions & 13 deletions DelayedNotifier.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright (C) 2024 Board of Regents of the University of Wisconsin System
//
// This file is distributed under the BSD license. License text is included
// with the source distribution.
//
// This file is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// Author: Mark A. Tsuchida
// Copyright 2024-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

Expand Down
3 changes: 3 additions & 0 deletions Detector.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "Random.h"
Expand Down
3 changes: 3 additions & 0 deletions DeviceAdapter.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#include "SimCam.h"
#include "SimFocus.h"
#include "SimHub.h"
Expand Down
3 changes: 3 additions & 0 deletions Gaussian2DFilter.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

// Implementation of fast 2D Gaussian filtering according to:
// Young IT, van Vliet LJ, 1995, Signal Processing 44:139-151.
// Recursive implementation of the Gaussian filter.
Expand Down
3 changes: 3 additions & 0 deletions Gaussian2DFilter.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include <array>
Expand Down
9 changes: 9 additions & 0 deletions LICENSES/BSD-2-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Copyright (c) <year> <owner>

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 changes: 18 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MIT License

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 2 additions & 13 deletions ProcessModel.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
// Copyright (C) 2024 Board of Regents of the University of Wisconsin System
//
// This file is distributed under the BSD license. License text is included
// with the source distribution.
//
// This file is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
//
// Author: Mark A. Tsuchida
// Copyright 2024-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

Expand Down
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!--
Copyright 2025-2026 Board of Regents of the University of Wisconsin System
SPDX-License-Identifier: BSD-2-Clause
-->

# SimulatedCamera

A Micro-Manager device adapter that simulates a simple microscope. Like
DemoCamera, it needs no hardware, but its images are more realistic. The
specimen (filaments or nuclei) moves with the XY stage, blurs with defocus,
and responds to the objective, exposure, and shutter.

## Devices

Add **SimHub** in the Hardware Configuration Wizard, then choose any of its
peripherals:

- **SimCam**: 512 x 512, 16-bit camera. The `Mode` property selects the
specimen (`Filaments` or `Nuclei`). Exposure scales the signal. Images
include shot and read noise.
- **SimXY**: XY stage. Moving it moves the specimen in the image.
- **SimFocus**: Z stage. Moving away from focus blurs the image.
- **SimObjectiveTurret**: Objectives from 10x to 100x. Magnification sets the
image scale, NA sets how quickly blur increases with defocus, and both
affect brightness.
- **SimShutter**: When closed, the camera sees no light (noise only). If no
shutter is loaded, light is always on.

The stages move at a finite speed and have properties to adjust their timing.

The image simulation is only roughly realistic and is not always physically
correct. Its details will likely change in future versions.

## Building

Requires a C++17 compiler, [Meson](https://mesonbuild.com/),
[Ninja](https://ninja-build.org/), and [just](https://just.systems/). Most
dependencies are downloaded automatically. Boost is optional. See the
[justfile](justfile) (or run `just`) for the available commands. Typically:

```sh
just build
just test
```

## Installing

The build produces `builddir/SimulatedCamera.mmdev`. Currently, you need to
copy this file into your Micro-Manager installation directory and rename it:

| Platform | File name |
| -------- | ------------------------------- |
| Windows | `mmgr_dal_SimulatedCamera.dll` |
| Linux | `mmgr_dal_SimulatedCamera.so.0` |
| macOS | `mmgr_dal_SimulatedCamera` |
3 changes: 3 additions & 0 deletions Random.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#ifdef USE_BOOST_RANDOM
Expand Down
3 changes: 3 additions & 0 deletions SimCam.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "Detector.h"
Expand Down
3 changes: 3 additions & 0 deletions SimFocus.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "DelayedNotifier.h"
Expand Down
3 changes: 3 additions & 0 deletions SimHub.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#include "SimHub.h"

#include "SimCam.h"
Expand Down
3 changes: 3 additions & 0 deletions SimHub.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "DeviceBase.h"
Expand Down
3 changes: 3 additions & 0 deletions SimObjectiveTurret.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "DeviceBase.h"
Expand Down
3 changes: 3 additions & 0 deletions SimShutter.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "SimHub.h"
Expand Down
3 changes: 3 additions & 0 deletions SimXY.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "DelayedNotifier.h"
Expand Down
3 changes: 3 additions & 0 deletions Specimen.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#pragma once

#include "Gaussian2DFilter.h"
Expand Down
3 changes: 3 additions & 0 deletions bench_SimulatedSpecimen.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#include "Detector.h"
#include "Gaussian2DFilter.h"
#include "Specimen.h"
Expand Down
3 changes: 3 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

# Show usage
help:
@just --list
Expand Down
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

# This Meson script is experimental and potentially incomplete. It is not part
# of the supported build system for Micro-Manager or mmCoreAndDevices (yet).

Expand Down
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

option('benchmarks', type: 'feature', value: 'auto',
description: 'Enable performance benchmarks')
option('use_boost', type: 'feature', value: 'auto',
Expand Down
3 changes: 3 additions & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

/packagecache/
.wraplock

Expand Down
3 changes: 3 additions & 0 deletions subprojects/asmjit.wrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

[wrap-git]
url = https://github.com/asmjit/asmjit
revision = a3199e8857792cd10b7589ff5d58343d2c9008ea
Expand Down
3 changes: 3 additions & 0 deletions subprojects/blend2d.wrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

[wrap-git]
url = https://github.com/blend2d/blend2d.git
revision = 007bf4828120dd1f5a3fd17d73c8cd7137155494
Expand Down
4 changes: 4 additions & 0 deletions subprojects/catch2.wrap.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
catch2.wrap from https://github.com/mesonbuild/wrapdb

Copyright (c) 2021 The Meson development team
SPDX-License-Identifier: MIT
4 changes: 4 additions & 0 deletions subprojects/google-benchmark.wrap.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
google-benchmark.wrap from https://github.com/mesonbuild/wrapdb

Copyright (c) 2021 The Meson development team
SPDX-License-Identifier: MIT
3 changes: 3 additions & 0 deletions subprojects/libhwy.wrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

[wrap-git]
# Using Git (post 1.3.0) for now because Meson build is new since 1.3.0 release
url = https://github.com/google/highway
Expand Down
3 changes: 3 additions & 0 deletions subprojects/mmdevice.wrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2025-2026 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: BSD-2-Clause

[wrap-git]
url = https://github.com/micro-manager/mmdevice.git
revision = HEAD
Expand Down
3 changes: 3 additions & 0 deletions test_SimulatedCamera.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2025-2026 Board of Regents of the University of Wisconsin System
// SPDX-License-Identifier: BSD-2-Clause

#include "Detector.h"
#include "Gaussian2DFilter.h"
#include "Specimen.h"
Expand Down
Loading