From b3e62fad63c38f1d89da09f9365803bbfdd56bd4 Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Fri, 25 Sep 2026 17:58:42 -0500 Subject: [PATCH 1/2] Add README.md (Assisted by Claude Code; any errors are mine.) --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6044fd6 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# 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` | From 23893d1364d2a3c0a63ed16b2ada1a22a63b3b4b Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Fri, 25 Sep 2026 18:09:20 -0500 Subject: [PATCH 2/2] License (BSD2) --- .clang-format | 5 ++--- .github/workflows/ci.yml | 3 +++ .gitignore | 3 +++ .pre-commit-config.yaml | 7 +++++++ DelayedNotifier.h | 15 ++------------- Detector.h | 3 +++ DeviceAdapter.cpp | 3 +++ Gaussian2DFilter.cpp | 3 +++ Gaussian2DFilter.h | 3 +++ LICENSES/BSD-2-Clause.txt | 9 +++++++++ LICENSES/MIT.txt | 18 ++++++++++++++++++ ProcessModel.h | 15 ++------------- README.md | 5 +++++ Random.h | 3 +++ SimCam.h | 3 +++ SimFocus.h | 3 +++ SimHub.cpp | 3 +++ SimHub.h | 3 +++ SimObjectiveTurret.h | 3 +++ SimShutter.h | 3 +++ SimXY.h | 3 +++ Specimen.h | 3 +++ bench_SimulatedSpecimen.cpp | 3 +++ justfile | 3 +++ meson.build | 3 +++ meson_options.txt | 3 +++ subprojects/.gitignore | 3 +++ subprojects/asmjit.wrap | 3 +++ subprojects/blend2d.wrap | 3 +++ subprojects/catch2.wrap.license | 4 ++++ subprojects/google-benchmark.wrap.license | 4 ++++ subprojects/libhwy.wrap | 3 +++ subprojects/mmdevice.wrap | 3 +++ test_SimulatedCamera.cpp | 3 +++ 34 files changed, 128 insertions(+), 29 deletions(-) create mode 100644 LICENSES/BSD-2-Clause.txt create mode 100644 LICENSES/MIT.txt create mode 100644 subprojects/catch2.wrap.license create mode 100644 subprojects/google-benchmark.wrap.license diff --git a/.clang-format b/.clang-format index d029b79..3d8881e 100644 --- a/.clang-format +++ b/.clang-format @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ef60c0..ffdb223 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.gitignore b/.gitignore index a2a463e..087abf1 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddd33a8..450a8fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/DelayedNotifier.h b/DelayedNotifier.h index f8b1f46..3444b12 100644 --- a/DelayedNotifier.h +++ b/DelayedNotifier.h @@ -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 diff --git a/Detector.h b/Detector.h index 1a122df..affac16 100644 --- a/Detector.h +++ b/Detector.h @@ -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" diff --git a/DeviceAdapter.cpp b/DeviceAdapter.cpp index 14b0e79..44d386a 100644 --- a/DeviceAdapter.cpp +++ b/DeviceAdapter.cpp @@ -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" diff --git a/Gaussian2DFilter.cpp b/Gaussian2DFilter.cpp index 1a69fb0..3e486e7 100644 --- a/Gaussian2DFilter.cpp +++ b/Gaussian2DFilter.cpp @@ -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. diff --git a/Gaussian2DFilter.h b/Gaussian2DFilter.h index 11476b8..9cf6b83 100644 --- a/Gaussian2DFilter.h +++ b/Gaussian2DFilter.h @@ -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 diff --git a/LICENSES/BSD-2-Clause.txt b/LICENSES/BSD-2-Clause.txt new file mode 100644 index 0000000..5f662b3 --- /dev/null +++ b/LICENSES/BSD-2-Clause.txt @@ -0,0 +1,9 @@ +Copyright (c) + +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. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..d817195 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,18 @@ +MIT License + +Copyright (c) + +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. diff --git a/ProcessModel.h b/ProcessModel.h index 2419f4d..186690d 100644 --- a/ProcessModel.h +++ b/ProcessModel.h @@ -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 diff --git a/README.md b/README.md index 6044fd6..de82aa8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ + + # SimulatedCamera A Micro-Manager device adapter that simulates a simple microscope. Like diff --git a/Random.h b/Random.h index 1163c37..6e12eaf 100644 --- a/Random.h +++ b/Random.h @@ -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 diff --git a/SimCam.h b/SimCam.h index e236206..7018892 100644 --- a/SimCam.h +++ b/SimCam.h @@ -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" diff --git a/SimFocus.h b/SimFocus.h index 0c80b25..4dc1865 100644 --- a/SimFocus.h +++ b/SimFocus.h @@ -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" diff --git a/SimHub.cpp b/SimHub.cpp index 5fb4379..a782fcc 100644 --- a/SimHub.cpp +++ b/SimHub.cpp @@ -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" diff --git a/SimHub.h b/SimHub.h index 756219b..2582c55 100644 --- a/SimHub.h +++ b/SimHub.h @@ -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" diff --git a/SimObjectiveTurret.h b/SimObjectiveTurret.h index d32c1b6..2dde5b2 100644 --- a/SimObjectiveTurret.h +++ b/SimObjectiveTurret.h @@ -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" diff --git a/SimShutter.h b/SimShutter.h index 92a772c..d43d6fc 100644 --- a/SimShutter.h +++ b/SimShutter.h @@ -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" diff --git a/SimXY.h b/SimXY.h index 1df2265..acffe70 100644 --- a/SimXY.h +++ b/SimXY.h @@ -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" diff --git a/Specimen.h b/Specimen.h index c767665..6ece911 100644 --- a/Specimen.h +++ b/Specimen.h @@ -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" diff --git a/bench_SimulatedSpecimen.cpp b/bench_SimulatedSpecimen.cpp index f5e0f70..6212377 100644 --- a/bench_SimulatedSpecimen.cpp +++ b/bench_SimulatedSpecimen.cpp @@ -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" diff --git a/justfile b/justfile index 6ceda43..8430c6a 100644 --- a/justfile +++ b/justfile @@ -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 diff --git a/meson.build b/meson.build index b54bc2f..a1afb6a 100644 --- a/meson.build +++ b/meson.build @@ -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). diff --git a/meson_options.txt b/meson_options.txt index cdc240b..e8086a0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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', diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 0949a88..16ac713 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1,3 +1,6 @@ +# Copyright 2025-2026 Board of Regents of the University of Wisconsin System +# SPDX-License-Identifier: BSD-2-Clause + /packagecache/ .wraplock diff --git a/subprojects/asmjit.wrap b/subprojects/asmjit.wrap index 649dece..b647a3e 100644 --- a/subprojects/asmjit.wrap +++ b/subprojects/asmjit.wrap @@ -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 diff --git a/subprojects/blend2d.wrap b/subprojects/blend2d.wrap index 729557c..baf2369 100644 --- a/subprojects/blend2d.wrap +++ b/subprojects/blend2d.wrap @@ -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 diff --git a/subprojects/catch2.wrap.license b/subprojects/catch2.wrap.license new file mode 100644 index 0000000..90049fc --- /dev/null +++ b/subprojects/catch2.wrap.license @@ -0,0 +1,4 @@ +catch2.wrap from https://github.com/mesonbuild/wrapdb + +Copyright (c) 2021 The Meson development team +SPDX-License-Identifier: MIT diff --git a/subprojects/google-benchmark.wrap.license b/subprojects/google-benchmark.wrap.license new file mode 100644 index 0000000..5b380e5 --- /dev/null +++ b/subprojects/google-benchmark.wrap.license @@ -0,0 +1,4 @@ +google-benchmark.wrap from https://github.com/mesonbuild/wrapdb + +Copyright (c) 2021 The Meson development team +SPDX-License-Identifier: MIT diff --git a/subprojects/libhwy.wrap b/subprojects/libhwy.wrap index ff90778..2bcb7dd 100644 --- a/subprojects/libhwy.wrap +++ b/subprojects/libhwy.wrap @@ -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 diff --git a/subprojects/mmdevice.wrap b/subprojects/mmdevice.wrap index d3d5465..0de09a9 100644 --- a/subprojects/mmdevice.wrap +++ b/subprojects/mmdevice.wrap @@ -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 diff --git a/test_SimulatedCamera.cpp b/test_SimulatedCamera.cpp index 184386a..163057b 100644 --- a/test_SimulatedCamera.cpp +++ b/test_SimulatedCamera.cpp @@ -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"