├── .clang-format ├── .editorconfig ├── .git-blame-ignore-revs ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── documentation-request.md │ ├── feature_request.md │ └── submit-question.md ├── PULL_REQUEST_TEMPLATE.md ├── copy-pr-bot.yaml ├── ops-bot.yaml └── workflows │ ├── build.yaml │ ├── pr.yaml │ ├── test.yaml │ └── trigger-breaking-change-alert.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── 3rdparty ├── LICENSE.CLI11 ├── LICENSE.Catch2 ├── LICENSE.NVTX ├── LICENSE.StainTools ├── LICENSE.abseil-cpp ├── LICENSE.aicsimageio ├── LICENSE.benchmark ├── LICENSE.boost ├── LICENSE.click ├── LICENSE.cuda ├── LICENSE.cupy ├── LICENSE.dask ├── LICENSE.dask-cuda ├── LICENSE.dlpack ├── LICENSE.dockcross ├── LICENSE.fmt ├── LICENSE.folly ├── LICENSE.googletest ├── LICENSE.gputil ├── LICENSE.json ├── LICENSE.libcuckoo ├── LICENSE.libdeflate ├── LICENSE.libjpeg-turbo ├── LICENSE.libspng ├── LICENSE.libtiff ├── LICENSE.numpy ├── LICENSE.nvjpeg ├── LICENSE.nvjpeg2000 ├── LICENSE.opencv-contrib-python ├── LICENSE.openjpeg ├── LICENSE.openslide ├── LICENSE.pba+ ├── LICENSE.psutil ├── LICENSE.pugixml ├── LICENSE.pybind11 ├── LICENSE.pybind11_json ├── LICENSE.pytest ├── LICENSE.pytest-lazy-fixtures ├── LICENSE.pytorch ├── LICENSE.rmm ├── LICENSE.scifio ├── LICENSE.scikit-image ├── LICENSE.spdlog ├── LICENSE.taskflow ├── LICENSE.tifffile └── LICENSE.zarr-python ├── CHANGELOG.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── LICENSE-3rdparty.md ├── README.md ├── VERSION ├── benchmarks ├── CMakeLists.txt ├── config.h ├── main.cpp ├── primitives.cpp └── skimage │ ├── _image_bench.py │ ├── bench_convolve.py │ ├── cucim_color_bench.py │ ├── cucim_exposure_bench.py │ ├── cucim_feature_bench.py │ ├── cucim_filters_bench.py │ ├── cucim_measure_bench.py │ ├── cucim_metrics_bench.py │ ├── cucim_morphology_bench.py │ ├── cucim_registration_bench.py │ ├── cucim_restoration_bench.py │ ├── cucim_segmentation_bench.py │ ├── cucim_transform_bench.py │ ├── cupyx_scipy_ndimage_filter_bench.py │ ├── cupyx_scipy_ndimage_fourier_bench.py │ ├── cupyx_scipy_ndimage_interp_bench.py │ ├── cupyx_scipy_ndimage_measurements_bench.py │ ├── cupyx_scipy_ndimage_morphology_bench.py │ ├── requirements-bench.txt │ ├── run-all.sh │ ├── run-nv-bench-color.sh │ ├── run-nv-bench-exposure.sh │ ├── run-nv-bench-feature.sh │ ├── run-nv-bench-filters.sh │ ├── run-nv-bench-measure.sh │ ├── run-nv-bench-metrics.sh │ ├── run-nv-bench-morphology.sh │ ├── run-nv-bench-registration.sh │ ├── run-nv-bench-restoration.sh │ ├── run-nv-bench-segmentation.sh │ └── run-nv-bench-transform.sh ├── ci ├── build_cpp.sh ├── build_docs.sh ├── build_python.sh ├── build_wheel.sh ├── check_style.sh ├── release │ └── update-version.sh ├── test_python.sh ├── test_wheel.sh └── validate_wheel.sh ├── conda ├── environments │ ├── all_cuda-128_arch-aarch64.yaml │ └── all_cuda-128_arch-x86_64.yaml └── recipes │ ├── cucim │ ├── build.sh │ ├── conda_build_config.yaml │ └── meta.yaml │ └── libcucim │ ├── build.sh │ ├── conda_build_config.yaml │ └── meta.yaml ├── cpp ├── CMakeLists.txt ├── cmake │ ├── cucim-config.cmake.in │ ├── deps │ │ ├── abseil.cmake │ │ ├── boost-header-only.cmake │ │ ├── boost-header-only.patch │ │ ├── boost.cmake │ │ ├── catch2.cmake │ │ ├── cli11.cmake │ │ ├── fmt.cmake │ │ ├── googlebenchmark.cmake │ │ ├── googletest.cmake │ │ ├── json.cmake │ │ ├── libcuckoo.cmake │ │ ├── libcuckoo.patch │ │ ├── nvtx3.cmake │ │ ├── openslide.cmake │ │ ├── pybind11.cmake │ │ ├── pybind11_pr4857_4877.patch │ │ ├── rmm.cmake │ │ └── taskflow.cmake │ └── modules │ │ ├── CuCIMUtils.cmake │ │ └── SuperBuildUtils.cmake ├── include │ └── cucim │ │ ├── 3rdparty │ │ └── dlpack │ │ │ ├── dlpack.h │ │ │ └── dlpackcpp.h │ │ ├── cache │ │ ├── cache_type.h │ │ ├── image_cache.h │ │ ├── image_cache_config.h │ │ └── image_cache_manager.h │ │ ├── codec │ │ ├── base64.h │ │ ├── hash_function.h │ │ └── methods.h │ │ ├── concurrent │ │ └── threadpool.h │ │ ├── config │ │ └── config.h │ │ ├── core │ │ ├── framework.h │ │ ├── interface.h │ │ ├── plugin.h │ │ ├── plugin_util.h │ │ └── version.h │ │ ├── cpp20 │ │ └── find_if.h │ │ ├── cuimage.h │ │ ├── dynlib │ │ └── helper.h │ │ ├── filesystem │ │ ├── cufile_driver.h │ │ ├── file_handle.h │ │ └── file_path.h │ │ ├── io │ │ ├── device.h │ │ ├── device_type.h │ │ └── format │ │ │ └── image_format.h │ │ ├── loader │ │ ├── batch_data_processor.h │ │ ├── thread_batch_data_loader.h │ │ └── tile_info.h │ │ ├── logger │ │ ├── logger.h │ │ └── timer.h │ │ ├── macros │ │ ├── api_header.h │ │ └── defines.h │ │ ├── memory │ │ ├── dlpack.h │ │ └── memory_manager.h │ │ ├── plugin │ │ ├── image_format.h │ │ └── plugin_config.h │ │ ├── profiler │ │ ├── nvtx3.h │ │ ├── profiler.h │ │ └── profiler_config.h │ │ └── util │ │ ├── cuda.h │ │ ├── file.h │ │ └── platform.h ├── plugins │ ├── cucim.kit.cumed │ │ ├── .clang-format │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .idea │ │ │ ├── .gitignore │ │ │ ├── .name │ │ │ ├── codeStyles │ │ │ │ ├── Project.xml │ │ │ │ └── codeStyleConfig.xml │ │ │ ├── cucim.kit.cumed.iml │ │ │ ├── fileTemplates │ │ │ │ ├── includes │ │ │ │ │ ├── NVIDIA_CMAKE_HEADER.cmake │ │ │ │ │ └── NVIDIA_C_HEADER.h │ │ │ │ └── internal │ │ │ │ │ ├── C Header File.h │ │ │ │ │ ├── C Source File.c │ │ │ │ │ ├── C++ Class Header.h │ │ │ │ │ ├── C++ Class.cc │ │ │ │ │ └── CMakeLists.txt.cmake │ │ │ ├── misc.xml │ │ │ └── vcs.xml │ │ ├── CMakeLists.txt │ │ ├── benchmarks │ │ │ ├── CMakeLists.txt │ │ │ ├── config.h │ │ │ └── main.cpp │ │ ├── cmake │ │ │ ├── cucim.kit.cumed-config.cmake.in │ │ │ ├── deps │ │ │ │ ├── catch2.cmake │ │ │ │ ├── cli11.cmake │ │ │ │ ├── fmt.cmake │ │ │ │ ├── googlebenchmark.cmake │ │ │ │ └── googletest.cmake │ │ │ └── modules │ │ │ │ ├── CuCIMUtils.cmake │ │ │ │ └── SuperBuildUtils.cmake │ │ ├── src │ │ │ └── cumed │ │ │ │ ├── cumed.cpp │ │ │ │ └── cumed.h │ │ ├── test_data │ │ └── tests │ │ │ ├── CMakeLists.txt │ │ │ ├── config.h │ │ │ ├── main.cpp │ │ │ └── test_basic.cpp │ └── cucim.kit.cuslide │ │ ├── .clang-format │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .idea │ │ ├── .gitignore │ │ ├── .name │ │ ├── codeStyles │ │ │ ├── Project.xml │ │ │ └── codeStyleConfig.xml │ │ ├── cucim.kit.cuslide.iml │ │ ├── fileTemplates │ │ │ ├── includes │ │ │ │ ├── NVIDIA_CMAKE_HEADER.cmake │ │ │ │ └── NVIDIA_C_HEADER.h │ │ │ └── internal │ │ │ │ ├── C Header File.h │ │ │ │ ├── C Source File.c │ │ │ │ ├── C++ Class Header.h │ │ │ │ ├── C++ Class.cc │ │ │ │ └── CMakeLists.txt.cmake │ │ ├── misc.xml │ │ └── vcs.xml │ │ ├── .vscode │ │ └── settings.json │ │ ├── CMakeLists.txt │ │ ├── benchmarks │ │ ├── CMakeLists.txt │ │ ├── config.h │ │ └── main.cpp │ │ ├── cmake │ │ ├── cucim.kit.cuslide-config.cmake.in │ │ ├── deps │ │ │ ├── boost.cmake │ │ │ ├── catch2.cmake │ │ │ ├── cli11.cmake │ │ │ ├── fmt.cmake │ │ │ ├── googlebenchmark.cmake │ │ │ ├── googletest.cmake │ │ │ ├── json.cmake │ │ │ ├── libculibos.cmake │ │ │ ├── libdeflate.cmake │ │ │ ├── libjpeg-turbo-policies-fix.cmake │ │ │ ├── libjpeg-turbo.cmake │ │ │ ├── libjpeg-turbo.patch │ │ │ ├── libopenjpeg.cmake │ │ │ ├── libopenjpeg.patch │ │ │ ├── libtiff-policies-fix.cmake │ │ │ ├── libtiff.cmake │ │ │ ├── libtiff.patch │ │ │ ├── nvjpeg.cmake │ │ │ ├── openslide.cmake │ │ │ └── pugixml.cmake │ │ └── modules │ │ │ ├── CuCIMUtils.cmake │ │ │ └── SuperBuildUtils.cmake │ │ ├── cuslide.map │ │ ├── src │ │ └── cuslide │ │ │ ├── cuslide.cpp │ │ │ ├── cuslide.h │ │ │ ├── deflate │ │ │ ├── deflate.cpp │ │ │ └── deflate.h │ │ │ ├── jpeg │ │ │ ├── libjpeg_turbo.cpp │ │ │ ├── libjpeg_turbo.h │ │ │ ├── libnvjpeg.cpp │ │ │ └── libnvjpeg.h │ │ │ ├── jpeg2k │ │ │ ├── color_conversion.cpp │ │ │ ├── color_conversion.h │ │ │ ├── color_table.h │ │ │ ├── gen_color_table.py │ │ │ ├── libopenjpeg.cpp │ │ │ └── libopenjpeg.h │ │ │ ├── loader │ │ │ ├── nvjpeg_processor.cpp │ │ │ └── nvjpeg_processor.h │ │ │ ├── lzw │ │ │ ├── lzw.cpp │ │ │ ├── lzw.h │ │ │ ├── lzw_libtiff.cpp │ │ │ └── lzw_libtiff.h │ │ │ ├── raw │ │ │ ├── raw.cpp │ │ │ └── raw.h │ │ │ ├── srctest.h │ │ │ └── tiff │ │ │ ├── ifd.cpp │ │ │ ├── ifd.h │ │ │ ├── tiff.cpp │ │ │ ├── tiff.h │ │ │ └── types.h │ │ ├── test_data │ │ └── tests │ │ ├── CMakeLists.txt │ │ ├── config.h │ │ ├── main.cpp │ │ ├── test_philips_tiff.cpp │ │ ├── test_read_rawtiff.cpp │ │ └── test_read_region.cpp ├── src │ ├── cache │ │ ├── cache_type.cpp │ │ ├── image_cache.cpp │ │ ├── image_cache_config.cpp │ │ ├── image_cache_empty.cpp │ │ ├── image_cache_empty.h │ │ ├── image_cache_manager.cpp │ │ ├── image_cache_per_process.cpp │ │ ├── image_cache_per_process.h │ │ ├── image_cache_shared_memory.cpp │ │ └── image_cache_shared_memory.h │ ├── codec │ │ └── base64.cpp │ ├── concurrent │ │ └── threadpool.cpp │ ├── config │ │ └── config.cpp │ ├── core │ │ ├── cucim_framework.cpp │ │ ├── cucim_framework.h │ │ ├── cucim_plugin.cpp │ │ ├── cucim_plugin.h │ │ ├── framework.cpp │ │ ├── plugin_manager.cpp │ │ ├── plugin_manager.h │ │ └── version.inl │ ├── cuimage.cpp │ ├── filesystem │ │ ├── cufile_driver.cpp │ │ └── file_handle.cpp │ ├── io │ │ ├── device.cpp │ │ ├── device_type.cpp │ │ └── format │ │ │ └── image_format.cpp │ ├── loader │ │ ├── batch_data_processor.cpp │ │ └── thread_batch_data_loader.cpp │ ├── logger │ │ ├── logger.cpp │ │ └── timer.cpp │ ├── memory │ │ └── memory_manager.cpp │ ├── plugin │ │ ├── image_format.cpp │ │ └── plugin_config.cpp │ ├── profiler │ │ ├── profiler.cpp │ │ └── profiler_config.cpp │ └── util │ │ ├── file.cpp │ │ └── platform.cpp └── tests │ ├── CMakeLists.txt │ ├── config.h │ ├── main.cpp │ ├── test_cufile.cpp │ ├── test_metadata.cpp │ └── test_read_region.cpp ├── cucim.code-workspace ├── dependencies.yaml ├── docs ├── Makefile ├── README.md ├── adr │ ├── README.md │ └── example.md ├── make.bat ├── references.css ├── requirement.txt └── source │ ├── _static │ └── EMPTY │ ├── api.rst │ ├── conf.py │ ├── ext │ └── doi_role.py │ └── index.rst ├── examples ├── cpp │ ├── CMakeLists.txt │ ├── CMakeLists.txt.examples.release.in │ └── tiff_image │ │ └── main.cpp └── python │ ├── distance_transform_edt_demo.py │ ├── gds_whole_slide │ ├── README.md │ ├── benchmark_read.py │ ├── benchmark_round_trip.py │ ├── benchmark_zarr_write.py │ ├── benchmark_zarr_write_lz4_via_dask.py │ ├── demo_implementation.py │ └── lz4_nvcomp.py │ └── tiff_image │ └── main.py ├── experiments ├── Supporting_Aperio_SVS_Format │ └── benchmark.py └── Using_Cache │ └── benchmark.py ├── gds ├── CMakeLists.txt ├── include │ └── cufile_stub.h └── src │ └── cufile_stub.cpp ├── notebooks ├── Accessing_File_with_GDS.ipynb ├── Basic_Usage.ipynb ├── File-access_Experiments_on_TIFF.ipynb ├── Multi-thread_and_Multi-process_Tests.ipynb ├── Supporting_Aperio_SVS_Format.ipynb ├── Using_Cache.ipynb ├── Welcome.ipynb ├── Working_with_Albumentation.ipynb ├── Working_with_DALI.ipynb ├── gabor_example.ipynb ├── input │ └── README.md ├── random_walker_example.ipynb ├── static_images │ ├── File-access_Experiments_on_TIFF_FileFormat.png │ ├── File-access_Experiments_on_TIFF_FileFormat2.png │ ├── File-access_Experiments_on_TIFF_HDD.png │ ├── File-access_Experiments_on_TIFF_NVMe.png │ ├── File-access_Experiments_on_TIFF_SSD.png │ └── Multi-thread_and_Multi-process_Tests_Alignment.png └── vesselness_example.ipynb ├── python ├── .clang-format ├── .editorconfig ├── .gitignore ├── .idea │ ├── .gitignore │ ├── .name │ ├── codeStyles │ │ ├── Project.xml │ │ └── codeStyleConfig.xml │ ├── dataSources.xml │ ├── fileTemplates │ │ ├── includes │ │ │ ├── NVIDIA_CMAKE_HEADER.cmake │ │ │ └── NVIDIA_C_HEADER.h │ │ └── internal │ │ │ ├── C Header File.h │ │ │ ├── C Source File.c │ │ │ ├── C++ Class Header.h │ │ │ ├── C++ Class.cc │ │ │ └── CMakeLists.txt.cmake │ ├── misc.xml │ ├── pycucim.iml │ ├── python.iml │ └── vcs.xml ├── .vscode │ └── settings.json ├── CMakeLists.txt ├── cmake │ ├── deps │ │ ├── fmt.cmake │ │ ├── json.cmake │ │ ├── pybind11.cmake │ │ ├── pybind11_json.cmake │ │ └── pybind11_pr4857_4877.patch │ └── modules │ │ ├── CuCIMUtils.cmake │ │ └── SuperBuildUtils.cmake ├── cucim │ ├── .coveragerc │ ├── .editorconfig │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── LICENSE-3rdparty.md │ ├── MANIFEST.in │ ├── README.md │ ├── VERSION │ ├── pyproject.toml │ ├── setup.py │ ├── src │ │ ├── cucim │ │ │ ├── VERSION │ │ │ ├── __init__.py │ │ │ ├── __init__.pyi │ │ │ ├── __main__.py │ │ │ ├── _misc.py │ │ │ ├── _version.py │ │ │ ├── clara │ │ │ │ ├── __init__.py │ │ │ │ ├── cache │ │ │ │ │ └── __init__.py │ │ │ │ ├── cli.py │ │ │ │ ├── converter │ │ │ │ │ └── tiff.py │ │ │ │ ├── filesystem │ │ │ │ │ └── __init__.py │ │ │ │ └── io │ │ │ │ │ └── __init__.py │ │ │ ├── core │ │ │ │ ├── __init__.py │ │ │ │ └── operations │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── color │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── jitter.py │ │ │ │ │ ├── kernel │ │ │ │ │ │ └── cuda_kernel_source.py │ │ │ │ │ ├── stain_normalizer.py │ │ │ │ │ └── tests │ │ │ │ │ │ └── test_color_jitter.py │ │ │ │ │ ├── expose │ │ │ │ │ ├── tests │ │ │ │ │ │ └── test_expose.py │ │ │ │ │ └── transform.py │ │ │ │ │ ├── intensity │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── kernel │ │ │ │ │ │ └── cuda_kernel_source.py │ │ │ │ │ ├── normalize.py │ │ │ │ │ ├── scaling.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── normalized.png │ │ │ │ │ │ ├── normalized_atan.png │ │ │ │ │ │ ├── scaled.png │ │ │ │ │ │ ├── test_normalize.py │ │ │ │ │ │ ├── test_rand_zoom.py │ │ │ │ │ │ ├── test_scaling.py │ │ │ │ │ │ ├── test_zoom.py │ │ │ │ │ │ ├── zoomed.png │ │ │ │ │ │ └── zoomout_padded.png │ │ │ │ │ └── zoom.py │ │ │ │ │ ├── morphology │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _distance_transform.py │ │ │ │ │ ├── _pba_2d.py │ │ │ │ │ ├── _pba_3d.py │ │ │ │ │ ├── cuda │ │ │ │ │ │ ├── pba_kernels_2d.h │ │ │ │ │ │ └── pba_kernels_3d.h │ │ │ │ │ └── tests │ │ │ │ │ │ └── test_distance_transform.py │ │ │ │ │ └── spatial │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── rotate_and_flip.py │ │ │ │ │ └── tests │ │ │ │ │ ├── flipped.png │ │ │ │ │ ├── rotated.png │ │ │ │ │ ├── test_flip.py │ │ │ │ │ ├── test_random_flip.py │ │ │ │ │ ├── test_random_rotate90.py │ │ │ │ │ └── test_rotate90.py │ │ │ ├── py.typed │ │ │ ├── skimage │ │ │ │ ├── __init__.py │ │ │ │ ├── __init__.pyi │ │ │ │ ├── _shared │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _dependency_checks.py │ │ │ │ │ ├── _gradient.py │ │ │ │ │ ├── _warnings.py │ │ │ │ │ ├── compat.py │ │ │ │ │ ├── coord.py │ │ │ │ │ ├── distance.py │ │ │ │ │ ├── fft.py │ │ │ │ │ ├── filters.py │ │ │ │ │ ├── testing.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── test_coord.py │ │ │ │ │ │ ├── test_utils.py │ │ │ │ │ │ └── test_warnings.py │ │ │ │ │ ├── utils.py │ │ │ │ │ └── version_requirements.py │ │ │ │ ├── _vendored │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _internal.py │ │ │ │ │ ├── _ndimage_filters.py │ │ │ │ │ ├── _ndimage_filters_core.py │ │ │ │ │ ├── _ndimage_interp_kernels.py │ │ │ │ │ ├── _ndimage_interpolation.py │ │ │ │ │ ├── _ndimage_measurements.py │ │ │ │ │ ├── _ndimage_morphology.py │ │ │ │ │ ├── _ndimage_spline_kernel_weights.py │ │ │ │ │ ├── _ndimage_spline_prefilter_core.py │ │ │ │ │ ├── _ndimage_util.py │ │ │ │ │ ├── _pearsonr.py │ │ │ │ │ ├── _signaltools_core.py │ │ │ │ │ ├── _texture.py │ │ │ │ │ ├── ndimage.py │ │ │ │ │ ├── pad.py │ │ │ │ │ ├── pad_elementwise.py │ │ │ │ │ ├── signaltools.py │ │ │ │ │ ├── tests │ │ │ │ │ │ └── test_morphology.py │ │ │ │ │ └── time.py │ │ │ │ ├── color │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── adapt_rgb.py │ │ │ │ │ ├── colorconv.py │ │ │ │ │ ├── colorlabel.py │ │ │ │ │ ├── delta_e.py │ │ │ │ │ ├── rgb_colors.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── ciede2000_test_data.txt │ │ │ │ │ │ ├── data │ │ │ │ │ │ ├── lab_array_a_10.npy │ │ │ │ │ │ ├── lab_array_a_2.npy │ │ │ │ │ │ ├── lab_array_a_r.npy │ │ │ │ │ │ ├── lab_array_b_10.npy │ │ │ │ │ │ ├── lab_array_b_2.npy │ │ │ │ │ │ ├── lab_array_b_r.npy │ │ │ │ │ │ ├── lab_array_c_10.npy │ │ │ │ │ │ ├── lab_array_c_2.npy │ │ │ │ │ │ ├── lab_array_c_r.npy │ │ │ │ │ │ ├── lab_array_d50_10.npy │ │ │ │ │ │ ├── lab_array_d50_2.npy │ │ │ │ │ │ ├── lab_array_d50_r.npy │ │ │ │ │ │ ├── lab_array_d55_10.npy │ │ │ │ │ │ ├── lab_array_d55_2.npy │ │ │ │ │ │ ├── lab_array_d55_r.npy │ │ │ │ │ │ ├── lab_array_d65_10.npy │ │ │ │ │ │ ├── lab_array_d65_2.npy │ │ │ │ │ │ ├── lab_array_d65_r.npy │ │ │ │ │ │ ├── lab_array_d75_10.npy │ │ │ │ │ │ ├── lab_array_d75_2.npy │ │ │ │ │ │ ├── lab_array_e_2.npy │ │ │ │ │ │ ├── luv_array_a_10.npy │ │ │ │ │ │ ├── luv_array_a_2.npy │ │ │ │ │ │ ├── luv_array_a_r.npy │ │ │ │ │ │ ├── luv_array_b_10.npy │ │ │ │ │ │ ├── luv_array_b_2.npy │ │ │ │ │ │ ├── luv_array_b_r.npy │ │ │ │ │ │ ├── luv_array_c_10.npy │ │ │ │ │ │ ├── luv_array_c_2.npy │ │ │ │ │ │ ├── luv_array_c_r.npy │ │ │ │ │ │ ├── luv_array_d50_10.npy │ │ │ │ │ │ ├── luv_array_d50_2.npy │ │ │ │ │ │ ├── luv_array_d50_r.npy │ │ │ │ │ │ ├── luv_array_d55_10.npy │ │ │ │ │ │ ├── luv_array_d55_2.npy │ │ │ │ │ │ ├── luv_array_d55_r.npy │ │ │ │ │ │ ├── luv_array_d65_10.npy │ │ │ │ │ │ ├── luv_array_d65_2.npy │ │ │ │ │ │ ├── luv_array_d65_r.npy │ │ │ │ │ │ ├── luv_array_d75_10.npy │ │ │ │ │ │ ├── luv_array_d75_2.npy │ │ │ │ │ │ └── luv_array_e_2.npy │ │ │ │ │ │ ├── test_adapt_rgb.py │ │ │ │ │ │ ├── test_colorconv.py │ │ │ │ │ │ ├── test_colorlabel.py │ │ │ │ │ │ └── test_delta_e.py │ │ │ │ ├── data │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _binary_blobs.py │ │ │ │ │ └── tests │ │ │ │ │ │ └── test_data.py │ │ │ │ ├── exposure │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _adapthist.py │ │ │ │ │ ├── exposure.py │ │ │ │ │ ├── histogram_matching.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_exposure.py │ │ │ │ │ │ └── test_histogram_matching.py │ │ │ │ ├── feature │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _basic_features.py │ │ │ │ │ ├── _canny.py │ │ │ │ │ ├── _daisy.py │ │ │ │ │ ├── _hessian_det_appx.py │ │ │ │ │ ├── blob.py │ │ │ │ │ ├── corner.py │ │ │ │ │ ├── cuda │ │ │ │ │ │ ├── _hessian_det_appx.cu │ │ │ │ │ │ └── blob.cu │ │ │ │ │ ├── match.py │ │ │ │ │ ├── peak.py │ │ │ │ │ ├── template.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── test_basic_features.py │ │ │ │ │ │ ├── test_blob.py │ │ │ │ │ │ ├── test_canny.py │ │ │ │ │ │ ├── test_corner.py │ │ │ │ │ │ ├── test_daisy.py │ │ │ │ │ │ ├── test_match.py │ │ │ │ │ │ ├── test_peak.py │ │ │ │ │ │ └── test_template.py │ │ │ │ │ └── util.py │ │ │ │ ├── filters │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _fft_based.py │ │ │ │ │ ├── _gabor.py │ │ │ │ │ ├── _gaussian.py │ │ │ │ │ ├── _median.py │ │ │ │ │ ├── _median_hist.py │ │ │ │ │ ├── _rank_order.py │ │ │ │ │ ├── _separable_filtering.py │ │ │ │ │ ├── _sparse.py │ │ │ │ │ ├── _unsharp_mask.py │ │ │ │ │ ├── _window.py │ │ │ │ │ ├── cuda │ │ │ │ │ │ └── histogram_median.cu │ │ │ │ │ ├── edges.py │ │ │ │ │ ├── lpi_filter.py │ │ │ │ │ ├── ridges.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── test_correlate.py │ │ │ │ │ │ ├── test_edges.py │ │ │ │ │ │ ├── test_fft_based.py │ │ │ │ │ │ ├── test_gabor.py │ │ │ │ │ │ ├── test_gaussian.py │ │ │ │ │ │ ├── test_lpi_filter.py │ │ │ │ │ │ ├── test_median.py │ │ │ │ │ │ ├── test_rank_order.py │ │ │ │ │ │ ├── test_ridges.py │ │ │ │ │ │ ├── test_separable_filtering.py │ │ │ │ │ │ ├── test_thresholding.py │ │ │ │ │ │ ├── test_unsharp_mask.py │ │ │ │ │ │ └── test_window.py │ │ │ │ │ └── thresholding.py │ │ │ │ ├── measure │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _blur_effect.py │ │ │ │ │ ├── _colocalization.py │ │ │ │ │ ├── _label.py │ │ │ │ │ ├── _label_kernels.py │ │ │ │ │ ├── _moments.py │ │ │ │ │ ├── _moments_analytical.py │ │ │ │ │ ├── _polygon.py │ │ │ │ │ ├── _regionprops.py │ │ │ │ │ ├── _regionprops_gpu.py │ │ │ │ │ ├── _regionprops_gpu_basic_kernels.py │ │ │ │ │ ├── _regionprops_gpu_convex.py │ │ │ │ │ ├── _regionprops_gpu_intensity_kernels.py │ │ │ │ │ ├── _regionprops_gpu_misc_kernels.py │ │ │ │ │ ├── _regionprops_gpu_moments_kernels.py │ │ │ │ │ ├── _regionprops_gpu_utils.py │ │ │ │ │ ├── _regionprops_utils.py │ │ │ │ │ ├── block.py │ │ │ │ │ ├── entropy.py │ │ │ │ │ ├── profile.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_block.py │ │ │ │ │ │ ├── test_blur_effect.py │ │ │ │ │ │ ├── test_ccomp.py │ │ │ │ │ │ ├── test_colocalization.py │ │ │ │ │ │ ├── test_entropy.py │ │ │ │ │ │ ├── test_moments.py │ │ │ │ │ │ ├── test_polygon.py │ │ │ │ │ │ ├── test_profile.py │ │ │ │ │ │ ├── test_regionprops.py │ │ │ │ │ │ └── test_regionprops_gpu_kernels.py │ │ │ │ ├── metrics │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _adapted_rand_error.py │ │ │ │ │ ├── _contingency_table.py │ │ │ │ │ ├── _structural_similarity.py │ │ │ │ │ ├── _variation_of_information.py │ │ │ │ │ ├── simple_metrics.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_segmentation_metrics.py │ │ │ │ │ │ ├── test_simple_metrics.py │ │ │ │ │ │ └── test_structural_similarity.py │ │ │ │ ├── morphology │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _medial_axis_lookup.py │ │ │ │ │ ├── _skeletonize.py │ │ │ │ │ ├── ball_decompositions.npy │ │ │ │ │ ├── binary.py │ │ │ │ │ ├── convex_hull.py │ │ │ │ │ ├── disk_decompositions.npy │ │ │ │ │ ├── footprints.py │ │ │ │ │ ├── gray.py │ │ │ │ │ ├── grayreconstruct.py │ │ │ │ │ ├── isotropic.py │ │ │ │ │ ├── misc.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_binary.py │ │ │ │ │ │ ├── test_convex_hull.py │ │ │ │ │ │ ├── test_footprints.py │ │ │ │ │ │ ├── test_gray.py │ │ │ │ │ │ ├── test_isotropic.py │ │ │ │ │ │ ├── test_misc.py │ │ │ │ │ │ ├── test_reconstruction.py │ │ │ │ │ │ └── test_skeletonize.py │ │ │ │ ├── registration │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _masked_phase_cross_correlation.py │ │ │ │ │ ├── _optical_flow.py │ │ │ │ │ ├── _optical_flow_utils.py │ │ │ │ │ ├── _phase_cross_correlation.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── data │ │ │ │ │ │ ├── OriginalX-130Y130.png │ │ │ │ │ │ ├── OriginalX130Y130.png │ │ │ │ │ │ ├── OriginalX75Y75.png │ │ │ │ │ │ ├── TransformedX-130Y130.png │ │ │ │ │ │ ├── TransformedX130Y130.png │ │ │ │ │ │ └── TransformedX75Y75.png │ │ │ │ │ │ ├── test_ilk.py │ │ │ │ │ │ ├── test_masked_phase_cross_correlation.py │ │ │ │ │ │ ├── test_phase_cross_correlation.py │ │ │ │ │ │ └── test_tvl1.py │ │ │ │ ├── restoration │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _denoise.py │ │ │ │ │ ├── deconvolution.py │ │ │ │ │ ├── j_invariant.py │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── test_denoise.py │ │ │ │ │ │ ├── test_j_invariant.py │ │ │ │ │ │ └── test_restoration.py │ │ │ │ │ └── uft.py │ │ │ │ ├── segmentation │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _chan_vese.py │ │ │ │ │ ├── _clear_border.py │ │ │ │ │ ├── _expand_labels.py │ │ │ │ │ ├── _join.py │ │ │ │ │ ├── boundaries.py │ │ │ │ │ ├── morphsnakes.py │ │ │ │ │ ├── random_walker_segmentation.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_boundaries.py │ │ │ │ │ │ ├── test_chan_vese.py │ │ │ │ │ │ ├── test_clear_border.py │ │ │ │ │ │ ├── test_expand_labels.py │ │ │ │ │ │ ├── test_join.py │ │ │ │ │ │ ├── test_morphsnakes.py │ │ │ │ │ │ └── test_random_walker.py │ │ │ │ ├── transform │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── __init__.pyi │ │ │ │ │ ├── _geometric.py │ │ │ │ │ ├── _warps.py │ │ │ │ │ ├── integral.py │ │ │ │ │ ├── pyramids.py │ │ │ │ │ └── tests │ │ │ │ │ │ ├── test_geometric.py │ │ │ │ │ │ ├── test_integral.py │ │ │ │ │ │ ├── test_pyramids.py │ │ │ │ │ │ └── test_warps.py │ │ │ │ └── util │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _invert.py │ │ │ │ │ ├── _map_array.py │ │ │ │ │ ├── arraycrop.py │ │ │ │ │ ├── dtype.py │ │ │ │ │ ├── noise.py │ │ │ │ │ ├── shape.py │ │ │ │ │ └── tests │ │ │ │ │ ├── test_arraycrop.py │ │ │ │ │ ├── test_dtype.py │ │ │ │ │ ├── test_invert.py │ │ │ │ │ ├── test_map_array.py │ │ │ │ │ ├── test_random_noise.py │ │ │ │ │ └── test_shape.py │ │ │ └── time.py │ │ └── localtest.py │ └── tests │ │ ├── __init__.py │ │ ├── conftest.py │ │ ├── fixtures │ │ └── testimage.py │ │ ├── integration │ │ ├── __init__.py │ │ └── clara │ │ │ └── __init__.py │ │ ├── performance │ │ ├── __init__.py │ │ └── clara │ │ │ ├── __init__.py │ │ │ └── test_read_region_memory_usage.py │ │ ├── test_cucim.py │ │ ├── unit │ │ ├── __init__.py │ │ ├── clara │ │ │ ├── __init__.py │ │ │ ├── converter │ │ │ │ └── test_converter.py │ │ │ ├── test_image_cache.py │ │ │ ├── test_load_image.py │ │ │ ├── test_load_image_metadata.py │ │ │ └── test_tiff_read_region.py │ │ ├── core │ │ │ └── test_stain_normalizer.py │ │ ├── test_init.py │ │ └── test_version.py │ │ └── util │ │ ├── gen_image.py │ │ ├── gen_tiff.py │ │ └── io.py └── pybind11 │ ├── cache │ ├── cache_py.cpp │ ├── cache_py.h │ ├── cache_pydoc.h │ ├── image_cache_py.cpp │ ├── image_cache_py.h │ └── image_cache_pydoc.h │ ├── cucim_py.cpp │ ├── cucim_py.h │ ├── cucim_pydoc.h │ ├── filesystem │ ├── cufile_py.cpp │ ├── cufile_py.h │ ├── cufile_pydoc.h │ ├── filesystem_py.cpp │ ├── filesystem_py.h │ └── filesystem_pydoc.h │ ├── io │ ├── device_py.cpp │ ├── device_pydoc.h │ ├── io_py.cpp │ ├── io_py.h │ └── io_pydoc.h │ ├── macros.h │ ├── memory │ ├── memory_py.cpp │ ├── memory_py.h │ └── memory_pydoc.h │ └── profiler │ ├── profiler_py.cpp │ ├── profiler_py.h │ └── profiler_pydoc.h ├── run ├── scripts └── debug_python └── test_data ├── .gitignore ├── Dockerfile ├── README.md ├── gen_images.sh ├── input ├── LICENSE-3rdparty └── README.md └── push_testdata.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 4 4 | charset = utf-8 5 | trim_trailing_whitespace = true 6 | max_line_length = 120 7 | insert_final_newline = true 8 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Applied black, isort and ruff globally to the codebase 2 | d489bb3969d67643ad6c3ff62f516b635206ae2a 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | #cpp code owners 2 | cpp/ @rapidsai/cucim-cpp-codeowners 3 | python/pybind11 @rapidsai/cucim-cpp-codeowners 4 | 5 | #python code owners 6 | python/ @rapidsai/cucim-python-codeowners 7 | 8 | #cmake code owners 9 | **/CMakeLists.txt @rapidsai/cucim-cmake-codeowners 10 | **/cmake/ @rapidsai/cucim-cmake-codeowners 11 | 12 | #CI code owners 13 | /.github/ @rapidsai/ci-codeowners 14 | /ci/ @rapidsai/ci-codeowners 15 | /.pre-commit-config.yaml @rapidsai/ci-codeowners 16 | 17 | #packaging code owners 18 | /.devcontainer/ @rapidsai/packaging-codeowners 19 | /conda/ @rapidsai/packaging-codeowners 20 | /dependencies.yaml @rapidsai/packaging-codeowners 21 | /build.sh @rapidsai/packaging-codeowners 22 | pyproject.toml @rapidsai/packaging-codeowners 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report to help us improve cuCIM 4 | title: "[BUG]" 5 | labels: "? - Needs Triage, bug" 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Steps/Code to reproduce bug** 14 | Follow this guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports to craft a minimal bug report. This helps us reproduce the issue you're having and resolve the issue more quickly. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Environment details (please complete the following information):** 20 | - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)] 21 | - Method of cuCIM install: [conda, Docker, or from source] 22 | - If method of install is [Docker], provide `docker pull` & `docker run` commands used 23 | 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation request 3 | about: Report incorrect or needed documentation 4 | title: "[DOC]" 5 | labels: "? - Needs Triage, doc" 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Report incorrect documentation 11 | 12 | **Location of incorrect documentation** 13 | Provide links and line numbers if applicable. 14 | 15 | **Describe the problems or issues found in the documentation** 16 | A clear and concise description of what you found to be incorrect. 17 | 18 | **Steps taken to verify documentation is incorrect** 19 | List any steps you have taken: 20 | 21 | **Suggested fix for documentation** 22 | Detail proposed changes to fix the documentation if you have any. 23 | 24 | --- 25 | 26 | ## Report needed documentation 27 | 28 | **Report needed documentation** 29 | A clear and concise description of what documentation you believe it is needed and why. 30 | 31 | **Describe the documentation you'd like** 32 | A clear and concise description of what you want to happen. 33 | 34 | **Steps taken to search for needed documentation** 35 | List any steps you have taken: 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for cuCIM 4 | title: "[FEA]" 5 | labels: "? - Needs Triage, feature request" 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I wish I could use cuCIM to do [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context, code examples, or references to existing implementations about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/submit-question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Submit question 3 | about: Ask a general question about cuCIM 4 | title: "[QST]" 5 | labels: "? - Needs Triage, question" 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What is your question?** 11 | -------------------------------------------------------------------------------- /.github/copy-pr-bot.yaml: -------------------------------------------------------------------------------- 1 | # Configuration file for `copy-pr-bot` GitHub App 2 | # https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ 3 | 4 | enabled: true 5 | auto_sync_draft: false 6 | -------------------------------------------------------------------------------- /.github/ops-bot.yaml: -------------------------------------------------------------------------------- 1 | # This file controls which features from the `ops-bot` repository below are enabled. 2 | # - https://github.com/rapidsai/ops-bot 3 | 4 | auto_merger: true 5 | branch_checker: true 6 | label_checker: true 7 | release_drafter: true 8 | external_contributors: false 9 | recently_updated: true 10 | forward_merger: true 11 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | branch: 7 | required: true 8 | type: string 9 | date: 10 | required: true 11 | type: string 12 | sha: 13 | required: true 14 | type: string 15 | build_type: 16 | type: string 17 | default: nightly 18 | 19 | jobs: 20 | conda-python-tests: 21 | secrets: inherit 22 | uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-25.08 23 | with: 24 | build_type: ${{ inputs.build_type }} 25 | branch: ${{ inputs.branch }} 26 | date: ${{ inputs.date }} 27 | script: ci/test_python.sh 28 | sha: ${{ inputs.sha }} 29 | wheel-tests: 30 | secrets: inherit 31 | uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-25.08 32 | with: 33 | build_type: ${{ inputs.build_type }} 34 | branch: ${{ inputs.branch }} 35 | date: ${{ inputs.date }} 36 | sha: ${{ inputs.sha }} 37 | script: ci/test_wheel.sh 38 | -------------------------------------------------------------------------------- /.github/workflows/trigger-breaking-change-alert.yaml: -------------------------------------------------------------------------------- 1 | name: Trigger Breaking Change Notifications 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - closed 7 | - reopened 8 | - labeled 9 | - unlabeled 10 | 11 | jobs: 12 | trigger-notifier: 13 | if: contains(github.event.pull_request.labels.*.name, 'breaking') 14 | secrets: inherit 15 | uses: rapidsai/shared-workflows/.github/workflows/breaking-change-alert.yaml@branch-25.08 16 | with: 17 | sender_login: ${{ github.event.sender.login }} 18 | sender_avatar: ${{ github.event.sender.avatar_url }} 19 | repo: ${{ github.repository }} 20 | pr_number: ${{ github.event.pull_request.number }} 21 | pr_title: "${{ github.event.pull_request.title }}" 22 | pr_body: "${{ github.event.pull_request.body || '_Empty PR description_' }}" 23 | pr_base_ref: ${{ github.event.pull_request.base.ref }} 24 | pr_author: ${{ github.event.pull_request.user.login }} 25 | event_action: ${{ github.event.action }} 26 | pr_merged: ${{ github.event.pull_request.merged }} 27 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.Catch2: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.StainTools: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Peter Byfield 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.aicsimageio: -------------------------------------------------------------------------------- 1 | Copyright 2020 Allen Institute for Cell Science 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 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. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | 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. 12 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.boost: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.cupy: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Preferred Infrastructure, Inc. 2 | Copyright (c) 2015 Preferred Networks, Inc. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.dockcross: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, 2016, 2017, 2018, 2021 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin, Bensuperpc 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.gputil: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 anderskm 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.json: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2020 Niels Lohmann 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.libcuckoo: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013, Carnegie Mellon University and Intel Corporation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | --------------------------- 16 | 17 | The third-party libraries have their own licenses, as detailed in their source 18 | files. 19 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.libdeflate: -------------------------------------------------------------------------------- 1 | Copyright 2016 Eric Biggers 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation files 5 | (the "Software"), to deal in the Software without restriction, 6 | including without limitation the rights to use, copy, modify, merge, 7 | publish, distribute, sublicense, and/or sell copies of the Software, 8 | and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 18 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.libspng: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2018-2020, Randy 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERs 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.libtiff: -------------------------------------------------------------------------------- 1 | Copyright (c) 1988-1997 Sam Leffler 2 | Copyright (c) 1991-1997 Silicon Graphics, Inc. 3 | 4 | Permission to use, copy, modify, distribute, and sell this software and 5 | its documentation for any purpose is hereby granted without fee, provided 6 | that (i) the above copyright notices and this permission notice appear in 7 | all copies of the software and related documentation, and (ii) the names of 8 | Sam Leffler and Silicon Graphics may not be used in any advertising or 9 | publicity relating to the software without the specific, prior written 10 | permission of Sam Leffler and Silicon Graphics. 11 | 12 | THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 13 | EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 14 | WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 15 | 16 | IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 17 | ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 18 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 19 | WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 20 | LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 21 | OF THIS SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.openslide: -------------------------------------------------------------------------------- 1 | OpenSlide 2 | 3 | Carnegie Mellon University and others 4 | 5 | https://openslide.org/ 6 | 7 | ==================== 8 | 9 | Unless otherwise specified, this code is copyright Carnegie Mellon 10 | University. 11 | 12 | This code is licensed under the GNU LGPL version 2.1, not any later 13 | version. See the file lgpl-2.1.txt for the text of the license. 14 | 15 | OpenSlide is distributed in the hope that it will be useful, but 16 | WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Lesser General Public License for more details. 19 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.pba+: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 School of Computing, National University of Singapore 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.pugixml: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2006-2020 Arseny Kapoulkine 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.pytest: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2004-2020 Holger Krekel and others 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.pytest-lazy-fixtures: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Anton Petrov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.scifio: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 - 2020, SCIFIO developers. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.spdlog: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Gabi Melman. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -- NOTE: Third party dependency used by this software -- 24 | This software depends on the fmt lib (MIT License), 25 | and users must comply to its license: https://github.com/fmtlib/fmt/blob/master/LICENSE.rst 26 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.taskflow: -------------------------------------------------------------------------------- 1 | TASKFLOW MIT LICENSE 2 | 3 | Copyright (c) 2018-2021 Dr. Tsung-Wei Huang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdparty/LICENSE.zarr-python: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2018 Zarr Developers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 25.08.00 2 | -------------------------------------------------------------------------------- /benchmarks/skimage/requirements-bench.txt: -------------------------------------------------------------------------------- 1 | pandas>=1.0 2 | tabulate>=0.8.7 3 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-all.sh: -------------------------------------------------------------------------------- 1 | for file in ./cu*py 2 | do 3 | echo $file 4 | time python "$file" 5 | done 6 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-color.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 192,192,192) 3 | param_filt=(convert_colorspace rgb2hed hed2rgb lab2lch lch2lab xyz2lab lab2xyz rgba2rgb label2rgb) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_color_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | 13 | param_shape=(512,512 3840,2160) 14 | param_filt=(deltaE_cie76 deltaE_ciede94 deltaE_ciede2000 deltaE_cmc) 15 | param_dt=(float32, float64) 16 | for shape in "${param_shape[@]}"; do 17 | for filt in "${param_filt[@]}"; do 18 | for dt in "${param_dt[@]}"; do 19 | python cucim_color_bench.py -f $filt -i $shape -d $dt -t 10 20 | done 21 | done 22 | done 23 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-exposure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(equalize_adapthist cumulative_distribution equalize_hist rescale_intensity adjust_gamma adjust_log adjust_sigmoid is_low_contrast match_histograms) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_exposure_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-feature.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(multiscale_basic_features canny daisy structure_tensor hessian_matrix hessian_matrix_det shape_index corner_kitchen_rosenfeld corner_harris corner_shi_tomasi corner_foerstner corner_peaks match_template blob_dog blob_log blob_doh) 4 | param_dt=(float64 float32) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_feature_bench.py -f $filt -i $shape -d $dt -t 3 9 | done 10 | done 11 | done 12 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-filters.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(gabor gaussian median rank_order unsharp_mask sobel prewitt scharr roberts roberts_pos_diag roberts_neg_diag farid laplace meijering sato frangi hessian threshold_isodata threshold_otsu threshold_yen threshold_local threshold_li threshold_minimum threshold_mean threshold_triangle threshold_niblack threshold_sauvola apply_hysteresis_threshold threshold_multiotsu) 4 | # param_filt=(rank_order ) 5 | param_dt=(float64 float32 float16) 6 | for shape in "${param_shape[@]}"; do 7 | for filt in "${param_filt[@]}"; do 8 | for dt in "${param_dt[@]}"; do 9 | python cucim_filters_bench.py -f $filt -i $shape -d $dt -t 10 10 | done 11 | done 12 | done 13 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-measure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(label regionprops moments moments_central centroid inertia_tensor inertia_tensor_eigvals block_reduce shannon_entropy profile_line) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_measure_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | 13 | # # commenting out colocalization metrics below this point 14 | # # (scikit-image 0.20 is not yet officially released) 15 | # param_shape=(512,512 3840,2160 192,192,192) 16 | # param_filt=(manders_coloc_coeff manders_overlap_coeff pearson_corr_coeff) 17 | # param_dt=(float32 uint8) 18 | # for shape in "${param_shape[@]}"; do 19 | # for filt in "${param_filt[@]}"; do 20 | # for dt in "${param_dt[@]}"; do 21 | # python cucim_measure_bench.py -f $filt -i $shape -d $dt -t 10 22 | # done 23 | # done 24 | # done 25 | 26 | # # only supports binary-valued images 27 | # param_shape=(512,512 3840,2160 192,192,192) 28 | # param_filt=(intersection_coeff) 29 | # param_dt=(bool) 30 | # for shape in "${param_shape[@]}"; do 31 | # for filt in "${param_filt[@]}"; do 32 | # for dt in "${param_dt[@]}"; do 33 | # python cucim_measure_bench.py -f $filt -i $shape -d $dt -t 10 34 | # done 35 | # done 36 | # done 37 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-metrics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(structural_similarity mean_squared_error normalized_root_mse peak_signal_noise_ratio normalized_mutual_information) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_metrics_bench.py -f $filt -i $shape -d $dt -t 4 9 | done 10 | done 11 | done 12 | 13 | # can only use integer dtypes and non-color images for the segmentation metrics 14 | param_shape=(512,512 3840,2160 192,192,192) 15 | param_filt=(adapted_rand_error contingency_table variation_of_information) 16 | param_dt=(uint8) 17 | for shape in "${param_shape[@]}"; do 18 | for filt in "${param_filt[@]}"; do 19 | for dt in "${param_dt[@]}"; do 20 | python cucim_metrics_bench.py -f $filt -i $shape -d $dt -t 4 21 | done 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-morphology.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(binary_erosion binary_dilation binary_opening binary_closing isotropic_erosion isotropic_dilation isotropic_opening isotropic_closing remove_small_objects remove_small_holes erosion dilation opening closing white_tophat black_tophat medial_axis thin reconstruction) 4 | param_dt=(uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_morphology_bench.py -f $filt -i $shape -d $dt -t 4 9 | done 10 | done 11 | done 12 | 13 | # Note: Omit binary_*, medial_axis and thin from floating point benchmarks. 14 | # (these functions only take binary input). 15 | param_filt_float=(remove_small_objects remove_small_holes erosion dilation opening closing white_tophat black_tophat reconstruction) 16 | param_dt=(float32) 17 | for shape in "${param_shape[@]}"; do 18 | for filt in "${param_filt[@]}"; do 19 | for dt in "${param_dt[@]}"; do 20 | python cucim_morphology_bench.py -f $filt -i $shape -d $dt -t 4 21 | done 22 | done 23 | done 24 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-registration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(phase_cross_correlation optical_flow_tvl1 optical_flow_ilk) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_registration_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-restoration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(denoise_tv_chambolle calibrate_denoiser wiener unsupervised_wiener richardson_lucy) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_restoration_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-segmentation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | 4 | # these require an integer-valued label image 5 | param_filt=(clear_border expand_labels relabel_sequential find_boundaries mark_boundaries random_walker) 6 | param_dt=(float32) 7 | param_dt_label=(uint8 uint32) 8 | for shape in "${param_shape[@]}"; do 9 | for filt in "${param_filt[@]}"; do 10 | for dt in "${param_dt[@]}"; do 11 | for dt_label in "${param_dt_label[@]}"; do 12 | python cucim_segmentation_bench.py -f $filt -i $shape -d $dt --dtype_label $dt_label -t 10 13 | done 14 | done 15 | done 16 | done 17 | 18 | # these do not require an integer-valued input image 19 | param_filt=(inverse_gaussian_gradient morphological_geodesic_active_contour morphological_chan_vese chan_vese) 20 | param_dt=(float32) 21 | for shape in "${param_shape[@]}"; do 22 | for filt in "${param_filt[@]}"; do 23 | for dt in "${param_dt[@]}"; do 24 | python cucim_segmentation_bench.py -f $filt -i $shape -d $dt -t 10 25 | done 26 | done 27 | done 28 | -------------------------------------------------------------------------------- /benchmarks/skimage/run-nv-bench-transform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) 3 | param_filt=(resize resize_local_mean rescale rotate downscale_local_mean warp_polar integral_image pyramid_gaussian pyramid_laplacian) 4 | param_dt=(float32 uint8) 5 | for shape in "${param_shape[@]}"; do 6 | for filt in "${param_filt[@]}"; do 7 | for dt in "${param_dt[@]}"; do 8 | python cucim_transform_bench.py -f $filt -i $shape -d $dt -t 10 9 | done 10 | done 11 | done 12 | -------------------------------------------------------------------------------- /ci/build_cpp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2022, NVIDIA CORPORATION. 3 | 4 | set -euo pipefail 5 | 6 | rapids-configure-conda-channels 7 | 8 | source rapids-configure-sccache 9 | 10 | source rapids-date-string 11 | 12 | export CMAKE_GENERATOR=Ninja 13 | 14 | rapids-print-env 15 | 16 | rapids-logger "Begin cpp build" 17 | 18 | # this can be set back to 'prevent' once the xorg-* migrations are completed 19 | # ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 20 | conda config --set path_conflict warn 21 | 22 | sccache --zero-stats 23 | 24 | RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build conda/recipes/libcucim 25 | 26 | sccache --show-adv-stats 27 | -------------------------------------------------------------------------------- /ci/build_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | rapids-logger "Downloading artifacts from previous jobs" 6 | CPP_CHANNEL=$(rapids-download-conda-from-github cpp) 7 | PYTHON_CHANNEL=$(rapids-download-conda-from-github python) 8 | 9 | rapids-logger "Create test conda environment" 10 | . /opt/conda/etc/profile.d/conda.sh 11 | 12 | rapids-dependency-file-generator \ 13 | --output conda \ 14 | --file-key docs \ 15 | --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \ 16 | --prepend-channel "${CPP_CHANNEL}" \ 17 | --prepend-channel "${PYTHON_CHANNEL}" \ 18 | | tee env.yaml 19 | 20 | rapids-mamba-retry env create --yes -f env.yaml -n docs 21 | conda activate docs 22 | 23 | rapids-print-env 24 | 25 | RAPIDS_DOCS_DIR="$(mktemp -d)" 26 | export RAPIDS_DOCS_DIR 27 | 28 | rapids-logger "Build Python docs" 29 | pushd docs 30 | sphinx-build -b dirhtml ./source _html 31 | mkdir -p "${RAPIDS_DOCS_DIR}/cucim/"html 32 | mv _html/* "${RAPIDS_DOCS_DIR}/cucim/html" 33 | popd 34 | 35 | RAPIDS_VERSION_NUMBER="$(rapids-version-major-minor)" rapids-upload-docs 36 | -------------------------------------------------------------------------------- /ci/build_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2022, NVIDIA CORPORATION. 3 | 4 | set -euo pipefail 5 | 6 | rapids-configure-conda-channels 7 | 8 | source rapids-configure-sccache 9 | 10 | source rapids-date-string 11 | 12 | export CMAKE_GENERATOR=Ninja 13 | 14 | rapids-print-env 15 | 16 | rapids-generate-version > ./VERSION 17 | 18 | rapids-logger "Begin py build" 19 | 20 | # this can be set back to 'prevent' once the xorg-* migrations are completed 21 | # ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 22 | conda config --set path_conflict warn 23 | 24 | CPP_CHANNEL=$(rapids-download-conda-from-github cpp) 25 | 26 | sccache --zero-stats 27 | 28 | # TODO: Remove `--no-test` flag once importing on a CPU 29 | # node works correctly 30 | RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry build \ 31 | --no-test \ 32 | --channel "${CPP_CHANNEL}" \ 33 | conda/recipes/cucim 34 | 35 | sccache --show-adv-stats 36 | -------------------------------------------------------------------------------- /ci/check_style.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2020-2022, NVIDIA CORPORATION. 3 | 4 | set -euo pipefail 5 | 6 | rapids-logger "Create checks conda environment" 7 | . /opt/conda/etc/profile.d/conda.sh 8 | 9 | rapids-dependency-file-generator \ 10 | --output conda \ 11 | --file-key checks \ 12 | --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml 13 | 14 | rapids-mamba-retry env create --yes -f env.yaml -n checks 15 | conda activate checks 16 | 17 | # Run pre-commit checks 18 | pre-commit run --hook-stage manual --all-files --show-diff-on-failure 19 | -------------------------------------------------------------------------------- /ci/test_wheel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2023, NVIDIA CORPORATION. 3 | 4 | set -eou pipefail 5 | 6 | source rapids-init-pip 7 | 8 | RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")" 9 | PYTHON_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cucim_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github python) 10 | 11 | # echo to expand wildcard before adding `[extra]` requires for pip 12 | rapids-pip-retry install "$(echo ${PYTHON_WHEELHOUSE}/cucim*.whl)[test]" 13 | 14 | CUDA_MAJOR_VERSION=${RAPIDS_CUDA_VERSION:0:2} 15 | 16 | if type -f yum > /dev/null 2>&1; then 17 | yum update -y 18 | yum install -y openslide 19 | else 20 | DEBIAN_FRONTEND=noninteractive apt update 21 | DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends libopenslide0 22 | fi 23 | 24 | if [[ ${CUDA_MAJOR_VERSION} == "11" ]]; then 25 | # Omit I/O-related tests in ./python/cucim/tests due to known CUDA bug 26 | # with dynamic loading of libcufile. 27 | python -m pytest \ 28 | --junitxml="${RAPIDS_TESTS_DIR}/junit-cucim.xml" \ 29 | --numprocesses=8 \ 30 | --dist=worksteal \ 31 | ./python/cucim/src/ 32 | else 33 | python -m pytest \ 34 | --junitxml="${RAPIDS_TESTS_DIR}/junit-cucim.xml" \ 35 | --numprocesses=8 \ 36 | --dist=worksteal \ 37 | ./python/cucim 38 | fi 39 | -------------------------------------------------------------------------------- /ci/validate_wheel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2024, NVIDIA CORPORATION. 3 | 4 | set -euo pipefail 5 | 6 | wheel_dir_relative_path=$1 7 | 8 | rapids-logger "validate packages with 'pydistcheck'" 9 | 10 | # shellcheck disable=SC2116 11 | pydistcheck \ 12 | --inspect \ 13 | "$(echo "${wheel_dir_relative_path}"/*.whl)" 14 | 15 | rapids-logger "validate packages with 'twine'" 16 | 17 | # shellcheck disable=SC2116 18 | twine check \ 19 | --strict \ 20 | "$(echo "${wheel_dir_relative_path}"/*.whl)" 21 | -------------------------------------------------------------------------------- /conda/environments/all_cuda-128_arch-aarch64.yaml: -------------------------------------------------------------------------------- 1 | # This file is generated by `rapids-dependency-file-generator`. 2 | # To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. 3 | channels: 4 | - rapidsai 5 | - rapidsai-nightly 6 | - conda-forge 7 | - nvidia 8 | dependencies: 9 | - c-compiler 10 | - click 11 | - cmake>=3.30.4 12 | - cuda-cudart-dev 13 | - cuda-nvcc 14 | - cuda-version=12.8 15 | - cupy>=12.0.0 16 | - cxx-compiler 17 | - gcc_linux-aarch64=13.* 18 | - imagecodecs>=2021.6.8 19 | - ipython 20 | - lazy-loader>=0.4 21 | - libnvjpeg-dev 22 | - libnvjpeg-static 23 | - matplotlib-base>=3.7 24 | - nbsphinx 25 | - ninja 26 | - numpy>=1.23.4,<3.0a0 27 | - numpydoc>=1.7 28 | - openslide-python>=1.3.0 29 | - pip 30 | - pooch>=1.6.0 31 | - pre-commit 32 | - psutil>=5.8.0 33 | - pydata-sphinx-theme 34 | - pytest-cov>=2.12.1 35 | - pytest-lazy-fixtures>=1.0.0 36 | - pytest-xdist 37 | - pytest>=7.0.0,<9.0.0a0 38 | - python>=3.10,<3.14 39 | - pywavelets>=1.6 40 | - recommonmark 41 | - scikit-image>=0.19.0,<0.26.0a0 42 | - scipy>=1.11.2 43 | - sphinx>=8.0.0,<8.2.0 44 | - sysroot_linux-aarch64==2.28 45 | - tifffile>=2022.8.12 46 | - pip: 47 | - opencv-python-headless>=4.6 48 | name: all_cuda-128_arch-aarch64 49 | -------------------------------------------------------------------------------- /conda/environments/all_cuda-128_arch-x86_64.yaml: -------------------------------------------------------------------------------- 1 | # This file is generated by `rapids-dependency-file-generator`. 2 | # To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. 3 | channels: 4 | - rapidsai 5 | - rapidsai-nightly 6 | - conda-forge 7 | - nvidia 8 | dependencies: 9 | - c-compiler 10 | - click 11 | - cmake>=3.30.4 12 | - cuda-cudart-dev 13 | - cuda-nvcc 14 | - cuda-version=12.8 15 | - cupy>=12.0.0 16 | - cxx-compiler 17 | - gcc_linux-64=13.* 18 | - imagecodecs>=2021.6.8 19 | - ipython 20 | - lazy-loader>=0.4 21 | - libcufile-dev 22 | - libnvjpeg-dev 23 | - libnvjpeg-static 24 | - matplotlib-base>=3.7 25 | - nbsphinx 26 | - ninja 27 | - numpy>=1.23.4,<3.0a0 28 | - numpydoc>=1.7 29 | - openslide-python>=1.3.0 30 | - pip 31 | - pooch>=1.6.0 32 | - pre-commit 33 | - psutil>=5.8.0 34 | - pydata-sphinx-theme 35 | - pytest-cov>=2.12.1 36 | - pytest-lazy-fixtures>=1.0.0 37 | - pytest-xdist 38 | - pytest>=7.0.0,<9.0.0a0 39 | - python>=3.10,<3.14 40 | - pywavelets>=1.6 41 | - recommonmark 42 | - scikit-image>=0.19.0,<0.26.0a0 43 | - scipy>=1.11.2 44 | - sphinx>=8.0.0,<8.2.0 45 | - sysroot_linux-64==2.28 46 | - tifffile>=2022.8.12 47 | - yasm 48 | - pip: 49 | - opencv-python-headless>=4.6 50 | name: all_cuda-128_arch-x86_64 51 | -------------------------------------------------------------------------------- /conda/recipes/cucim/build.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | 3 | CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} 4 | 5 | echo "CC : ${CC}" 6 | echo "CXX : ${CXX}" 7 | 8 | # CUDA needs to include $PREFIX/include as system include path 9 | export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " 10 | export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" 11 | 12 | # It is assumed that this script is executed from the root of the repo directory by conda-build 13 | # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) 14 | ./run build_local cucim ${CUCIM_BUILD_TYPE} 15 | 16 | cp -P python/install/lib/* python/cucim/src/cucim/clara/ 17 | 18 | pushd python/cucim 19 | 20 | echo "PYTHON: ${PYTHON}" 21 | $PYTHON -m pip install --config-settings rapidsai.disable-cuda=true . -vv 22 | 23 | popd 24 | -------------------------------------------------------------------------------- /conda/recipes/cucim/conda_build_config.yaml: -------------------------------------------------------------------------------- 1 | c_compiler_version: 2 | - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 3 | - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 4 | 5 | cxx_compiler_version: 6 | - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 7 | - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 8 | 9 | cuda_compiler: 10 | - cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 11 | - nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 12 | 13 | c_stdlib: 14 | - sysroot 15 | 16 | c_stdlib_version: 17 | - "2.28" 18 | 19 | cmake_version: 20 | - ">=3.30.4" 21 | -------------------------------------------------------------------------------- /conda/recipes/libcucim/build.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | 3 | CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} 4 | 5 | echo "CC : ${CC}" 6 | echo "CXX : ${CXX}" 7 | 8 | # CUDA needs to include $PREFIX/include as system include path 9 | export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " 10 | export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" 11 | 12 | # It is assumed that this script is executed from the root of the repo directory by conda-build 13 | # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) 14 | 15 | # Build libcucim core 16 | ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} 17 | 18 | mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include 19 | cp -P -r install/bin/* $PREFIX/bin/ || true 20 | cp -P -r install/lib/* $PREFIX/lib/ || true 21 | cp -P -r install/include/* $PREFIX/include/ || true 22 | 23 | # Build plugins 24 | for plugin_name in cuslide cumed; do 25 | echo "Building cucim.kit.${plugin_name} ..." 26 | ./run build_local ${plugin_name} ${CUCIM_BUILD_TYPE} ${PREFIX} 27 | mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include 28 | cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* $PREFIX/bin/ || true 29 | cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* $PREFIX/lib/ || true 30 | done 31 | -------------------------------------------------------------------------------- /conda/recipes/libcucim/conda_build_config.yaml: -------------------------------------------------------------------------------- 1 | c_compiler_version: 2 | - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 3 | - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 4 | 5 | cxx_compiler_version: 6 | - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 7 | - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 8 | 9 | cuda_compiler: 10 | - cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 11 | - nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] 12 | 13 | c_stdlib: 14 | - sysroot 15 | 16 | c_stdlib_version: 17 | - "2.28" 18 | 19 | cmake_version: 20 | - ">=3.30.4" 21 | 22 | # The CTK libraries below are missing from the conda-forge::cudatoolkit package 23 | # for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages 24 | # and the "*_run_*" version specifiers correspond to `11.x` packages. 25 | 26 | cuda11_libcufile_host_version: 27 | - "1.4.0.31" 28 | 29 | cuda11_libcufile_run_version: 30 | - ">=1.0.0.82,<=1.4.0.31" 31 | 32 | cuda11_libnvjpeg_host_version: 33 | - "11.6.0.55" 34 | -------------------------------------------------------------------------------- /cpp/cmake/cucim-config.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | @PACKAGE_INIT@ 17 | 18 | # Find dependent libraries 19 | # ... 20 | include(CMakeFindDependencyMacro) 21 | #find_dependency(Boost x.x.x REQUIRED) 22 | find_dependency(CUDAToolkit) 23 | 24 | if(NOT TARGET cucim::cucim) 25 | include(${CMAKE_CURRENT_LIST_DIR}/cucim-targets.cmake) 26 | endif() 27 | -------------------------------------------------------------------------------- /cpp/cmake/deps/boost-header-only.patch: -------------------------------------------------------------------------------- 1 | diff --git a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp 2 | index 7da31f7..5816de7 100644 3 | --- a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp 4 | +++ b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp 5 | @@ -692,7 +692,11 @@ inline T* rbtree_best_fit:: 6 | void* raw_reuse = reuse; 7 | void* const ret = priv_allocation_command(command, limit_size, prefer_in_recvd_out_size, raw_reuse, sizeof(T)); 8 | reuse = static_cast(raw_reuse); 9 | - BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::dtl::alignment_of::value)); 10 | + // [cuCIM patch] Ignore assert (ret value is not 64-byte-aligned) so not 11 | + // throw assertion failure when used with libcuckoo. This is not well tested. 12 | + // 13 | + // See https://github.com/boostorg/interprocess/issues/50 14 | + //BOOST_ASSERT(0 == ((std::size_t)ret % ::boost::container::dtl::alignment_of::value)); 15 | return static_cast(ret); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /cpp/cmake/deps/taskflow.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021-2025, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | if (NOT TARGET deps::taskflow) 17 | FetchContent_Declare( 18 | deps-taskflow 19 | GIT_REPOSITORY https://github.com/taskflow/taskflow.git 20 | GIT_TAG v3.2.0 21 | GIT_SHALLOW TRUE 22 | EXCLUDE_FROM_ALL 23 | ) 24 | message(STATUS "Fetching taskflow sources") 25 | set(TF_BUILD_TESTS OFF) 26 | set(TF_BUILD_EXAMPLES OFF) 27 | 28 | FetchContent_MakeAvailable(deps-taskflow) 29 | message(STATUS "Fetching taskflow sources - done") 30 | 31 | add_library(deps::taskflow INTERFACE IMPORTED GLOBAL) 32 | target_link_libraries(deps::taskflow INTERFACE Taskflow) 33 | set(deps-taskflow_SOURCE_DIR ${deps-taskflow_SOURCE_DIR} CACHE INTERNAL "" FORCE) 34 | mark_as_advanced(deps-taskflow_SOURCE_DIR) 35 | endif () 36 | -------------------------------------------------------------------------------- /cpp/cmake/modules/SuperBuildUtils.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | include(FetchContent) 17 | 18 | set(CMAKE_SUPERBUILD_DEPS_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") 19 | 20 | if(NOT COMMAND superbuild_depend) 21 | function(superbuild_depend module_name) 22 | include("${CMAKE_SUPERBUILD_DEPS_ROOT_DIR}/deps/${module_name}.cmake") 23 | endfunction() 24 | endif() 25 | -------------------------------------------------------------------------------- /cpp/include/cucim/codec/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef CUCIM_BASE64_H 17 | #define CUCIM_BASE64_H 18 | 19 | #include "cucim/macros/defines.h" 20 | 21 | namespace cucim::codec::base64 22 | { 23 | EXPORT_VISIBLE bool encode(const char* src, int src_count, char** out_dst, int* out_count); 24 | EXPORT_VISIBLE bool decode(const char* src, int src_count, char** out_dst, int* out_count); 25 | } 26 | #endif // CUCIM_BASE64_H 27 | -------------------------------------------------------------------------------- /cpp/include/cucim/codec/methods.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef CUCIM_METHODS_H 17 | #define CUCIM_METHODS_H 18 | 19 | #include "cucim/macros/defines.h" 20 | 21 | namespace cucim::codec 22 | { 23 | 24 | /// Compression method (Followed https://www.awaresystems.be/imaging/tiff/tifftags/compression.html) 25 | enum class CompressionMethod : uint16_t 26 | { 27 | NONE = 1, 28 | JPEG = 7, 29 | }; 30 | 31 | } // namespace cucim::codec 32 | 33 | #endif // CUCIM_METHODS_H 34 | -------------------------------------------------------------------------------- /cpp/include/cucim/core/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_VERSION_H 18 | #define CUCIM_VERSION_H 19 | 20 | #include 21 | 22 | #ifndef CUCIM_VERSION_MAJOR 23 | # error "CUCIM_VERSION_MAJOR is not defined" 24 | #endif 25 | 26 | #ifndef CUCIM_VERSION_MINOR 27 | # error "CUCIM_VERSION_MINOR is not defined" 28 | #endif 29 | 30 | #ifndef CUCIM_VERSION_PATCH 31 | # error "CUCIM_VERSION_PATCH is not defined" 32 | #endif 33 | 34 | #ifndef CUCIM_VERSION_BUILD 35 | # error "CUCIM_VERSION_BUILD is not defined" 36 | #endif 37 | 38 | namespace cucim 39 | { 40 | 41 | struct InterfaceVersion 42 | { 43 | uint32_t major; 44 | uint32_t minor; 45 | }; 46 | 47 | struct Version 48 | { 49 | uint32_t major; 50 | uint32_t minor; 51 | uint32_t patch; 52 | }; 53 | 54 | } // namespace cucim 55 | #endif // CUCIM_VERSION_H 56 | -------------------------------------------------------------------------------- /cpp/include/cucim/cpp20/find_if.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | 20 | namespace cucim::cpp20 21 | { 22 | 23 | // https://en.cppreference.com/w/cpp/algorithm/find 24 | #if __cplusplus < 202002L 25 | template 26 | constexpr InputIt find_if(InputIt first, InputIt last, UnaryPredicate p) 27 | { 28 | for (; first != last; ++first) 29 | { 30 | if (p(*first)) 31 | { 32 | return first; 33 | } 34 | } 35 | return last; 36 | } 37 | #else 38 | template 39 | constexpr InputIt find_if(InputIt first, InputIt last, UnaryPredicate p) 40 | { 41 | return std::find_if(first, last, p); 42 | } 43 | #endif 44 | 45 | } 46 | -------------------------------------------------------------------------------- /cpp/include/cucim/filesystem/file_path.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_FILE_PATH_H 18 | #define CUCIM_FILE_PATH_H 19 | 20 | #include 21 | namespace cucim::filesystem 22 | { 23 | 24 | using Path = std::string; 25 | 26 | } // namespace cucim::filesystem 27 | 28 | #endif // CUCIM_FILE_PATH_H 29 | -------------------------------------------------------------------------------- /cpp/include/cucim/loader/tile_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_LOADER_TILE_INFO_H 18 | #define CUCIM_LOADER_TILE_INFO_H 19 | 20 | #include "cucim/macros/api_header.h" 21 | 22 | #include 23 | 24 | namespace cucim::loader 25 | { 26 | 27 | struct EXPORT_VISIBLE TileInfo 28 | { 29 | int64_t location_index = 0; // patch # 30 | int64_t index = 0; // tile # 31 | uint64_t offset = 0; 32 | uint64_t size = 0; 33 | }; 34 | 35 | } // namespace cucim::loader 36 | 37 | #endif // CUCIM_LOADER_TILE_INFO_H 38 | -------------------------------------------------------------------------------- /cpp/include/cucim/logger/logger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_LOGGER_H 18 | #define CUCIM_LOGGER_H 19 | 20 | #endif // CUCIM_LOGGER_H 21 | -------------------------------------------------------------------------------- /cpp/include/cucim/logger/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef CUCIM_TIMER_H 17 | #define CUCIM_TIMER_H 18 | 19 | #include "cucim/macros/defines.h" 20 | 21 | #include 22 | 23 | namespace cucim::logger 24 | { 25 | class EXPORT_VISIBLE Timer 26 | { 27 | public: 28 | Timer(const char* message, bool auto_start = true, bool auto_output = true); 29 | void start(); 30 | double stop(); 31 | double elapsed_time(); 32 | void print(const char* message = nullptr); 33 | ~Timer(); 34 | 35 | private: 36 | const char* message_ = nullptr; 37 | bool is_auto_output_ = false; 38 | double elapsed_seconds_ = -1; 39 | std::chrono::time_point start_{}; 40 | std::chrono::time_point end_{}; 41 | }; 42 | 43 | } // namespace cucim::logger 44 | 45 | 46 | #endif // CUCIM_TIMER_H 47 | -------------------------------------------------------------------------------- /cpp/include/cucim/plugin/image_format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_PLUGIN_IMAGE_FORMAT_H 18 | #define CUCIM_PLUGIN_IMAGE_FORMAT_H 19 | 20 | #include "cucim/filesystem/file_path.h" 21 | #include "cucim/io/format/image_format.h" 22 | 23 | 24 | namespace cucim::plugin 25 | { 26 | 27 | class ImageFormat 28 | { 29 | public: 30 | ImageFormat() = default; 31 | ~ImageFormat() = default; 32 | 33 | bool add_interfaces(const cucim::io::format::IImageFormat* image_formats); 34 | cucim::io::format::ImageFormatDesc* detect_image_format(const filesystem::Path& path); 35 | 36 | operator bool() const 37 | { 38 | return !image_formats_.empty(); 39 | } 40 | 41 | private: 42 | std::vector image_formats_; 43 | }; 44 | 45 | } // namespace cucim::plugin 46 | 47 | #endif // CUCIM_PLUGIN_IMAGE_FORMAT_H 48 | -------------------------------------------------------------------------------- /cpp/include/cucim/plugin/plugin_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_PLUGIN_PLUGIN_CONFIG_H 18 | #define CUCIM_PLUGIN_PLUGIN_CONFIG_H 19 | 20 | #include "cucim/core/framework.h" 21 | 22 | #include 23 | #include 24 | 25 | namespace cucim::plugin 26 | { 27 | 28 | #define XSTR(x) STR(x) 29 | #define STR(x) #x 30 | 31 | struct EXPORT_VISIBLE PluginConfig 32 | { 33 | void load_config(const void* json_obj); 34 | 35 | std::vector plugin_names{ std::string("cucim.kit.cuslide@" XSTR(CUCIM_VERSION) ".so"), 36 | std::string("cucim.kit.cumed@" XSTR(CUCIM_VERSION) ".so") }; 37 | }; 38 | 39 | #undef STR 40 | #undef XSTR 41 | 42 | } // namespace cucim::plugin 43 | 44 | #endif // CUCIM_PLUGIN_PLUGIN_CONFIG_H 45 | -------------------------------------------------------------------------------- /cpp/include/cucim/profiler/profiler_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUCIM_PROFILER_PROFILER_CONFIG_H 18 | #define CUCIM_PROFILER_PROFILER_CONFIG_H 19 | 20 | #include "cucim/core/framework.h" 21 | 22 | #include 23 | #include 24 | 25 | namespace cucim::profiler 26 | { 27 | 28 | constexpr bool kDefaultProfilerTrace = false; 29 | 30 | struct EXPORT_VISIBLE ProfilerConfig 31 | { 32 | void load_config(const void* json_obj); 33 | 34 | bool trace = kDefaultProfilerTrace; 35 | }; 36 | 37 | } // namespace cucim::profiler 38 | 39 | #endif // CUCIM_PROFILER_PROFILER_CONFIG_H 40 | -------------------------------------------------------------------------------- /cpp/include/cucim/util/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // 17 | #ifndef CUCIM_UTIL_FILE_H 18 | #define CUCIM_UTIL_FILE_H 19 | 20 | #include "cucim/core/framework.h" 21 | 22 | /** 23 | * @brief Utility methods that need to be refactored later. 24 | */ 25 | namespace cucim::util 26 | { 27 | 28 | EXPORT_VISIBLE bool file_exists(const char* path); 29 | 30 | } // namespace cucim::util 31 | 32 | #endif // CUCIM_UTIL_FILE_H 33 | -------------------------------------------------------------------------------- /cpp/include/cucim/util/platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | // 17 | #ifndef CUCIM_UTIL_PLATFORM_H 18 | #define CUCIM_UTIL_PLATFORM_H 19 | 20 | #include "cucim/macros/api_header.h" 21 | 22 | /** 23 | * @brief Platform-specific macros and functions. 24 | */ 25 | namespace cucim::util 26 | { 27 | 28 | EXPORT_VISIBLE bool is_in_wsl(); 29 | 30 | } // namespace cucim::util 31 | 32 | #endif // CUCIM_UTIL_PLATFORM_H 33 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 4 4 | charset = utf-8 5 | trim_trailing_whitespace = true 6 | max_line_length = 120 7 | insert_final_newline = true 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build* 2 | install 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/.name: -------------------------------------------------------------------------------- 1 | cumed 2 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/cucim.kit.cumed.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/includes/NVIDIA_CMAKE_HEADER.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/includes/NVIDIA_C_HEADER.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/internal/C Header File.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | #[[#endif]]# //${INCLUDE_GUARD} 6 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/internal/C Source File.c: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #if (${HEADER_FILENAME}) 3 | #[[#include]]# "${HEADER_FILENAME}" 4 | #end 5 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/internal/C++ Class Header.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | ${NAMESPACES_OPEN} 6 | 7 | class ${NAME} { 8 | 9 | }; 10 | 11 | ${NAMESPACES_CLOSE} 12 | 13 | #[[#endif]]# //${INCLUDE_GUARD} 14 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/internal/C++ Class.cc: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#include]]# "${HEADER_FILENAME}" 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/fileTemplates/internal/CMakeLists.txt.cmake: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_CMAKE_HEADER.cmake") 2 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/cmake/cucim.kit.cumed-config.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | @PACKAGE_INIT@ 17 | 18 | # Find dependent libraries 19 | # ... 20 | include(CMakeFindDependencyMacro) 21 | #find_dependency(Boost x.x.x REQUIRED) 22 | 23 | if(NOT TARGET cumed::cumed) 24 | include(${CMAKE_CURRENT_LIST_DIR}/cucim.kit.cumed-targets.cmake) 25 | endif() 26 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/cmake/modules/SuperBuildUtils.cmake: -------------------------------------------------------------------------------- 1 | # Apache License, Version 2.0 2 | # Copyright 2021 NVIDIA Corporation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include(FetchContent) 17 | 18 | set(CMAKE_SUPERBUILD_DEPS_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") 19 | 20 | if(NOT COMMAND superbuild_depend) 21 | function(superbuild_depend module_name) 22 | include("${CMAKE_SUPERBUILD_DEPS_ROOT_DIR}/deps/${module_name}.cmake") 23 | endfunction() 24 | endif() 25 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/src/cumed/cumed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUMED_CUMED_H 18 | #define CUMED_CUMED_H 19 | #endif // CUMED_CUMED_H 20 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/test_data: -------------------------------------------------------------------------------- 1 | ../../../test_data -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "config.h" 18 | 19 | #include 20 | #include 21 | 22 | TEST_CASE("Verify file", "[test_basic.cpp]") 23 | { 24 | REQUIRE(1 == 1); 25 | } 26 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 4 4 | charset = utf-8 5 | trim_trailing_whitespace = true 6 | max_line_length = 120 7 | insert_final_newline = true 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build* 2 | install 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/.name: -------------------------------------------------------------------------------- 1 | cuslide 2 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/cucim.kit.cuslide.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/includes/NVIDIA_CMAKE_HEADER.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/includes/NVIDIA_C_HEADER.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/internal/C Header File.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | #[[#endif]]# //${INCLUDE_GUARD} 6 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/internal/C Source File.c: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #if (${HEADER_FILENAME}) 3 | #[[#include]]# "${HEADER_FILENAME}" 4 | #end 5 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/internal/C++ Class Header.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | ${NAMESPACES_OPEN} 6 | 7 | class ${NAME} { 8 | 9 | }; 10 | 11 | ${NAMESPACES_CLOSE} 12 | 13 | #[[#endif]]# //${INCLUDE_GUARD} 14 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/internal/C++ Class.cc: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#include]]# "${HEADER_FILENAME}" 3 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/fileTemplates/internal/CMakeLists.txt.cmake: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_CMAKE_HEADER.cmake") 2 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.sourceDirectory": "${workspaceFolder}/.", 3 | "cmake.buildDirectory": "${workspaceFolder}/build-debug" 4 | } 5 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/cucim.kit.cuslide-config.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | @PACKAGE_INIT@ 17 | 18 | # Find dependent libraries 19 | # ... 20 | include(CMakeFindDependencyMacro) 21 | #find_dependency(Boost x.x.x REQUIRED) 22 | 23 | if(NOT TARGET cuslide::cuslide) 24 | include(${CMAKE_CURRENT_LIST_DIR}/cucim.kit.cuslide-targets.cmake) 25 | endif() 26 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/deps/libjpeg-turbo.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index a8329097..f906d926 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -1,4 +1,5 @@ 6 | -cmake_minimum_required(VERSION 2.8.12) 7 | +# [cuCIM patch] Set minimum CMake version to 3.30.0 8 | +cmake_minimum_required(VERSION 3.30.0) 9 | 10 | if(CMAKE_EXECUTABLE_SUFFIX) 11 | set(CMAKE_EXECUTABLE_SUFFIX_TMP ${CMAKE_EXECUTABLE_SUFFIX}) 12 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/deps/libopenjpeg.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index b04561f4..2392c14d 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -7,7 +7,8 @@ 6 | # For this purpose you can define a CMake var: OPENJPEG_NAMESPACE to whatever you like 7 | # e.g.: 8 | # set(OPENJPEG_NAMESPACE "GDCMOPENJPEG") 9 | -cmake_minimum_required(VERSION 3.5) 10 | +# [cuCIM patch] Set minimum CMake version to 3.30.0 11 | +cmake_minimum_required(VERSION 3.30.0) 12 | 13 | if(NOT OPENJPEG_NAMESPACE) 14 | set(OPENJPEG_NAMESPACE "OPENJPEG") 15 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/deps/libtiff-policies-fix.cmake: -------------------------------------------------------------------------------- 1 | # Apache License, Version 2.0 2 | # Copyright 2020 NVIDIA Corporation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # The following cmake policies are set by `CMAKE_PROJECT_INCLUDE_BEFORE` variables 17 | # when `FetchContent` command is used (see https://gitlab.kitware.com/cmake/cmake/-/issues/19854). 18 | cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default when available. for libtiff 19 | cmake_policy(SET CMP0048 NEW) # project() command manages VERSION variables. for libtiff 20 | cmake_policy(SET CMP0063 NEW) # Honor the visibility properties for all target types including static library. 21 | cmake_policy(SET CMP0077 NEW) # Honor normal variables. Without this, `set(jpeg OFF)` trick to force using static libjpeg-turbo doesn't work. 22 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/deps/libtiff.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 35b48770..416377e7 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -23,24 +23,8 @@ 6 | # LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 7 | # OF THIS SOFTWARE. 8 | 9 | -cmake_minimum_required(VERSION 2.8.11) # b/c of use of BUILD_INTERFACE generator expression 10 | - 11 | -# Default policy is from 2.8.9 12 | -cmake_policy(VERSION 2.8.9) 13 | -# Set MacOSX @rpath usage globally. 14 | -if (POLICY CMP0020) 15 | - cmake_policy(SET CMP0020 NEW) 16 | -endif(POLICY CMP0020) 17 | -if (POLICY CMP0042) 18 | - cmake_policy(SET CMP0042 NEW) 19 | -endif(POLICY CMP0042) 20 | -# Use new variable expansion policy. 21 | -if (POLICY CMP0053) 22 | - cmake_policy(SET CMP0053 NEW) 23 | -endif(POLICY CMP0053) 24 | -if (POLICY CMP0054) 25 | - cmake_policy(SET CMP0054 NEW) 26 | -endif(POLICY CMP0054) 27 | +# [cuCIM patch] Set minimum CMake version to 3.30.0 28 | +cmake_minimum_required(VERSION 3.30.0) 29 | 30 | # Read version information from configure.ac. 31 | FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure) 32 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cmake/modules/SuperBuildUtils.cmake: -------------------------------------------------------------------------------- 1 | # Apache License, Version 2.0 2 | # Copyright 2020 NVIDIA Corporation 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include(FetchContent) 17 | 18 | set(CMAKE_SUPERBUILD_DEPS_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") 19 | 20 | if(NOT COMMAND superbuild_depend) 21 | function(superbuild_depend module_name) 22 | include("${CMAKE_SUPERBUILD_DEPS_ROOT_DIR}/deps/${module_name}.cmake") 23 | endfunction() 24 | endif() 25 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/cuslide.map: -------------------------------------------------------------------------------- 1 | CUSLIDE_0.1 { 2 | local: 3 | *; 4 | }; 5 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/cuslide.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUSLIDE_CUSLIDE_H 18 | #define CUSLIDE_CUSLIDE_H 19 | #endif // CUSLIDE_CUSLIDE_H 20 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/deflate/deflate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef CUSLIDE_DEFLATE_H 18 | #define CUSLIDE_DEFLATE_H 19 | 20 | #include 21 | 22 | namespace cuslide::deflate 23 | { 24 | 25 | bool decode_deflate(int fd, 26 | unsigned char* deflate_buf, 27 | uint64_t offset, 28 | uint64_t size, 29 | uint8_t** dest, 30 | uint64_t dest_nbytes, 31 | const cucim::io::Device& out_device); 32 | } 33 | #endif // CUSLIDE_DEFLATE_H 34 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/jpeg/libnvjpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef CUSLIDE_LIBNVJPEG_H 18 | #define CUSLIDE_LIBNVJPEG_H 19 | 20 | #include 21 | 22 | namespace cuslide::jpeg 23 | { 24 | 25 | EXPORT_VISIBLE bool decode_libnvjpeg(int fd, 26 | const unsigned char* jpeg_buf, 27 | uint64_t offset, 28 | uint64_t size, 29 | const void* jpegtable_data, 30 | uint32_t jpegtable_count, 31 | uint8_t** dest, 32 | const cucim::io::Device& out_device); 33 | 34 | } // namespace cuslide::jpeg 35 | 36 | #endif // CUSLIDE_LIBNVJPEG_H 37 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/jpeg2k/color_conversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef CUSLIDE_JPEG2K_COLOR_CONVERSION_H 18 | #define CUSLIDE_JPEG2K_COLOR_CONVERSION_H 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace cuslide::jpeg2k 25 | { 26 | 27 | void fast_sycc420_to_rgb(opj_image_t* image, uint8_t* dest); 28 | void fast_sycc422_to_rgb(opj_image_t* image, uint8_t* dest); 29 | void fast_sycc444_to_rgb(opj_image_t* image, uint8_t* dest); 30 | void fast_image_to_rgb(opj_image_t* image, uint8_t* dest); 31 | 32 | } // namespace cuslide::jpeg2k 33 | 34 | #endif // CUSLIDE_JPEG2K_COLOR_CONVERSION_H 35 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/lzw/lzw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef CUSLIDE_LZW_H 18 | #define CUSLIDE_LZW_H 19 | 20 | #include 21 | 22 | #include "lzw_libtiff.h" 23 | 24 | namespace cuslide::lzw 25 | { 26 | 27 | bool decode_lzw(int fd, 28 | unsigned char* raw_buf, 29 | uint64_t offset, 30 | uint64_t size, 31 | uint8_t** dest, 32 | uint64_t dest_nbytes, 33 | const cucim::io::Device& out_device); 34 | } 35 | #endif // CUSLIDE_LZW_H 36 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/raw/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef CUSLIDE_RAW_H 18 | #define CUSLIDE_RAW_H 19 | 20 | #include 21 | 22 | namespace cuslide::raw 23 | { 24 | 25 | bool decode_raw(int fd, 26 | unsigned char* raw_buf, 27 | uint64_t offset, 28 | uint64_t size, 29 | uint8_t** dest, 30 | uint64_t dest_nbytes, 31 | const cucim::io::Device& out_device); 32 | } 33 | #endif // CUSLIDE_RAW_H 34 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/src/cuslide/srctest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CUSLIDE_SRCTEST_H 18 | #define CUSLIDE_SRCTEST_H 19 | 20 | #endif // CUSLIDE_SRCTEST_H 21 | -------------------------------------------------------------------------------- /cpp/plugins/cucim.kit.cuslide/test_data: -------------------------------------------------------------------------------- 1 | ../../../test_data -------------------------------------------------------------------------------- /cpp/src/core/plugin_manager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "plugin_manager.h" 18 | -------------------------------------------------------------------------------- /cpp/src/logger/logger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /cpp/src/plugin/plugin_config.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "cucim/plugin/plugin_config.h" 18 | 19 | #include 20 | #include 21 | 22 | using json = nlohmann::json; 23 | 24 | namespace cucim::plugin 25 | { 26 | 27 | void PluginConfig::load_config(const void* json_obj) 28 | { 29 | const json& plugin_config = *(static_cast(json_obj)); 30 | 31 | if (plugin_config.contains("names") && plugin_config["names"].is_array()) 32 | { 33 | std::vector names; 34 | names.reserve(16); 35 | for (const auto& name : plugin_config["names"]) 36 | { 37 | names.push_back(name); 38 | } 39 | plugin_names = std::move(names); 40 | } 41 | } 42 | 43 | } // namespace cucim::plugin 44 | -------------------------------------------------------------------------------- /cpp/src/profiler/profiler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Apache License, Version 2.0 3 | * Copyright 2021 NVIDIA Corporation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "cucim/profiler/profiler.h" 19 | 20 | #include "cucim/cuimage.h" 21 | 22 | namespace cucim::profiler 23 | { 24 | 25 | Profiler::Profiler(ProfilerConfig& config) : config_(config){}; 26 | 27 | ProfilerConfig& Profiler::config() 28 | { 29 | return config_; 30 | } 31 | 32 | ProfilerConfig Profiler::get_config() const 33 | { 34 | return config_; 35 | } 36 | 37 | void Profiler::trace(bool value) 38 | { 39 | config_.trace = value; 40 | } 41 | 42 | /** 43 | * @brief Return whether if trace is enabled or not 44 | * 45 | * @return true if profiler is enabled. false otherwise 46 | */ 47 | bool Profiler::trace() const 48 | { 49 | return config_.trace; 50 | } 51 | 52 | } // namespace cucim::profiler 53 | -------------------------------------------------------------------------------- /cpp/src/profiler/profiler_config.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "cucim/profiler/profiler_config.h" 18 | 19 | #include 20 | #include 21 | 22 | using json = nlohmann::json; 23 | 24 | namespace cucim::profiler 25 | { 26 | 27 | void ProfilerConfig::load_config(const void* json_obj) 28 | { 29 | const json& profiler_config = *(static_cast(json_obj)); 30 | 31 | if (profiler_config.contains("trace") && profiler_config["trace"].is_boolean()) 32 | { 33 | trace = profiler_config.value("trace", kDefaultProfilerTrace); 34 | } 35 | } 36 | 37 | } // namespace cucim::profiler 38 | -------------------------------------------------------------------------------- /cpp/src/util/file.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "cucim/util/file.h" 18 | 19 | #include 20 | 21 | namespace cucim::util 22 | { 23 | 24 | bool file_exists(const char* path) 25 | { 26 | struct stat st_buff; 27 | return stat(path, &st_buff) == 0; 28 | } 29 | 30 | } // namespace cucim::util 31 | -------------------------------------------------------------------------------- /cpp/src/util/platform.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "cucim/util/platform.h" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | 24 | namespace cucim::util 25 | { 26 | 27 | bool is_in_wsl() 28 | { 29 | struct utsname buf; 30 | int err = uname(&buf); 31 | if (err == 0) 32 | { 33 | char* pos = strstr(buf.release, "icrosoft"); 34 | if (pos) 35 | { 36 | // 'Microsoft' for WSL1 and 'microsoft' for WSL2 37 | if (buf.release < pos && (pos[-1] == 'm' || pos[-1] == 'M')) 38 | { 39 | return true; 40 | } 41 | } 42 | } 43 | return false; 44 | } 45 | 46 | } // namespace cucim::util 47 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = cuCIM 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Building Documentation 2 | 3 | A basic python environment with packages listed in `./requirement.txt` is 4 | enough to build the docs. 5 | 6 | ## Get additional dependency 7 | 8 | ```bash 9 | pip install -r requirement.txt 10 | ``` 11 | 12 | ## Run makefile: 13 | 14 | ```bash 15 | make html 16 | ``` 17 | 18 | Outputs to `build/html/index.html` 19 | -------------------------------------------------------------------------------- /docs/adr/README.md: -------------------------------------------------------------------------------- 1 | # Architecture Decision Record 2 | 3 | Documents in this folder follow the concept from [this blog - Why Write ADRs?](https://github.blog/2020-08-13-why-write-adrs/). 4 | 5 | Please refer to https://github.com/joelparkerhenderson/architecture_decision_record for examples. 6 | 7 | 8 | ## ADR file name conventions 9 | 10 | - The name starts with three-digit number to specify the ID of the ADR. e.g., `001_choose_database.md`. 11 | - The name has a present tense imperative verb phrase. This helps readability and matches our commit message format. 12 | - The name uses lowercase and underscores (same as this repo). This is a balance of readability and system usability. 13 | - The extension is markdown. This can be useful for easy formatting. 14 | 15 | Example 16 | 17 | - 001_choose_database.md 18 | - 002_format_timestamps.md 19 | - 003_manage_passwords.md 20 | - 004_handle_exceptions.md 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | set SPHINXPROJ=cuImage 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 20 | echo.installed, then set the SPHINXBUILD environment variable to point 21 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 22 | echo.may add the Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /docs/references.css: -------------------------------------------------------------------------------- 1 | /* Fix references to not look like parameters */ 2 | dl.citation > dt.label { 3 | display: unset !important; 4 | float: left !important; 5 | border: unset !important; 6 | background: unset !important; 7 | padding: unset !important; 8 | margin: unset !important; 9 | font-size: unset !important; 10 | line-height: unset !important; 11 | padding-right: 0.5rem !important; 12 | } 13 | 14 | /* Add opening bracket */ 15 | dl.citation > dt.label > span::before { 16 | content: "["; 17 | } 18 | 19 | /* Add closing bracket */ 20 | dl.citation > dt.label > span::after { 21 | content: "]"; 22 | } 23 | -------------------------------------------------------------------------------- /docs/requirement.txt: -------------------------------------------------------------------------------- 1 | nbsphinx 2 | recommonmark 3 | sphinx 4 | pydata-sphinx-theme 5 | numpydoc 6 | ipython 7 | -------------------------------------------------------------------------------- /docs/source/_static/EMPTY: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/docs/source/_static/EMPTY -------------------------------------------------------------------------------- /gds/include/cufile_stub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef CUCIM_CUFILE_STUB_H 17 | #define CUCIM_CUFILE_STUB_H 18 | 19 | #include "cufile.h" 20 | 21 | #include "cucim/dynlib/helper.h" 22 | 23 | class CuFileStub 24 | { 25 | public: 26 | void load(); 27 | void unload(); 28 | ~CuFileStub(); 29 | 30 | private: 31 | cucim::dynlib::LibraryHandle handle_ = nullptr; 32 | }; 33 | 34 | #endif // CUCIM_CUFILE_STUB_H 35 | -------------------------------------------------------------------------------- /notebooks/input/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Test Dataset 3 | 4 | TUPAC-TR-488.svs and TUPAC-TR-467.svs are breast cancer cases from the dataset 5 | of Tumor Proliferation Assessment Challenge 2016 (TUPAC16 | MICCAI Grand Challenge) which are publicly 6 | available through [The Cancer Genome Atlas (TCGA)](https://www.cancer.gov/about-nci/organization/ccg/research/structural-genomics/tcga). 7 | 8 | - Website: https://tupac.grand-challenge.org 9 | - Data link: https://tupac.grand-challenge.org/Dataset/ 10 | - TUPAC-TR-467.svs : https://portal.gdc.cancer.gov/files/575c0465-c4bc-4ea7-ab63-ba48aa5e374b 11 | - TUPAC-TR-488.svs : https://portal.gdc.cancer.gov/files/e27c87c9-e163-4d55-8f27-4cc7dfca08d8 12 | - License: CC BY 3.0 (https://wiki.cancerimagingarchive.net/display/Public/TCGA-BRCA#3539225f58e64731d8e47d588cedd99d300d5d6) 13 | - See LICENSE-3rdparty file 14 | 15 | ## Converted files 16 | 17 | - image.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-467.svs 18 | - image2.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-488.svs 19 | -------------------------------------------------------------------------------- /notebooks/static_images/File-access_Experiments_on_TIFF_FileFormat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/File-access_Experiments_on_TIFF_FileFormat.png -------------------------------------------------------------------------------- /notebooks/static_images/File-access_Experiments_on_TIFF_FileFormat2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/File-access_Experiments_on_TIFF_FileFormat2.png -------------------------------------------------------------------------------- /notebooks/static_images/File-access_Experiments_on_TIFF_HDD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/File-access_Experiments_on_TIFF_HDD.png -------------------------------------------------------------------------------- /notebooks/static_images/File-access_Experiments_on_TIFF_NVMe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/File-access_Experiments_on_TIFF_NVMe.png -------------------------------------------------------------------------------- /notebooks/static_images/File-access_Experiments_on_TIFF_SSD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/File-access_Experiments_on_TIFF_SSD.png -------------------------------------------------------------------------------- /notebooks/static_images/Multi-thread_and_Multi-process_Tests_Alignment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/notebooks/static_images/Multi-thread_and_Multi-process_Tests_Alignment.png -------------------------------------------------------------------------------- /python/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 4 4 | charset = utf-8 5 | trim_trailing_whitespace = true 6 | max_line_length = 120 7 | insert_final_newline = true 8 | -------------------------------------------------------------------------------- /python/.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build* 2 | 3 | # C++ libraries 4 | lib*.so* 5 | # cucim plugins 6 | cucim.*.so 7 | -------------------------------------------------------------------------------- /python/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /python/.idea/.name: -------------------------------------------------------------------------------- 1 | pycucim 2 | -------------------------------------------------------------------------------- /python/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /python/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /python/.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | sqlite.xerial 6 | true 7 | org.sqlite.JDBC 8 | jdbc:sqlite:$PROJECT_DIR$/cucim/.coverage 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/includes/NVIDIA_CMAKE_HEADER.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/includes/NVIDIA_C_HEADER.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) $YEAR, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/internal/C Header File.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | #[[#endif]]# //${INCLUDE_GUARD} 6 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/internal/C Source File.c: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #if (${HEADER_FILENAME}) 3 | #[[#include]]# "${HEADER_FILENAME}" 4 | #end 5 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/internal/C++ Class Header.h: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#ifndef]]# ${INCLUDE_GUARD} 3 | #[[#define]]# ${INCLUDE_GUARD} 4 | 5 | ${NAMESPACES_OPEN} 6 | 7 | class ${NAME} { 8 | 9 | }; 10 | 11 | ${NAMESPACES_CLOSE} 12 | 13 | #[[#endif]]# //${INCLUDE_GUARD} 14 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/internal/C++ Class.cc: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_C_HEADER.h") 2 | #[[#include]]# "${HEADER_FILENAME}" 3 | -------------------------------------------------------------------------------- /python/.idea/fileTemplates/internal/CMakeLists.txt.cmake: -------------------------------------------------------------------------------- 1 | #parse("NVIDIA_CMAKE_HEADER.cmake") 2 | -------------------------------------------------------------------------------- /python/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /python/.idea/pycucim.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /python/.idea/python.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /python/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /python/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.sourceDirectory": "${workspaceFolder}/.", 3 | "cmake.buildDirectory": "${workspaceFolder}/build-debug" 4 | } 5 | -------------------------------------------------------------------------------- /python/cmake/deps/pybind11_json.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020-2025, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | if (NOT TARGET deps::pybind11_json) 17 | FetchContent_Declare( 18 | deps-pybind11_json 19 | GIT_REPOSITORY https://github.com/pybind/pybind11_json.git 20 | GIT_TAG 0.2.15 21 | GIT_SHALLOW TRUE 22 | EXCLUDE_FROM_ALL 23 | ) 24 | 25 | message(STATUS "Fetching pybind11_json sources") 26 | FetchContent_MakeAvailable(deps-pybind11_json) 27 | message(STATUS "Fetching pybind11_json sources - done") 28 | 29 | add_library(deps::pybind11_json INTERFACE IMPORTED GLOBAL) 30 | target_link_libraries(deps::pybind11_json INTERFACE pybind11_json) 31 | set(deps-pybind11_json_SOURCE_DIR ${deps-pybind11_json_SOURCE_DIR} CACHE INTERNAL "" FORCE) 32 | mark_as_advanced(deps-pybind11_json_SOURCE_DIR) 33 | endif () 34 | -------------------------------------------------------------------------------- /python/cmake/modules/SuperBuildUtils.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | include(FetchContent) 17 | 18 | set(CMAKE_SUPERBUILD_DEPS_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") 19 | 20 | if(NOT COMMAND superbuild_depend) 21 | function(superbuild_depend module_name) 22 | include("${CMAKE_SUPERBUILD_DEPS_ROOT_DIR}/deps/${module_name}.cmake") 23 | endfunction() 24 | endif() 25 | -------------------------------------------------------------------------------- /python/cucim/.coveragerc: -------------------------------------------------------------------------------- 1 | # .coveragerc to control coverage.py 2 | # Refer to: https://coverage.readthedocs.io/en/latest/config.html#syntax 3 | 4 | [run] 5 | source = 6 | cucim 7 | omit = 8 | # omit vendored files 9 | */_vendored/* 10 | # somehow, above doesn't omit the following files so add below specifically. 11 | */cucim/skimage/_vendored/* 12 | # omit versioneer file 13 | */cucim/_version.py 14 | # omit non-relevant files 15 | */cucim/__init__.py 16 | */cucim/__main__.py 17 | */cucim/time.py 18 | */cucim/_misc.py 19 | */cucim/clara/cli.py 20 | 21 | [paths] 22 | source = 23 | src 24 | */site-packages 25 | 26 | 27 | [report] 28 | show_missing = true 29 | precision = 2 30 | -------------------------------------------------------------------------------- /python/cucim/.editorconfig: -------------------------------------------------------------------------------- 1 | # see https://editorconfig.org/ 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 4 10 | charset = utf-8 11 | 12 | [*.{bat,cmd,ps1}] 13 | end_of_line = crlf 14 | 15 | [*.{yml,yaml}] 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /python/cucim/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ../../CHANGELOG.md -------------------------------------------------------------------------------- /python/cucim/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../../CONTRIBUTING.md -------------------------------------------------------------------------------- /python/cucim/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /python/cucim/LICENSE-3rdparty.md: -------------------------------------------------------------------------------- 1 | ../../LICENSE-3rdparty.md -------------------------------------------------------------------------------- /python/cucim/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # https://packaging.python.org/guides/using-manifest-in/ 2 | include .editorconfig 3 | 4 | include src/cucim/VERSION 5 | include CHANGELOG.md 6 | include CONTRIBUTING.md 7 | include LICENSE 8 | include LICENSE-3rdparty.md 9 | include README.md 10 | 11 | include src/cucim/clara/*.so* 12 | 13 | recursive-include src/cucim *.py *.pyi *.cu *.h *.npy *.txt *.md 14 | 15 | global-exclude *.py[cod] __pycache__/* 16 | -------------------------------------------------------------------------------- /python/cucim/README.md: -------------------------------------------------------------------------------- 1 | ../../README.md -------------------------------------------------------------------------------- /python/cucim/VERSION: -------------------------------------------------------------------------------- 1 | ../../VERSION -------------------------------------------------------------------------------- /python/cucim/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, NVIDIA CORPORATION. 2 | 3 | from setuptools import setup 4 | from setuptools.dist import Distribution as _Distribution 5 | 6 | 7 | # As we vendored a shared object that links to a specific Python version, 8 | # make sure it is treated as impure so the wheel is named properly. 9 | class Distribution(_Distribution): 10 | def has_ext_modules(self): 11 | return True 12 | 13 | 14 | setup( 15 | distclass=Distribution, 16 | ) 17 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/VERSION: -------------------------------------------------------------------------------- 1 | ../../../../VERSION -------------------------------------------------------------------------------- /python/cucim/src/cucim/__init__.pyi: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | from ._version import __git_commit__, __version__ 17 | 18 | submodules = [] 19 | 20 | try: 21 | import cupy 22 | 23 | _is_cupy_available = True 24 | submodules += ["core", "skimage"] 25 | del cupy 26 | except ImportError: 27 | pass 28 | 29 | try: 30 | from .clara import CuImage, cli # noqa: F401 31 | 32 | _is_clara_available = True 33 | submodules += ["clara"] 34 | except ImportError: 35 | pass 36 | 37 | __all__ = submodules + [ # noqa: F822 38 | "__git_commit__", 39 | "__version__", 40 | "is_available", 41 | ] 42 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/__main__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | """ 17 | Entrypoint module, in case you use `python -mcucim`. 18 | 19 | 20 | Why does this file exist, and why __main__? For more info, read: 21 | 22 | - https://www.python.org/dev/peps/pep-0338/ 23 | - https://docs.python.org/2/using/cmdline.html#cmdoption-m 24 | - https://docs.python.org/3/using/cmdline.html#cmdoption-m 25 | """ 26 | from cucim.clara.cli import main 27 | 28 | if __name__ == "__main__": 29 | main() 30 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/_misc.py: -------------------------------------------------------------------------------- 1 | """Misc utility functions that are not from SciPy, NumPy or scikit-image. 2 | 3 | """ 4 | import numpy as np 5 | 6 | 7 | def ndim(a): 8 | """ 9 | Return the number of dimensions of an array. 10 | 11 | Parameters 12 | ---------- 13 | a : array_like 14 | Input array. If it is not already an ndarray, a conversion is 15 | attempted. 16 | 17 | Returns 18 | ------- 19 | number_of_dimensions : int 20 | The number of dimensions in `a`. Scalars are zero-dimensional. 21 | 22 | See Also 23 | -------- 24 | ndarray.ndim : equivalent method 25 | shape : dimensions of array 26 | ndarray.shape : dimensions of array 27 | 28 | Examples 29 | -------- 30 | >>> from cucim.numpy import ndim 31 | >>> ndim([[1,2,3],[4,5,6]]) 32 | 2 33 | >>> ndim(cupy.asarray([[1,2,3],[4,5,6]])) 34 | 2 35 | >>> ndim(1) 36 | 0 37 | 38 | """ 39 | try: 40 | return a.ndim 41 | except AttributeError: 42 | return np.asarray(a).ndim 43 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/_version.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, NVIDIA CORPORATION. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import importlib.resources 16 | 17 | __version__ = ( 18 | importlib.resources.files(__package__) 19 | .joinpath("VERSION") 20 | .read_text() 21 | .strip() 22 | ) 23 | try: 24 | __git_commit__ = ( 25 | importlib.resources.files(__package__) 26 | .joinpath("GIT_COMMIT") 27 | .read_text() 28 | .strip() 29 | ) 30 | except FileNotFoundError: 31 | __git_commit__ = "" 32 | 33 | __all__ = ["__git_commit__", "__version__"] 34 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/clara/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | import os 17 | 18 | from . import cli, converter 19 | 20 | # import hidden methods 21 | from ._cucim import CuImage, DLDataType, DLDataTypeCode, cache, filesystem, io 22 | 23 | __all__ = [ 24 | "cli", 25 | "CuImage", 26 | "DLDataType", 27 | "DLDataTypeCode", 28 | "filesystem", 29 | "io", 30 | "cache", 31 | "converter", 32 | ] 33 | 34 | 35 | from ._cucim import _get_plugin_root # isort:skip 36 | from ._cucim import _set_plugin_root # isort:skip 37 | 38 | # Set plugin root path 39 | _set_plugin_root(os.path.dirname(os.path.realpath(__file__))) 40 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/clara/cache/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | from cucim.clara._cucim.cache import ( 17 | CacheType, 18 | ImageCache, 19 | preferred_memory_capacity, 20 | ) 21 | 22 | __all__ = ["CacheType", "ImageCache", "preferred_memory_capacity"] 23 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/clara/filesystem/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | from cucim.clara._cucim.filesystem import * 17 | 18 | __all__ = [ 19 | "open", 20 | "pread", 21 | "pwrite", 22 | "close", 23 | "discard_page_cache", 24 | "CuFileDriver", 25 | ] 26 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/clara/io/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | from cucim.clara._cucim.io import * 17 | 18 | __all__ = ["DeviceType", "Device"] 19 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/__init__.py -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/__init__.py -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/color/__init__.py: -------------------------------------------------------------------------------- 1 | from .jitter import color_jitter, rand_color_jitter 2 | from .stain_normalizer import ( 3 | absorbance_to_image, 4 | image_to_absorbance, 5 | normalize_colors_pca, 6 | stain_extraction_pca, 7 | ) 8 | 9 | __all__ = [ 10 | "color_jitter", 11 | "rand_color_jitter" "absorbance_to_image", 12 | "image_to_absorbance", 13 | "stain_extraction_pca", 14 | "normalize_colors_pca", 15 | ] 16 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/expose/tests/test_expose.py: -------------------------------------------------------------------------------- 1 | from cucim.core.operations.expose.transform import ( 2 | color_jitter, 3 | image_flip, 4 | image_rotate_90, 5 | normalize_data, 6 | rand_color_jitter, 7 | rand_image_flip, 8 | rand_image_rotate_90, 9 | rand_zoom, 10 | scale_intensity_range, 11 | zoom, 12 | ) 13 | 14 | 15 | def test_exposed_transforms(): 16 | assert color_jitter is not None 17 | assert rand_color_jitter is not None 18 | assert image_flip is not None 19 | assert image_rotate_90 is not None 20 | assert scale_intensity_range is not None 21 | assert normalize_data is not None 22 | assert zoom is not None 23 | assert rand_zoom is not None 24 | assert rand_image_flip is not None 25 | assert rand_image_rotate_90 is not None 26 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/expose/transform.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, NVIDIA CORPORATION. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from cucim.core.operations.color import color_jitter, rand_color_jitter # noqa 16 | from cucim.core.operations.intensity import ( # noqa 17 | normalize_data, 18 | rand_zoom, 19 | scale_intensity_range, 20 | zoom, 21 | ) 22 | from cucim.core.operations.spatial import ( # noqa 23 | image_flip, 24 | image_rotate_90, 25 | rand_image_flip, 26 | rand_image_rotate_90, 27 | ) 28 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/__init__.py: -------------------------------------------------------------------------------- 1 | from .normalize import normalize_data 2 | from .scaling import scale_intensity_range 3 | from .zoom import rand_zoom, zoom 4 | 5 | __all__ = ["normalize_data", "scale_intensity_range", "zoom", "rand_zoom"] 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/tests/normalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/intensity/tests/normalized.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/tests/normalized_atan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/intensity/tests/normalized_atan.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/tests/scaled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/intensity/tests/scaled.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/tests/zoomed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/intensity/tests/zoomed.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/intensity/tests/zoomout_padded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/intensity/tests/zoomout_padded.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/morphology/__init__.py: -------------------------------------------------------------------------------- 1 | from ._distance_transform import distance_transform_edt 2 | 3 | __all__ = ["distance_transform_edt"] 4 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/spatial/__init__.py: -------------------------------------------------------------------------------- 1 | from .rotate_and_flip import ( 2 | image_flip, 3 | image_rotate_90, 4 | rand_image_flip, 5 | rand_image_rotate_90, 6 | ) 7 | 8 | __all__ = [ 9 | "image_rotate_90", 10 | "image_flip", 11 | "rand_image_flip", 12 | "rand_image_rotate_90", 13 | ] 14 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/spatial/tests/flipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/spatial/tests/flipped.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/core/operations/spatial/tests/rotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/core/operations/spatial/tests/rotated.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/py.typed -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/__init__.pyi: -------------------------------------------------------------------------------- 1 | submodules = [ 2 | "color", 3 | "data", 4 | "exposure", 5 | "feature", 6 | "filters", 7 | "measure", 8 | "metrics", 9 | "morphology", 10 | "registration", 11 | "restoration", 12 | "segmentation", 13 | "transform", 14 | "util", 15 | ] 16 | 17 | __all__ = submodules 18 | 19 | from . import ( # noqa: F401, E402 20 | color, 21 | data, 22 | exposure, 23 | feature, 24 | filters, 25 | measure, 26 | metrics, 27 | morphology, 28 | registration, 29 | restoration, 30 | segmentation, 31 | transform, 32 | util, 33 | ) 34 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_shared/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/_shared/__init__.py -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_shared/_dependency_checks.py: -------------------------------------------------------------------------------- 1 | from .version_requirements import is_installed 2 | 3 | has_mpl = is_installed("matplotlib", ">=3.3") 4 | if has_mpl: 5 | try: 6 | # will fail with 7 | # ImportError: Failed to import any qt binding 8 | # if only matplotlib-base is installed 9 | from matplotlib import pyplot # noqa 10 | except ImportError: 11 | has_mpl = False 12 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_shared/compat.py: -------------------------------------------------------------------------------- 1 | """Compatibility helpers for dependencies.""" 2 | 3 | import cupy as cp 4 | import numpy as np 5 | from packaging.version import parse 6 | 7 | __all__ = [ 8 | "NP_COPY_IF_NEEDED", 9 | "SCIPY_CG_TOL_PARAM_NAME", 10 | ] 11 | 12 | 13 | NUMPY_LT_2_0_0 = parse(np.__version__) < parse("2.0.0.dev0") 14 | 15 | # With NumPy 2.0.0, `copy=False` now raises a ValueError if the copy cannot be 16 | # made. The previous behavior to only copy if needed is provided with 17 | # `copy=None`. During the transition period, use this symbol instead. 18 | # Remove once NumPy 2.0.0 is the minimal required version. 19 | # https://numpy.org/devdocs/release/2.0.0-notes.html#new-copy-keyword-meaning-for-array-and-asarray-constructors # noqa: E501 20 | # https://github.com/numpy/numpy/pull/25168 21 | NP_COPY_IF_NEEDED = False if NUMPY_LT_2_0_0 else None 22 | 23 | 24 | # check CuPy instead of SciPy 25 | CUPY_LT_14 = parse(cp.__version__) < parse("14.0.0a1") 26 | 27 | # Starting in SciPy v1.12, 'scipy.sparse.linalg.cg' keyword argument `tol` is 28 | # deprecated in favor of `rtol`. The corresponding change in cupyx.scipy.sparse 29 | # was made in v14.0 30 | SCIPY_CG_TOL_PARAM_NAME = "tol" if CUPY_LT_14 else "rtol" 31 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_shared/fft.py: -------------------------------------------------------------------------------- 1 | """Prefer FFTs via the new scipy.fft module when available (SciPy 1.4+) 2 | 3 | Otherwise fall back to numpy.fft. 4 | 5 | Like numpy 1.15+ scipy 1.3+ is also using pocketfft, but a newer 6 | C++/pybind11 version called pypocketfft 7 | """ 8 | import cupyx.scipy.fft 9 | from cupyx.scipy.fft import next_fast_len 10 | 11 | fftmodule = cupyx.scipy.fft 12 | 13 | __all__ = ["fftmodule", "next_fast_len"] 14 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_shared/tests/test_warnings.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pytest 4 | 5 | from cucim.skimage._shared._warnings import expected_warnings 6 | 7 | 8 | @pytest.fixture(scope="function") 9 | def setup(): 10 | # Remove any environment variable if it exists 11 | old_strictness = os.environ.pop("SKIMAGE_TEST_STRICT_WARNINGS", None) 12 | yield 13 | # Add the user's desired strictness 14 | if old_strictness is not None: 15 | os.environ["SKIMAGE_TEST_STRICT_WARNINGS"] = old_strictness 16 | 17 | 18 | def test_strict_warnigns_default(setup): 19 | # By default we should fail on missing expected warnings 20 | with pytest.raises(ValueError): 21 | with expected_warnings(["some warnings"]): 22 | pass 23 | 24 | 25 | @pytest.mark.parametrize("strictness", ["1", "true", "True", "TRUE"]) 26 | def test_strict_warning_true(setup, strictness): 27 | os.environ["SKIMAGE_TEST_STRICT_WARNINGS"] = strictness 28 | with pytest.raises(ValueError): 29 | with expected_warnings(["some warnings"]): 30 | pass 31 | 32 | 33 | @pytest.mark.parametrize("strictness", ["0", "false", "False", "FALSE"]) 34 | def test_strict_warning_false(setup, strictness): 35 | # If the user doesnn't wish to be strict about warnings 36 | # the following shouldn't raise any error 37 | os.environ["SKIMAGE_TEST_STRICT_WARNINGS"] = strictness 38 | with expected_warnings(["some warnings"]): 39 | pass 40 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/_vendored/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module will hold copies of any upstream CuPy code that is needed, but has 3 | not yet been merged to CuPy master. 4 | """ 5 | 6 | from cucim.skimage._vendored._pearsonr import pearsonr 7 | from cucim.skimage._vendored.pad import pad 8 | from cucim.skimage._vendored.signaltools import * # noqa 9 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_a_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_b_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_c_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d50_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d55_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d65_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d75_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d75_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_d75_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_d75_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/lab_array_e_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/lab_array_e_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_a_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_b_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_c_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d50_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d55_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_r.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d65_r.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d75_10.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d75_10.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_d75_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_d75_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/color/tests/data/luv_array_e_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/color/tests/data/luv_array_e_2.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/data/__init__.py: -------------------------------------------------------------------------------- 1 | import lazy_loader as _lazy 2 | 3 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 4 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/data/__init__.pyi: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | "binary_blobs", 3 | ] 4 | 5 | from ._binary_blobs import binary_blobs 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/data/tests/test_data.py: -------------------------------------------------------------------------------- 1 | import cupy as cp 2 | from numpy.testing import assert_almost_equal 3 | 4 | from cucim.skimage import data 5 | 6 | 7 | def test_binary_blobs(): 8 | blobs = data.binary_blobs(length=128) 9 | assert_almost_equal(blobs.mean(), 0.5, decimal=1) 10 | blobs = data.binary_blobs(length=128, volume_fraction=0.25) 11 | assert_almost_equal(blobs.mean(), 0.25, decimal=1) 12 | blobs = data.binary_blobs(length=32, volume_fraction=0.25, n_dim=3) 13 | assert_almost_equal(blobs.mean(), 0.25, decimal=1) 14 | other_realization = data.binary_blobs( 15 | length=32, volume_fraction=0.25, n_dim=3 16 | ) 17 | assert not cp.all(blobs == other_realization) 18 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/exposure/__init__.py: -------------------------------------------------------------------------------- 1 | """Image intensity adjustment, e.g., histogram equalization, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/exposure/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Explicitly setting `__all__` is necessary for type inference engines 2 | # to know which symbols are exported. See 3 | # https://peps.python.org/pep-0484/#stub-files 4 | 5 | __all__ = [ 6 | "histogram", 7 | "equalize_hist", 8 | "equalize_adapthist", 9 | "rescale_intensity", 10 | "cumulative_distribution", 11 | "adjust_gamma", 12 | "adjust_sigmoid", 13 | "adjust_log", 14 | "is_low_contrast", 15 | "match_histograms", 16 | ] 17 | 18 | from ._adapthist import equalize_adapthist 19 | from .exposure import ( 20 | adjust_gamma, 21 | adjust_log, 22 | adjust_sigmoid, 23 | cumulative_distribution, 24 | equalize_hist, 25 | histogram, 26 | is_low_contrast, 27 | rescale_intensity, 28 | ) 29 | from .histogram_matching import match_histograms 30 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/feature/__init__.py: -------------------------------------------------------------------------------- 1 | """Feature detection and extraction, e.g., blobs, corners, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/feature/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Explicitly setting `__all__` is necessary for type inference engines 2 | # to know which symbols are exported. See 3 | # https://peps.python.org/pep-0484/#stub-files 4 | 5 | __all__ = [ 6 | "canny", 7 | "daisy", 8 | "peak_local_max", 9 | "structure_tensor", 10 | "structure_tensor_eigenvalues", 11 | "hessian_matrix", 12 | "hessian_matrix_det", 13 | "hessian_matrix_eigvals", 14 | "shape_index", 15 | "corner_kitchen_rosenfeld", 16 | "corner_harris", 17 | "corner_shi_tomasi", 18 | "corner_foerstner", 19 | "corner_peaks", 20 | "match_template", 21 | "match_descriptors", 22 | "blob_dog", 23 | "blob_doh", 24 | "blob_log", 25 | "multiscale_basic_features", 26 | ] 27 | 28 | from ._basic_features import multiscale_basic_features 29 | from ._canny import canny 30 | from ._daisy import daisy 31 | from .blob import blob_dog, blob_doh, blob_log 32 | from .corner import ( 33 | corner_foerstner, 34 | corner_harris, 35 | corner_kitchen_rosenfeld, 36 | corner_peaks, 37 | corner_shi_tomasi, 38 | hessian_matrix, 39 | hessian_matrix_det, 40 | hessian_matrix_eigvals, 41 | shape_index, 42 | structure_tensor, 43 | structure_tensor_eigenvalues, 44 | ) 45 | from .match import match_descriptors 46 | from .peak import peak_local_max 47 | from .template import match_template 48 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/filters/__init__.py: -------------------------------------------------------------------------------- 1 | """Sharpening, edge finding, thresholding, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/filters/tests/test_rank_order.py: -------------------------------------------------------------------------------- 1 | import cupy as cp 2 | import skimage.data 3 | import skimage.filters 4 | 5 | from cucim.skimage.filters import rank_order 6 | 7 | img = cp.asarray(skimage.data.camera()) 8 | 9 | 10 | def test_rank_order(): 11 | expected, ov_expected = skimage.filters.rank_order(img.get()) 12 | r, ov = rank_order(img) 13 | cp.testing.assert_allclose(r, expected) 14 | cp.testing.assert_allclose(ov, ov_expected) 15 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/measure/__init__.py: -------------------------------------------------------------------------------- 1 | """Measurement of image properties, e.g., region properties, moments.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/measure/entropy.py: -------------------------------------------------------------------------------- 1 | import cupy as cp 2 | from cupyx.scipy.stats import entropy as scipy_entropy 3 | 4 | 5 | def shannon_entropy(image, base=2): 6 | """Calculate the Shannon entropy of an image. 7 | 8 | The Shannon entropy is defined as S = -sum(pk * log(pk)), 9 | where pk are frequency/probability of pixels of value k. 10 | 11 | Parameters 12 | ---------- 13 | image : (M, N) ndarray 14 | Grayscale input image. 15 | base : float, optional 16 | The logarithmic base to use. 17 | 18 | Returns 19 | ------- 20 | entropy : 0-dimensional float cupy.ndarray 21 | 22 | Notes 23 | ----- 24 | The returned value is measured in bits or shannon (Sh) for base=2, natural 25 | unit (nat) for base=np.e and hartley (Hart) for base=10. 26 | 27 | References 28 | ---------- 29 | .. [1] https://en.wikipedia.org/wiki/Entropy_(information_theory) `_ 30 | .. [2] https://en.wiktionary.org/wiki/Shannon_entropy 31 | 32 | Examples 33 | -------- 34 | >>> import cupy as cp 35 | >>> from skimage import data 36 | >>> from cucim.skimage.measure import shannon_entropy 37 | >>> shannon_entropy(cp.array(data.camera())) 38 | array(7.23169501) 39 | """ # noqa: E501 40 | 41 | _, counts = cp.unique(image, return_counts=True) 42 | return scipy_entropy(counts, base=base) 43 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/measure/tests/test_entropy.py: -------------------------------------------------------------------------------- 1 | import cupy as cp 2 | import numpy as np 3 | from numpy.testing import assert_almost_equal 4 | 5 | from cucim.skimage.measure import shannon_entropy 6 | 7 | 8 | def test_shannon_ones(): 9 | img = cp.ones((10, 10)) 10 | res = shannon_entropy(img, base=np.e) 11 | assert_almost_equal(float(res), 0.0) 12 | 13 | 14 | def test_shannon_all_unique(): 15 | img = cp.arange(64) 16 | res = shannon_entropy(img, base=2) 17 | assert_almost_equal(float(res), np.log(64) / np.log(2)) 18 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | """Metrics corresponding to images, e.g., distance metrics, similarity, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/metrics/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Explicitly setting `__all__` is necessary for type inference engines 2 | # to know which symbols are exported. See 3 | # https://peps.python.org/pep-0484/#stub-files 4 | 5 | __all__ = [ 6 | "adapted_rand_error", 7 | "variation_of_information", 8 | "contingency_table", 9 | "mean_squared_error", 10 | "normalized_mutual_information", 11 | "normalized_root_mse", 12 | "peak_signal_noise_ratio", 13 | "structural_similarity", 14 | ] 15 | 16 | from ._adapted_rand_error import adapted_rand_error 17 | from ._contingency_table import contingency_table 18 | from ._structural_similarity import structural_similarity 19 | from ._variation_of_information import variation_of_information 20 | from .simple_metrics import ( 21 | mean_squared_error, 22 | normalized_mutual_information, 23 | normalized_root_mse, 24 | peak_signal_noise_ratio, 25 | ) 26 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/morphology/ball_decompositions.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/morphology/ball_decompositions.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/morphology/disk_decompositions.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/morphology/disk_decompositions.npy -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/__init__.py: -------------------------------------------------------------------------------- 1 | """Image registration algorithms, e.g., optical flow or phase cross correlation.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Explicitly setting `__all__` is necessary for type inference engines 2 | # to know which symbols are exported. See 3 | # https://peps.python.org/pep-0484/#stub-files 4 | 5 | __all__ = ["optical_flow_ilk", "optical_flow_tvl1", "phase_cross_correlation"] 6 | 7 | from ._optical_flow import optical_flow_ilk, optical_flow_tvl1 8 | from ._phase_cross_correlation import phase_cross_correlation 9 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/OriginalX-130Y130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/OriginalX-130Y130.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/OriginalX130Y130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/OriginalX130Y130.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/OriginalX75Y75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/OriginalX75Y75.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/TransformedX-130Y130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/TransformedX-130Y130.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/TransformedX130Y130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/TransformedX130Y130.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/registration/tests/data/TransformedX75Y75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/src/cucim/skimage/registration/tests/data/TransformedX75Y75.png -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/restoration/__init__.py: -------------------------------------------------------------------------------- 1 | """Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/restoration/__init__.pyi: -------------------------------------------------------------------------------- 1 | # Explicitly setting `__all__` is necessary for type inference engines 2 | # to know which symbols are exported. See 3 | # https://peps.python.org/pep-0484/#stub-files 4 | 5 | __all__ = [ 6 | "wiener", 7 | "unsupervised_wiener", 8 | "richardson_lucy", 9 | "denoise_tv_chambolle", 10 | "denoise_invariant", 11 | "calibrate_denoiser", 12 | ] 13 | 14 | from ._denoise import denoise_tv_chambolle 15 | from .deconvolution import richardson_lucy, unsupervised_wiener, wiener 16 | from .j_invariant import calibrate_denoiser, denoise_invariant 17 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/segmentation/__init__.py: -------------------------------------------------------------------------------- 1 | """Algorithms to partition images into meaningful regions or boundaries.""" 2 | 3 | from ._chan_vese import chan_vese 4 | from ._clear_border import clear_border 5 | from ._expand_labels import expand_labels 6 | from ._join import join_segmentations, relabel_sequential 7 | from .boundaries import find_boundaries, mark_boundaries 8 | from .morphsnakes import ( 9 | checkerboard_level_set, 10 | disk_level_set, 11 | inverse_gaussian_gradient, 12 | morphological_chan_vese, 13 | morphological_geodesic_active_contour, 14 | ) 15 | from .random_walker_segmentation import random_walker 16 | 17 | __all__ = [ 18 | "expand_labels", 19 | "random_walker", 20 | "find_boundaries", 21 | "mark_boundaries", 22 | "clear_border", 23 | "join_segmentations", 24 | "relabel_sequential", 25 | "chan_vese", 26 | "morphological_geodesic_active_contour", 27 | "morphological_chan_vese", 28 | "inverse_gaussian_gradient", 29 | "disk_level_set", 30 | "checkerboard_level_set", 31 | ] 32 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/transform/__init__.py: -------------------------------------------------------------------------------- 1 | """Geometric and other transformations, e.g., rotations, warp, etc.""" 2 | 3 | import lazy_loader as _lazy 4 | 5 | __getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__) 6 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/skimage/util/__init__.py: -------------------------------------------------------------------------------- 1 | """Generic utilities. 2 | 3 | This module contains a number of utility functions to work with images in general. 4 | """ 5 | 6 | from ._invert import invert 7 | from ._map_array import map_array 8 | from .arraycrop import crop 9 | from .dtype import ( 10 | dtype_limits, 11 | img_as_bool, 12 | img_as_float, 13 | img_as_float32, 14 | img_as_float64, 15 | img_as_int, 16 | img_as_ubyte, 17 | img_as_uint, 18 | ) 19 | from .noise import random_noise 20 | from .shape import view_as_blocks, view_as_windows 21 | 22 | __all__ = [ 23 | "img_as_float32", 24 | "img_as_float64", 25 | "img_as_float", 26 | "img_as_int", 27 | "img_as_uint", 28 | "img_as_ubyte", 29 | "img_as_bool", 30 | "dtype_limits", 31 | "view_as_blocks", 32 | "view_as_windows", 33 | "crop", 34 | "map_array", 35 | "random_noise", 36 | "invert", 37 | ] 38 | -------------------------------------------------------------------------------- /python/cucim/src/cucim/time.py: -------------------------------------------------------------------------------- 1 | from .skimage._vendored.time import repeat 2 | 3 | __all__ = ["repeat"] 4 | -------------------------------------------------------------------------------- /python/cucim/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/conftest.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # Fixtures 17 | from .fixtures.testimage import * # noqa 18 | -------------------------------------------------------------------------------- /python/cucim/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/integration/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/integration/clara/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/integration/clara/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/performance/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/performance/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/performance/clara/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/performance/clara/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/test_cucim.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2020, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | from click.testing import CliRunner 17 | 18 | from cucim.clara.cli import main 19 | 20 | 21 | def test_main(): 22 | runner = CliRunner() 23 | result = runner.invoke(main, ["--help"]) 24 | 25 | assert result.exit_code == 0 26 | -------------------------------------------------------------------------------- /python/cucim/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/unit/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/unit/clara/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapidsai/cucim/8d0085f4ee49b86081ce3540f359df83670f18db/python/cucim/tests/unit/clara/__init__.py -------------------------------------------------------------------------------- /python/cucim/tests/unit/clara/test_load_image.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | import pytest 17 | 18 | from ...util.io import open_image_cucim 19 | 20 | 21 | def test_load_non_existing_image(): 22 | with pytest.raises(ValueError, match=r"Cannot open .*"): 23 | _ = open_image_cucim("/tmp/non_existing_image.tif") 24 | -------------------------------------------------------------------------------- /python/cucim/tests/unit/test_version.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2024, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | import cucim 17 | 18 | 19 | def test_version_constants_are_populated(): 20 | # __git_commit__ will only be non-empty in a built distribution 21 | assert isinstance(cucim.__git_commit__, str) 22 | 23 | # __version__ should always be non-empty 24 | assert isinstance(cucim.__version__, str) 25 | assert len(cucim.__version__) > 0 26 | -------------------------------------------------------------------------------- /python/cucim/tests/util/io.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2021, NVIDIA CORPORATION. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | 17 | def open_image_cucim(file_path): 18 | from cucim import CuImage 19 | 20 | img = CuImage(file_path) 21 | return img 22 | -------------------------------------------------------------------------------- /python/pybind11/cache/image_cache_py.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "image_cache_py.h" 18 | #include "image_cache_pydoc.h" 19 | 20 | #include 21 | 22 | namespace py = pybind11; 23 | 24 | namespace cucim::cache 25 | { 26 | 27 | } // namespace cucim::cache 28 | -------------------------------------------------------------------------------- /python/pybind11/cache/image_cache_py.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_CACHE_IMAGE_CACHE_PY_H 17 | #define PYCUCIM_CACHE_IMAGE_CACHE_PY_H 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace py = pybind11; 24 | 25 | namespace cucim::cache 26 | { 27 | 28 | 29 | } // namespace cucim::cache 30 | 31 | #endif // PYCUCIM_CACHE_IMAGE_CACHE_PY_H 32 | -------------------------------------------------------------------------------- /python/pybind11/filesystem/cufile_py.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_CUFILE_PY_H 17 | #define PYCUCIM_CUFILE_PY_H 18 | 19 | #include "cucim/filesystem/cufile_driver.h" 20 | 21 | #include 22 | #include 23 | 24 | namespace py = pybind11; 25 | 26 | namespace cucim::filesystem 27 | { 28 | // Note: there would be name conflict with pread/pwrite in cufile_driver.h so prefixed 'fd_'. 29 | ssize_t fd_pread(const CuFileDriver& fd, const py::object& buf, size_t count, off_t file_offset, off_t buf_offset = 0); 30 | ssize_t fd_pwrite(CuFileDriver& fd, const py::object& buf, size_t count, off_t file_offset, off_t buf_offset = 0); 31 | } // namespace cucim::filesystem 32 | 33 | #endif // PYCUCIM_CUFILE_PY_H 34 | -------------------------------------------------------------------------------- /python/pybind11/io/device_py.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "device_pydoc.h" 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace py = pybind11; 24 | 25 | namespace cucim::io 26 | { 27 | 28 | } // namespace cucim::io 29 | -------------------------------------------------------------------------------- /python/pybind11/io/io_py.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef PYCUCIM_IO_INIT_H 18 | #define PYCUCIM_IO_INIT_H 19 | 20 | #include 21 | 22 | namespace py = pybind11; 23 | 24 | namespace cucim::io 25 | { 26 | 27 | void init_io(py::module& m); 28 | 29 | } 30 | 31 | 32 | #endif // PYCUCIM_IO_INIT_H 33 | -------------------------------------------------------------------------------- /python/pybind11/io/io_pydoc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_IO_PYDOC_H 17 | #define PYCUCIM_IO_PYDOC_H 18 | 19 | #include "../macros.h" 20 | 21 | namespace cucim::io::doc 22 | { 23 | 24 | } 25 | 26 | #endif // PYCUCIM_IO_PYDOC_H 27 | -------------------------------------------------------------------------------- /python/pybind11/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef PYCUCIM_MACRO_H 18 | #define PYCUCIM_MACRO_H 19 | 20 | #include 21 | 22 | #include 23 | 24 | constexpr const char* remove_leading_spaces(const char* str) 25 | { 26 | return *str == '\0' ? str : ((*str == ' ' || *str == '\n') ? remove_leading_spaces(str + 1) : str); 27 | } 28 | 29 | #define PYDOC(method, doc) static constexpr const char* doc_##method = remove_leading_spaces(doc); 30 | 31 | #endif // PYCUCIM_MACRO_H 32 | -------------------------------------------------------------------------------- /python/pybind11/memory/memory_py.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020-2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_MEMORY_INIT_H 17 | #define PYCUCIM_MEMORY_INIT_H 18 | 19 | #include 20 | 21 | #include 22 | 23 | namespace py = pybind11; 24 | 25 | namespace cucim::memory 26 | { 27 | 28 | void init_memory(py::module& m); 29 | 30 | void get_memory_info(const py::object& buf_obj, 31 | void** out_buf, 32 | cucim::io::Device* out_device = nullptr, 33 | size_t* out_memory_size = 0, 34 | bool* out_readonly = nullptr); 35 | 36 | } // namespace cucim::memory 37 | 38 | 39 | #endif // PYCUCIM_MEMORY_INIT_H 40 | -------------------------------------------------------------------------------- /python/pybind11/memory/memory_pydoc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_MEMORY_PYDOC_H 17 | #define PYCUCIM_MEMORY_PYDOC_H 18 | 19 | #include "../macros.h" 20 | 21 | namespace cucim::memory::doc 22 | { 23 | 24 | } // namespace cucim::memory::doc 25 | 26 | 27 | #endif // PYCUCIM_MEMORY_PYDOC_H 28 | -------------------------------------------------------------------------------- /python/pybind11/profiler/profiler_py.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATcacheN. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef PYCUCIM_PROFILER_INIT_H 18 | #define PYCUCIM_PROFILER_INIT_H 19 | 20 | #include 21 | 22 | namespace py = pybind11; 23 | 24 | namespace cucim::profiler 25 | { 26 | 27 | // Forward declaration 28 | class Profiler; 29 | 30 | void init_profiler(py::module& m); 31 | 32 | bool py_trace(Profiler& profiler, py::object value); 33 | 34 | py::dict py_config(Profiler& profiler); 35 | 36 | } // namespace cucim::profiler 37 | 38 | #endif // PYCUCIM_PROFILER_INIT_H 39 | -------------------------------------------------------------------------------- /python/pybind11/profiler/profiler_pydoc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, NVIDIA CORPORATION. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef PYCUCIM_PROFILER_PROFILER_PYDOC_H 17 | #define PYCUCIM_PROFILER_PROFILER_PYDOC_H 18 | 19 | #include "../macros.h" 20 | 21 | namespace cucim::profiler::doc::Profiler 22 | { 23 | 24 | PYDOC(config, R"doc( 25 | Returns the dictionary of configuration. 26 | )doc") 27 | 28 | // void trace(bool value) = 0; 29 | // bool trace() const = 0; 30 | PYDOC(trace, R"doc( 31 | Traces method executions with NVTX. 32 | )doc") 33 | 34 | } // namespace cucim::profiler::doc::Profiler 35 | 36 | #endif // PYCUCIM_PROFILER_PROFILER_PYDOC_H 37 | -------------------------------------------------------------------------------- /scripts/debug_python: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2021, NVIDIA CORPORATION. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") 18 | 19 | if [ -e ${SCRIPT_DIR}/debug_env.sh ]; then 20 | # User can place debug_env.sh in the same directory as this script (scripts/debug_env.sh would be ignored in git repo) 21 | . ${SCRIPT_DIR}/debug_env.sh 22 | elif [ -e ${SCRIPT_DIR}/../.python-version ]; then 23 | # Need to init in script: https://github.com/pyenv/pyenv-virtualenv/issues/204 24 | eval "$(pyenv init -)" 25 | eval "$(pyenv virtualenv-init -)" 26 | # Above will do `pyenv activate $(cat ${SCRIPT_DIR}/../.python-version)`. 27 | else 28 | echo "Environment file not found. Exiting." 29 | exit 1 30 | fi 31 | echo "Python: $(python3 -c "import sys;print(sys.executable)")" 32 | exec env python3 "$@" 33 | -------------------------------------------------------------------------------- /test_data/.gitignore: -------------------------------------------------------------------------------- 1 | input/*.svs 2 | -------------------------------------------------------------------------------- /test_data/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | WORKDIR /input 3 | COPY ./input /input 4 | CMD ["dummy"] 5 | -------------------------------------------------------------------------------- /test_data/README.md: -------------------------------------------------------------------------------- 1 | # Test Data Folder (`test_data` folder) 2 | 3 | Symbolic links for for this folder is available under the following subfolders: 4 | 5 | - `cpp/plugins/cucim.kit.cuslide` 6 | - `python/cucim` 7 | 8 | ## Generated Test Data (`test_data/generated` folder) 9 | 10 | Generated by executing `gen_images.sh`. 11 | 12 | - tiff_stripe_32x32_16.tif 13 | - tiff_stripe_4096x4096_256.tif 14 | 15 | ## Private Test Data (`test_data/private` folder) 16 | 17 | - `generic_tiff_000.tif` : 256x256 multi-resolution/tiled TIF conversion of `TUPAC-TR-467.svs` from the dataset 18 | of [Tumor Proliferation Assessment Challenge 2016](http://tupac.tue-image.nl/node/3) (TUPAC16 | MICCAI Grand Challenge) which are publicly 19 | available through [The Cancer Genome Atlas (TCGA)](https://www.cancer.gov/about-nci/organization/ccg/research/structural-genomics/tcga) under [CC BY 3.0 License](https://creativecommons.org/licenses/by/3.0/) 20 | - `philips_tiff_000.tif` : `normal_042.tif` from the [Camelyon16 challenge data](ftp://parrot.genomics.cn/gigadb/pub/10.5524/100001_101000/100439/CAMELYON16/training/normal/normal_042.tif) (another [link](https://camelyon17.grand-challenge.org/Data/)) which is under [CC0 License](https://choosealicense.com/licenses/cc0-1.0/) 21 | -------------------------------------------------------------------------------- /test_data/gen_images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") 4 | TOP="$(git rev-parse --show-toplevel 2> /dev/null || echo "${SCRIPT_DIR}")" 5 | 6 | [ -z "${TOP}" ] && >&2 echo "Repository root is not available!" && exit 1 7 | 8 | DEST_FOLDER=${TOP}/test_data/generated 9 | mkdir -p ${DEST_FOLDER} 10 | 11 | generate_image() { 12 | local recipe="${1:-tiff}" 13 | local check_file="${2:-}" 14 | 15 | [ -n "${check_file}" ] && [ -f "${DEST_FOLDER}/${check_file}" ] && return 16 | 17 | python3 ${TOP}/python/cucim/tests/util/gen_image.py ${recipe} --dest ${DEST_FOLDER} 18 | } 19 | 20 | generate_image tiff::stripe:32x32:16 tiff_stripe_32x32_16.tif 21 | generate_image tiff::stripe:4096x4096:256:deflate tiff_stripe_4096x4096_256.tif 22 | -------------------------------------------------------------------------------- /test_data/input/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Test Dataset 3 | 4 | TUPAC-TR-488.svs and TUPAC-TR-467.svs are breast cancer cases (TCGA-BRCA) from the dataset 5 | of Tumor Proliferation Assessment Challenge 2016 (TUPAC16 | MICCAI Grand Challenge) which are publicly 6 | available through [The Cancer Genome Atlas (TCGA)](https://www.cancer.gov/about-nci/organization/ccg/research/structural-genomics/tcga) under [CC BY 3.0 License](https://creativecommons.org/licenses/by/3.0/) 7 | 8 | - Website: http://tupac.tue-image.nl/node/3 9 | - Data link: https://drive.google.com/drive/u/0/folders/0B--ztKW0d17XYlBqOXppQmw0M2M 10 | - TUPAC-TR-467.svs : https://portal.gdc.cancer.gov/files/575c0465-c4bc-4ea7-ab63-ba48aa5e374b 11 | - TUPAC-TR-488.svs : https://portal.gdc.cancer.gov/files/e27c87c9-e163-4d55-8f27-4cc7dfca08d8 12 | - License: CC BY 3.0 (https://wiki.cancerimagingarchive.net/display/Public/TCGA-BRCA#3539225f58e64731d8e47d588cedd99d300d5d6) 13 | - See LICENSE-3rdparty file 14 | 15 | ## Converted files 16 | 17 | - image.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-467.svs 18 | - image2.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-488.svs 19 | -------------------------------------------------------------------------------- /test_data/push_testdata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR=$(dirname "$(readlink -f "$0")") 4 | 5 | docker build -t gigony/svs-testdata:little-big ${SCRIPT_DIR} 6 | docker push gigony/svs-testdata:little-big 7 | --------------------------------------------------------------------------------