{"id":17113075,"url":"https://github.com/emmt/libfli.jl","last_synced_at":"2026-03-18T23:26:13.078Z","repository":{"id":71510236,"uuid":"478622902","full_name":"emmt/LibFLI.jl","owner":"emmt","description":"Julia interface to the Finger Lakes Instrumentation devices","archived":false,"fork":false,"pushed_at":"2022-04-07T14:23:23.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-30T19:27:16.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-06T15:38:11.000Z","updated_at":"2022-07-07T15:26:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f14ad7bb-87f9-40dd-8d97-2985d474e5fb","html_url":"https://github.com/emmt/LibFLI.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emmt/LibFLI.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FLibFLI.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FLibFLI.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FLibFLI.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FLibFLI.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/LibFLI.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FLibFLI.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:02:50.868Z","updated_at":"2026-02-21T11:02:18.250Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Julia interface to the Finger Lakes Instrumentation devices\n\nThis package provides a Julia interface to [Finger Lakes Instrumentation\n(FLI)](https://www.flicamera.com/) devices, notably their cameras.\n\n\n## Usage\n\n### Basic usage\n\n```julia\nusing LibFLI\nFLI.set_debug_level(\"\", :all)    # set the debug level\nFLI.get_lib_version()            # get the library version\ncam = FLI.Device(\"/dev/fliusb0\", :usb, :camera) # open 1st USB camera\nFLI.print_camera_info(cam)       # print characteristics of camera\n```\n\nMethod `close(cam)` can be called to eventually close the device associated to\nobject `cam` but this is not mandatory as this is automatically done when the\nobject is reclaimed by the garbage collector.\n\nAs you may have noticed, `using LibFLI` exports symbol `FLI` which is an alias\nfor `LibFLI`.  This simplifies the writing of code as it allows you to write\n`FLI.func` instead of `LibFLI.func` for calling function `func`.  If you do not\nwant this feature, call `import LibFLI` instead.\n\n\n### Naming conventions\n\nThe API attempts to reflect that of the C library.  For readability, function\nnames are in [*snake case*](https://en.wikipedia.org/wiki/Snake_case) style and\nwithout the `FLI` prefix (which is replaced by the name of the module); as an\nexample, `FLITriggerExposure` becomes `FLI.trigger_exposure`.  Constants are\nreplaced by symbolic names.  For example:\n\n```julia\nFLI.set_fan_speed(cam, :on)  # to switch the fan on\nFLI.set_fan_speed(cam, :off) # to switch the fan off\n```\n\n\n### Camera configuration\n\nCamera settings can be tuned individually via the functions of the SDK.  For\ninstance, to configure the camera `cam`, the following functions are available:\n\n```julia\nFLI.set_temperature(cam, degs) # to set the temperature in °C\nFLI.set_exposure_time(cam, secs) # to set the exposure time in seconds\nFLI.set_binning(cam, xbin, ybin) # to set the binning factors (in pixels)\nFLI.set_image_area(cam, x0, y0, x1, y1) # to set the image area\nFLI.set_frame_type(cam, frametype) # to set the frame type\nFLI.set_nflushes(cam, nflushes) # to set the number of background flushes\nFLI.control_background_flush(cam, bgflush) # to start/stop background flushing\nFLI.set_bit_depth(cam, pixeltype) # to set the pixel type\nFLI.set_fan_speed(cam, fanspeed) # to switch on/off the fan\nFLI.control_shutter(cam, shutter) # to control the shutter\n```\n\nBut calling these functions may be tedious, plus some functions (e.g.,\n`FLI.set_image_area`) have weird parameters not directly understandable.  To\nsolve for these issues, a higher level interface is provided by:\n\n```julia\nFLI.configure_camera(cam; key=val, ...)\n```\n\nwhich takes the settings as any of the following keywords:\n\n- `temperature` to specify the target temperature (in °C);\n\n- `exposuretime` to specify the exposure time (in seconds);\n\n- `width` to specify the width of the image area (in macro-pixels);\n\n- `height` to specify the height of the image area (in macro-pixels);\n\n- `xoff` to specify the horizontal offset of the image area (in pixels);\n\n- `yoff` to specify the vertical offset of the image area (in pixels);\n\n- `xbin` to specify the horizontal binning factor (in pixels);\n\n- `ybin` to specify the vertical binning factor (in pixels);\n\n- `frametype` to specify the frame type (value can be `:normal` for a normal\n  frame where the shutter opens, `:dark` for a dark frame where the shutter\n  remains closed, `:flood`, or `:rbi_flush`);\n\n- `nflushes` to specify the number of background flushes;\n\n- `bgflush` to control background flushing (value can be `:start` or `:stop`);\n\n- `pixeltype` to specify the pixel type (value can be `UInt8` or `UInt16`);\n\n- `fanspeed` to control the fan speed (value can be `:on` or `:off`);\n\n- `shutter` to control the shutter (value can be `:close`, `:open`,\n  `:external_trigger`, `:external_trigger_low`, `:external_trigger_high`, or\n  `:external_exposure_control`);\n\n\n### Taking images\n\nTo take an image with camera `cam`, call:\n\n```julia\nimg = FLI.take_image(cam)\n```\n\nwhich starts an exposure, waits for this exposure to complete, and returns the\nacquired image.\n\nThe pixel type, say `T`, may be specified:\n\n\n```julia\nimg = FLI.take_image(T, cam)\n```\n\nwill yield an image whose pixels have type `T`.  If unspecifed, `T = UInt16` is\nassumed.  Beware that using the wrong pixel type may result in unexpected pixel\nvalues (an internal buffer is however used to prevent segmentation faults).\n\nThe current camera settings (pixel type, exposure time, etc.) are used for the\nimage, they can be changed prior to taking the image with\n`FLI.cobfigure_camera` (see above).\n\nTo avoid allocations, an exiting image can be reused with:\n\n```julia\nimg = FLI.take_image!(cam, img)\n```\n\nwhich behaves as `FLI.take_image` except that is stores the acquired image in\n`img` (and returns it).\n\n\n### Connected devices\n\nTo quickly list connected devices, just call:\n\n```julia\nFLI.list_devices(:usb, :camera) # list connected USB cameras\nFLI.list_devices(:serial)       # list devices connected to the serial port\n```\n\nFor more control over connected devices, the method `FLI.foreach_device` can be\nused to execute arbitrary code on connected devices.  This method takes a\nfunction and any number of symbolic names specifying the interface(s) and\ndevice type(s) to consider.  The function is called for each connected device\nmatching the requirements.  For example, `FLI.list_devices` can be emulated to\nlist all connected USB cameras:\n\n```julia\nFLI.foreach_device(:usb, :camera) do domain, filename, devname\n    cam = FLI.Device(filename, domain)\n    println(\"File: \\\"$filename\\\", name: \\\"$devname\\\", domain: $domain\")\n    FLI.print_camera_info(cam)\n    close(cam)\nend\n```\n\n\n## Completeness\n\nAlmost all functions of the FLI SDK are available.  Function `FLIUsbBulkIO` is\nonly available in the `Lib` sub-module.  List oriented functions\n(`FLICreateList`, `FLIListFirst`, `FLIListNext`, `FLIFreeList`, `FLIList`, and\n`FLIFreeList`) are not directly available as their usage is superseded by\n`FLI.foreach_device` which provides a much better interface and internally\ncalls `FLICreateList`, `FLIListFirst`, `FLIListNext`, and `FLIFreeList`.\n\n\n## Installation\n\n### Installation of the FLI SDK\n\nYou have to compile and install the kernel modules for FLI devices and a shared\nversion of the LibFLI library.  The FLI SDK is open source but the [original\nversion](https://www.flicamera.com/software) compiles as a static library.  See\n[libfli](https://git-cral.univ-lyon1.fr/tao/libfli) for an easy way to compile\na shared FLI library.\n\n\n### Installation of the Julia interface\n\nYou have to clone the [`LibFLI`](https://github.com/emmt/LibFLI) repository:\n\n```sh\ngit clone https://github.com/emmt/LibFLI.jl.git\n```\n\nIn the `deps` sub-directory, create a file `deps.jl` which defines the constant\n`libfli` with the path to the shared library.  For example:\n\n```julia\nconst libfli = \"/usr/local/lib/libfli.so\"\n```\n\nRunning:\n\n```sh\njulia LibFLI.jl/deps/build.jl\n```\n\nmy be used to do this almost automatically.\n\n\n## External links\n\nIf you are a Python user, you may be interested in the following projects:\n\n- [pyfli](https://github.com/charris/pyfli);\n\n- [python-FLI](https://github.com/cversek/python-FLI).\n\nThe place where to download official FLI software is\n[here](https://www.flicamera.com/software).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Flibfli.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Flibfli.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Flibfli.jl/lists"}