Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ics/micro-sam into bioengine
  • Loading branch information
constantinpape committed May 13, 2024
2 parents 4f7d41c + fab3249 commit 774edee
Show file tree
Hide file tree
Showing 7 changed files with 2,412 additions and 917 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
RUN_SCRIPT: |
python version_getter.py
mkdir ./${{ matrix.os }}_x86_64
constructor --output-dir ./${{ matrix.os }}_x86_64 .
constructor --output-dir ./${{ matrix.os }}_x86_64 --config-filename construct_${{ matrix.os }}.yaml .
steps:
- name: checkout
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions deployment/construct_windows-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: micro_sam
version: 0.0.1
license_file: ../LICENSE
installer_type: pkg #[osx] # This will trigger pkg build on Mac Os. On windows and linux, native build will be done and this has no effect.
environment: __MICROSAM_BUILD_ENV__
welcome_image: ../doc/logo/logo.png
header_image: ../doc/logo/logo.png
icon_image: ../doc/logo/logo.png
channels:
- conda-forge
welcome_text: Install Segment Anything for Microscopy.
conclusion_text: Segment Anything for Microscopy has been installed.
initialize_by_default: false
post_install: post_install.bat
49 changes: 49 additions & 0 deletions deployment/post_install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@echo off

rem This script searches for the 'freetype.dll' file within a specific directory
rem and attempts to move it to the target directory during post-installation on Windows.
rem If not found locally, it downloads the DLL from a defined URL.


rem Define download URL (replace with the actual URL for your desired version)
set DOWNLOAD_URL=https://raw.githubusercontent.com/ubawurinna/freetype-windows-binaries/master/release%20dll/win64/freetype.dll

rem Define target directory within the installation prefix
set TARGET_DIR=%PREFIX%\Scripts

rem Create the target directory if it doesn't exist
if not exist "%TARGET_DIR%" mkdir "%TARGET_DIR%"

rem Search for freetype.dll in specific directory (adjust path as needed)
for /F "tokens=*" %%a in ('dir /S /B "%PREFIX%\Library\freetype.dll"') do (
if exist "%%a" (
echo Found freetype.dll in %%a
move "%%a" "%TARGET_DIR%"
if exist "%TARGET_DIR%\freetype.dll" (
echo Moved freetype.dll to %TARGET_DIR%
exit /b 0 ; Exit script with success code if moved
) else (
echo Error: Failed to move freetype.dll (check permissions)
exit /b 1 ; Exit script with error code
)
)
)

rem If not found in specific location, proceed with download
powershell -ExecutionPolicy Bypass -Command Invoke-WebRequest -Uri %DOWNLOAD_URL% -OutFile "%TARGET_DIR%\freetype.dll"

if exist "%TARGET_DIR%\freetype.dll" (
echo Downloaded freetype.dll to %TARGET_DIR%
) else (
echo Error downloading freetype.dll
rem Attempt to download the DLL again (optional)
powershell -ExecutionPolicy Bypass -Command Invoke-WebRequest -Uri %DOWNLOAD_URL% -OutFile "%TARGET_DIR%\freetype.dll"
if exist "%TARGET_DIR%\freetype.dll" (
echo Retry: Downloaded freetype.dll to %TARGET_DIR%
) else (
echo Error: Failed to download freetype.dll even after retry
exit /b 1 ; Exit script with error code after retries
)
)

exit /b 0 ; Exit script with success code (after download if necessary)
3 changes: 2 additions & 1 deletion micro_sam/napari.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: micro-sam
display_name: SegmentAnything for Microscopy
# see https://napari.org/stable/plugins/manifest.html for valid categories
categories: ["Segmentation", "Annotation"]
contributions:
commands:

# Commands for sample data.
# We don't provide the sample data for image series via napari for now,
# because the image series annotator cannot be called for image layers in napari (yet),
Expand Down
2 changes: 1 addition & 1 deletion notebooks/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Example Noteboks
# Example Notebooks

We provide three example notebooks that demonstrate how the `micro_sam` python library can be used for:
- Running automatic instance segmentation in `automatic_segmentation.ipynb`.
Expand Down
Loading

0 comments on commit 774edee

Please sign in to comment.