{"id":13716368,"url":"https://github.com/gtatters/ThermImageJ","last_synced_at":"2025-05-07T05:33:09.969Z","repository":{"id":39595648,"uuid":"182273995","full_name":"gtatters/ThermImageJ","owner":"gtatters","description":"ImageJ functions and macros for working with thermal image files","archived":false,"fork":false,"pushed_at":"2024-05-28T22:26:36.000Z","size":19287,"stargazers_count":44,"open_issues_count":0,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-04T00:12:01.552Z","etag":null,"topics":["exiftool","ffmpeg","fiji","fiji-macro","heat-transfer","imagej","imagej-macro","perl","temperature-reading","thermal-imaging"],"latest_commit_sha":null,"homepage":"","language":"ImageJ Macro","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/gtatters.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":"2019-04-19T14:06:39.000Z","updated_at":"2024-07-17T18:43:45.000Z","dependencies_parsed_at":"2024-05-29T01:18:12.602Z","dependency_job_id":"ea6c7a37-7577-4d4f-87de-0917b5814049","html_url":"https://github.com/gtatters/ThermImageJ","commit_stats":{"total_commits":110,"total_committers":2,"mean_commits":55.0,"dds":"0.045454545454545414","last_synced_commit":"cbfc0c63a6011bde25e855fe3245ec08a1e52c41"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtatters%2FThermImageJ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtatters%2FThermImageJ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtatters%2FThermImageJ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtatters%2FThermImageJ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtatters","download_url":"https://codeload.github.com/gtatters/ThermImageJ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224567536,"owners_count":17332828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["exiftool","ffmpeg","fiji","fiji-macro","heat-transfer","imagej","imagej-macro","perl","temperature-reading","thermal-imaging"],"created_at":"2024-08-03T00:01:09.793Z","updated_at":"2024-11-14T04:31:31.604Z","avatar_url":"https://github.com/gtatters.png","language":"ImageJ Macro","funding_links":[],"categories":["Ecology"],"sub_categories":[],"readme":"ThermImageJ - Thermal Image Functions and Macros for ImageJ\n================\n\n\u003cimg src = './images/ThermImageJSticker1.png' align=\"right\" height=\"165\"\u003e\n\nThermImageJ is a collection of ImageJ functions and macros to allow for\nimport and conversion of thermal image files and to assist in extracting\nraw data from infrared thermal images and converting these to\ntemperatures using standard equations in thermography.\n\nThese macros will allow you to import most FLIR jpgs and videos and\nprocess the images in ImageJ.\n\nThermImageJ emerged from Thermimage\n(\u003chttps://github.com/gtatters/Thermimage\u003e), the latter an R package with\nsimilar tools but more emphasis on biological heat transfer analysis.\n\n## Compatibility\n\n- ThermImageJ was developed on OSX, and tested using ImageJ v1.52o. Many\n  features require installation of command line tools that may present\n  future challenges on different operating systems. Testing and\n  troubleshooting is ongoing, especially in Windows. Please report\n  issues here: \u003chttps://github.com/gtatters/ThermImageJ/issues\u003e, or\n  consider converting to Mac or Linux.\n\n## How to Cite\n\n- Glenn J. Tattersall. (2019). ThermImageJ: Thermal Image Functions and\n  Macros for ImageJ. \u003cdoi:10.5281/zenodo.2652896\u003e.\n  [![DOI](https://zenodo.org/badge/182273995.svg)](https://zenodo.org/badge/latestdoi/182273995)\n\n## Requirements\n\n### External Software Downloads\n\n- FIJI is Just ImageJ. Download instructions:\n  \u003chttps://imagej.net/Fiji/Downloads\u003e\n- Exiftool. (The standalone executable file is suggested).\n  - Installation instructions:\n    \u003chttp://www.sno.phy.queensu.ca/~phil/exiftool/install.html\u003e\n  - Windows users might find these instructions do not work readily, so\n    perhaps try this link:\n    \u003chttps://oliverbetz.de/pages/Artikel/ExifTool-for-Windows\u003e - but\n    this has not be fully tested with ThermimageJ\n  - I prefer the simple solution of installing exiftool.exe directly\n    into the windows folder and then verifying it has security\n    privileges to run.\n- FFMPEG command line utility (static version).\n  - Download instructions: \u003chttps://ffmpeg.org/download.html\u003e\n  - Choose the “get packages and executable files” to facilitate an easy\n    installation unless you prefer to work with the source code\n  - Choose the static build.\n- Perl. (Activeperl binary is suggested, although perl may already be\n  built into your operating system).\n  - Installation instructions: \u003chttps://www.perl.org/get.html\u003e\n- Byte swapper plugin.\n  - Download instructions:\n    \u003chttps://imagej.nih.gov/ij/plugins/swapper.html\u003e\n- xxd (command line utility should already be part of OSX and Unix\n  systems)\n  - A windows version can be downloaded from:\n    \u003chttps://sourceforge.net/projects/xxd-for-windows/\u003e or sourced from\n    the exe folder provided at:\n    \u003chttps://github.com/gtatters/ThermimageJ/exe\u003e\n\n### ThermImageJ Downloads from this Github site\n\n- All ThermImageJ files can be easily downloaded as a ZIP file by\n  clicking on the green **Clone or Download** button and then selecting\n  **Download ZIP**\n  (\u003chttps://github.com/gtatters/ThermImageJ/archive/master.zip\u003e), or by\n  going to the **Recent Releases**\n  (\u003chttps://github.com/gtatters/ThermImageJ/releases\u003e) and selecting the\n  **Source Code** link for the most recent release. Unzip this folder on\n  your computer for access to the toolset, luts, and the split.pl files\n  located in their appropriate subfolders.\n\n- The primary files you need to extract from this site are:\n\n  - A custom perl script (split.pl), provided on this github repository,\n    which can be downloaded and placed in a scripts folder with ImageJ:\n    \u003chttps://github.com/gtatters/ThermImageJ/tree/master/scripts/split.pl\u003e\n\n  - ThermImageJ macro toolset. A text file (.ijm) containing all the\n    macros and functions:\n    \u003chttps://github.com/gtatters/ThermImageJ/tree/master/toolsets/ThermImageJ.ijm\u003e\n\n  - Additional Look Up Tables (LUTS), popularly used in thermal imaging,\n    available on this github repository:\n    \u003chttps://github.com/gtatters/ThermImageJ/tree/master/luts\u003e\n\n## Installation Instructions\n\n- Install **FIJI**, **exiftool**, **perl**, and **ffmpeg** according to\n  the website instructions above.\n- Troubleshoot or perform installation checks (see next section).\n- Launch **FIJI** and follow any update instructions.\n- Launch FIJI–\\\u003eHelp–\\\u003eUpdate, allow it to update any plug-ins, then\n  while the update window is open, select **Manage update websites**,\n  and ensure that the FFMPEG box is ticked. Select **ok**, then click\n  the **Apply** option, and restart FIJI. This FFMPEG plugin is required\n  for importing avi files created during the conversion process,\n  although it might require that you have FFMPEG installed at the\n  command line.\n- Navigate to where FIJI is installed to find all the subfolders.  \n- Download the **ThermImageJ.ijm** file from this site and copy into the\n  FIJI/macros/toolsets folder.\n- Open the **ThermImageJ.ijm** file in any text editor, and verify the\n  paths are properly set for your respective operating system. See the\n  comments with the text file for guidance. Most of the default\n  locations are likely fine, although FFMPEG is sometimes installed in\n  different folders depending on what the user might have selected.  \n- Download the additional **luts** files from this site and copy into\n  your FIJI/luts folder. These are palettes that are commonly used in\n  thermal imaging.\n- Download the perl script, **split.pl** from this site and copy into a\n  FIJI/scripts folder.\n- Download **Byte_Swapper.class** to the plugins folder.\n- Restart ImageJ.\n- If everything succeeded (see checks below), the toolset should be\n  installed and visible from your plugins menu.\n\n## Installation Checks\n\nVerify exiftool is installed by launching a terminal (or cmd prompt)\nwindow and typing the following bash commands:\n\n``` bash\nexiftool -ver\nwhich exiftool\n```\n\n    ## 12.62\n    ## /usr/local/bin/exiftool\n\nIf you see a version number (probably \\\u003e 10) and no error, then exiftool\nis installed properly. The second line will tell you the path to where\nit is installed.\n\nDo the same for perl:\n\n``` bash\nperl -ver\nwhich perl\n```\n\n    ## \n    ## This is perl 5, version 38, subversion 0 (v5.38.0) built for darwin-thread-multi-2level\n    ## \n    ## Copyright 1987-2023, Larry Wall\n    ## \n    ## Perl may be copied only under the terms of either the Artistic License or the\n    ## GNU General Public License, which may be found in the Perl 5 source kit.\n    ## \n    ## Complete documentation for Perl, including FAQ lists, should be found on\n    ## this system using \"man perl\" or \"perldoc perl\".  If you have access to the\n    ## Internet, point your browser at https://www.perl.org/, the Perl Home Page.\n    ## \n    ## /usr/local/bin/perl\n\nVerify no errors on your system to ensure perl is installed correctly.\n\nCheck that the perl script is accessible by perl (be sure to provide the\nproper path to the split.pl file on your system):\n\n``` bash\nperl /Applications/Fiji.app/scripts/split.pl\n```\n\nYou should see the following warning message:\n\n*“Error: Please specify input file, output folder, the output filename\nbase, pattern to split, and output file extension.”*\n\nThis is a good error, and verifies that the perl script is installed\nwhere your machine can access it!\n\nIf you see:\n\n*“Can’t open perl script”/Applications/Fiji.app/scripts/split.pl”: No\nsuch file or directory”*\n\nyou will need to re-check the location of the script or the path\ninformation provided at the top of the ThermImageJ.ijm file.\n\nNow, do the same for ffmpeg:\n\n``` bash\nffmpeg -version\nwhich ffmpeg\n```\n\n    ## ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers\n    ## built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)\n    ## configuration: --prefix=/usr/local/Cellar/ffmpeg/6.1.1_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox\n    ## libavutil      58. 29.100 / 58. 29.100\n    ## libavcodec     60. 31.102 / 60. 31.102\n    ## libavformat    60. 16.100 / 60. 16.100\n    ## libavdevice    60.  3.100 / 60.  3.100\n    ## libavfilter     9. 12.100 /  9. 12.100\n    ## libswscale      7.  5.100 /  7.  5.100\n    ## libswresample   4. 12.100 /  4. 12.100\n    ## libpostproc    57.  3.100 / 57.  3.100\n    ## /usr/local/bin/ffmpeg\n\n## Setting and verifying paths to command line tools\n\nOnce you have installed everything above, and verified no errors, you\ncan check or change the directory paths in FIJI/ImageJ.\n\nThe ThermImageJ.ijm toolset file will detect whether you are using Mac\nOSX, Linux or Windows and attempts to define the appropriate file paths\nautomatically. Thus, you should not need to change parameters, but it is\nuseful to check and become familiar with the process or do any\ncustomisation necessary for your FIJI installation.\n\nNavigate to the ThermImageJ.ijm toolset file and open it using a text\neditor or the built-in ImageJ macro editor:\n\n\u003cimg src=\"./images/ToolsetHeader.png\" width=\"100%\" /\u003e\n\nDepending on your operating system or how system files are installed you\nmay need to edit the specific path locations for your respective system:\n\n\u003cimg src=\"./images/UserPathCustomise.png\" width=\"80%\" /\u003e\n\nThis also applies to the location of the split.pl file that should be\nplaced in the scripts folder inside the Fiji folder.\n\nThermImageJ assumes you have placed the split.pl file into a scripts\nsubfolder where Fiji is installed, so hopefully you will not need to\nchange this:\n\n\u003cimg src=\"./images/UserSplitPathCustomise.png\" width=\"100%\" /\u003e\n\n## Setting ThermImageJ Macros Up in FIJI/ImageJ\n\nOnce you have installed everything above, and verified no errors, you\ncan set the macros up in FIJI/ImageJ.\n\nLaunch FIJI, left click the **more-tools menu**, which is the **\\\u003e\\\u003e**\non the far right side of the menu bar:\n\n\u003cimg src=\"./images/toolbar-before-install.png\" width=\"80%\" /\u003e\n\nWhich will reveal any of the toolsets in the folder. Click on\n**ThermImageJ** to replace the present icons with ThermImageJ specific\nicons / macros:\n\n\u003cimg src=\"./images/more-tools-toolsets-menu.png\" width=\"50%\" /\u003e\n\nOnce installed, the toolbar menu populates with new icons corresponding\nto the primary ThermImageJ functions:\n\n\u003cimg src=\"./images/toolbar-after-install.png\" width=\"100%\" /\u003e\n\nOnce installed, the toolset should also populate the **Plugin Dropdown\nMenu** with the same, and some additional macros used less often:\n\n\u003cimg src=\"./images/plugin-macro.png\" width=\"50%\" /\u003e\n\n## Customising the Toolset\n\nFeel free to edit your version of ThermImageJ.ijm and if you break it,\nyou can always download a new one.\n\nYou can edit it with any text editor or with the built-in ImageJ text\neditor by selecting Plugins–\\\u003eMacros–\\\u003eEdit and navigating to the\nFiji/macros/toolset folder and selecting the ThermImageJ file. Or from\nwithin ImageJ/Fiji, holding the shift key down, select the **\\\u003e\\\u003e**\n“More Tools” link and still hold the shift key down, click on\n**ThermImageJ** to open the file up within the built-in text editor.\n\nIf you do make changes and save them, you will either need to restart\nFiji, or restore the toolset bar by clicking on the **\\\u003e\\\u003e** “More\nTools” link, selecting **Restore Start-Up Tools** then clicking on the\n**\\\u003e\\\u003e** “More Tools” link and selecting **ThermImageJ** again.\n\n## Main Functions and Features\n\n### File Operations\n\n#### Direct Import of Raw Data\n\n- Raw Import Mikron RTV \u003cimg src='./images/ImportRTV.png'\u003e\n  - custom macro to import an old Mikron Mikrospec R/T video format\n  - these files had simple encoding and are not likely in use any\n    longer, except by the author\n  - see SampleFiles.zip for sample data\n- Raw Import FLIR SEQ \u003cimg src='./images/ImportSEQ.png'\u003e\n  - custom macro to import FLIR SEQ using the Import-Raw command\n  - use only if you know the precise offset byte start and the number of\n    bytes between frames (see Frame Start Byte Macro below).\n  - this only works for certain SEQ files (usually those captured to\n    computer), and only formats where tiff format underlies the video.\n  - see SampleFiles.zip for sample data\n- Frame Start Byte\n  - This macro will scan a FLIR video file (SEQ) for the offset byte\n    position ‘0200wwwwhhhh’ where wwww and hhhh are the image width and\n    height in 16-bit little endian hexadecimal.\n  - For example, the magicbyte for a 640x480 camera: 02008002e001”,\n    “8002” corresponds to 640 and “e001” corresponds to 480.\n  - The user can provide a custom magicbyte, but should leave this blank\n    otherwise.\n  - The function is only used in conjunction with the Raw Import FLIR\n    SEQ macro.\n  - The function returns best estimates for the offset and gap bytes\n    necessary for use with the Raw Import FLIR SEQ macro, although is\n    not guaranteed to be correct due to variances in SEQ file saving\n    convention.\n  - Note: on unix based OS, this macro calls the **xxd** executable and\n    runs quickly. For Windows OS, Powershell Core 6 needs to be\n    installed with the updated **Format-Hex** function, and runs slowly.\n\n#### Import (and Conversion) using Command-Line Programs\n\n- Convert FLIR JPG (from the Plugins-\\\u003eMacros Menu only)\n  - select a candidate JPG or folder of JPGs, and a call to the command\n    line tool, exiftool, is performed to extract the raw-binary 16 bit\n    pixel data, save this to a gray scale tif or png, placed into a\n    ‘converted’ subfolder.\n  - subsequently the user can import these 16-bit grayscale images and\n    apply custom transformations or custom Raw2Temp conversions.\n  - some images may be converted in reverse byte order due to FLIR\n    conventions. These can be fixed with the Byte Swapper plugin after\n    import.\n- Import FLIR JPG \u003cimg src='./images/ImportJPG.png'\u003e\n  - select a candidate JPG, and a call to the command line tool,\n    exiftool, is performed to extract the raw-binary 16 bit pixel data,\n    temporarily save this to a gray scale tif or png, import that file,\n    and calls the Raw2Temp function using the calibration constants\n    derived from the FLIR JPG file.\n- Import/Convert FLIR SEQ \u003cimg src='./images/ConvertSEQ.png'\u003e\n  - *Import*: select a candidate SEQ file, and a call to the command\n    line tools, exiftool, perl split.pl, and ffmpeg is performed to\n    extract each video frame (.fff) file, extract the subsequent\n    raw-binary 16 bit pixel data, save these as a series of gray scale\n    files, and collate these into an .avi file or a new folder of png or\n    tiff files. Subsequent .avi file is imported to ImageJ using the\n    Import-Movies (FFMPEG) import tool.\n  - jpegls as the output video codec is advised for its high\n    compression, lossless quality, and compatibility between different\n    OS versions of FFMPEG.\n  - this function may also work on FCF file types but has not been\n    thoroughly tested\n  - *Convert*: this function may also be used to convert the video into\n    a folder of png or tiff files by selecting png or tiff as the output\n    filetype, instead of avi. File codec is ignore if you choose this\n    approach. The folder will be automatically named according ot the\n    video file without extension. Thus, SampleVid.seq will be converted\n    to files in the folder called SampleVid.\n- Import/Convert FLIR CSQ \u003cimg src='./images/ConvertCSQ.png'\u003e\n  - *Import*: select a candidate CSQ file, and a call to the command\n    line tools, exiftool, perl split.pl, and ffmpeg is performed to\n    extract each video frame (.fff) file, extract the subsequent\n    raw-binary 16 bit pixel data, save these as a series of gray scale\n    files, and collate these into an .avi file or a new folder of png or\n    tiff files. Subsequent .avi file is imported to ImageJ using the\n    Import-Movies (FFMPEG) import tool.\n    - jpegls as the output video codec is advised for its high\n      compression, lossless quality, and compatibility between different\n      OS versions of FFMPEG.\n  - *Convert*: this function may also be used to convert the video into\n    a folder of png or tiff files by selecting png or tiff as the output\n    filetype, instead of avi. File codec is ignore if you choose this\n    approach. The folder will be automatically named according ot the\n    video file without extension. Thus, SampleVid.csq will be converted\n    to files in the folder called SampleVid.\n\n### Lookup tables and adjusting colour ranges\n\n\u003cimg src='./images/PaletteChoices.gif'\u003e\n\n\u003cbr\u003e\n\n- LUT (Thermal Palette Look Up Table) menu \u003cimg src='./images/LUT.png'\u003e\n  - for rapidly accessing different pseudocolour palettes\n  - Grays, Ironbow, and Rainbow are more commonly used in thermal\n    imaging\n  - ImageJ’s built in LUTs can be always be accessed from the\n    Image-Lookup Tables Menu\n- Next LUT \u003cimg src='./images/NextLUT.png'\u003e\n  - select the next LUT in the list of all ImageJ LUTs, including the\n    ones in the Thermal LUT list\n- Previous LUT \u003cimg src='./images/PreviousLUT.png'\u003e\n  - select the previous LUT in the list all ImageJ LUTs, including the\n    ones in the Thermal LUT list\n- Invert LUT \u003cimg src='./images/InvertLUT.png'\u003e\n  - invert the colour scale of the LUT\n  - this can be toggled\n- Brightness/Contrast \u003cimg src='./images/BrightContrast.png'\u003e\n  - setting the min and max values of the pseudocolour scale\n  - set min equal to the lowest temperature desired on the lookup table\n    scale\n  - set max equal to the highest temperature desired on the lookup table\n    scale\n- Add Calibration bar \u003cimg src='./images/CalBar.png'\u003e\n  - short-cut to ImageJ’s built-in Analyze-\\\u003eTools-\\\u003eCalibration Bar\n  - use this after temperature conversion of image\n  - the tool attempts to choose an appropriate sized calibration bar by\n    auto-adjusting the zoom factor\n  - to save this permanently on an image you need to duplicate and/or\n    convert your image to RGB format (Image–\\\u003eType-\\\u003eRGB Color), then\n    flatten the overlay (Image–\\\u003eOverlay–\\\u003eFlatten), then save as a tiff\n    or png. Note: the resolution of the text on the calibration bar\n    depends on your image size and be be unsatisfactory with small\n    images. If I find a fix for this, I will implement it.\n\n### Bits and Bytes\n\n- Image Byte swap \u003cimg src='./images/ByteSwap.png'\u003e\n  - short-cut call to the Byte Swapper plugin.\n  - since FLIR files are sometimes saved using little endian order\n    (tiff) and big endian order (png), a short-cut to a pixel byte swap\n    is a fast way to repair files once they are imported that have byte\n    order mixed up\n\n### Utilities\n\n- FLIR Dates \u003cimg src='./images/DateTime.png'\u003e\n  - user selects a candidate FLIR file (jpg, seq, csq) to have the\n    Date/Time Original returned. Use this to quickly scan a file for\n    capture times.\n- FLIR Calibration Values \u003cimg src='./images/FLIRSettings.png'\u003e\n  - select a candidate FLIR file (jpg, seq, csq) to display the\n    calibration constants and built-in object parameters stored at image\n    capture. Typically, the user would then use the Planck constants and\n    Object Paramters in the Raw2Temp macro.\n  - use this function on the original FLIR file if you have a 16-bit\n    grayscale image of the raw data in a separate file and need to\n    convert to temperature under specified conditions.\n  - the calibration constants and object parameters are stored in memory\n    for subsequent use of the Raw2Temp function, and should be\n    remembered the next time you re-boot ImageJ, so if you are only\n    working with one thermal camera’s files, you should not have to\n    re-type the calibration constants for future uses.\n\n### Temperature Conversion\n\n- Raw2Temp \u003cimg src='./images/Raw2Temp.png'\u003e\n  - converts a 16-bit grayscale thermal image (or image stack) into\n    estimated temperature using standard equations used in infrared\n    thermography.\n  - user must provide the camera calibration constants, atmospheric\n    attenuation constants, and object parameters that can be obtained\n    using the FLIR Calibration Values macro.\n  - various custom versions of Raw2Temp are included for different\n    cameras the author has used, since the calibration constants do not\n    change from image to image, and only when the camera is sent back to\n    manufacturer for re-calibration. Edit these macros once calibration\n    constants are known for other cameras.\n  - a Fast and Slow calculation have now been implemented (v 1.4.1).\n  - The Slow calculation is slow because it converts the file to a\n    32-bit file and then converts each pixel to its calculated\n    temperature. This can take time on video files and may be too much\n    for large files or computers with little RAM.  \n  - The Fast calculation implements a built-in ImageJ function that\n    allows us to fit a 4th order polynomial through the relationship\n    between Temperature and the Raw 16 bit data, providing a\n    pseudo-converted file with both raw data and converted data showing\n    up in the imageJ status bar. This may or may not be an accurate\n    depiction of the response, although I provide the user with\n    cautionary advice on the numbers returned. If you restrict the range\n    of temperatures to fit the polynomial only to reasonable ones for\n    most biological applications, the error seems to be quite low since\n    the polynomial accurately fits the data. It is mainly at the\n    extremely low and high ends of the camera’s temperature range that\n    the fit is poor. For single image analysis, I advise you use the\n    Slow (accurate) conversion, and only consider the Fast conversion\n    for large videos where some trade-off between CPU time vs. accuracy\n    is more crucial.\n\n### ROI (Region of Interest) Tools\n\n- ROI 1 to ROI 6 (from the Plugins-\\\u003eMacros menu)\n  - macros coded to short-cut keys, such as: 1,2,3,4,5,6 by adding \\[#\\]\n    to the name of the macro in the ThermImageJ.ijm file\n  - some extra ROI short-cuts (i.e. d, l) might exist that I have in\n    place for my own analyses - you can ignore these line ROIs\n  - extracts mean, min, max, sd, and area of the given ROI and saves to\n    results window as well as to a ROI_Results.csv file to user’s\n    desktop\n  - location of ROI_Results.csv file can be changed by user by editting\n    the variable desktopdir at the top of the ThermImageJ.ijm file\n  - sample results file:\n    \u003chttps://github.com/gtatters/ThermImageJ/blob/master/ROI_Results.csv\u003e\n  - edit the ThermImageJ.ijm to change the nature of the results to\n    extract\n  - addition ROIs can be added to the toolset file\n  - designed to work with single images or image stacks\n  - slice label and number are recorded to the results table as:\n\n\u003cimg src='./images/ROI_Results.csv.png'\u003e\n\n### Other ROI tools\n\n- Extract ROI Pixel Values (short-cut: p)\n  - extracts the ROI pixel values to a results window table with\n    X,Y,Value coordinates\n  - useful if you want to replot only your ROI data in another software\n    environment\n  - useful if you need to perform different analyses on the data\n  - based on a macro from\n    \u003chttp://imagej.1557.x6.nabble.com/Extracts-individual-pixel-values-from-a-selection-or-RIO-td5020121.html\u003e\n- Add ROI Measurement to Image\n  - adds the result of the ROI parameter to the image as an overlay.\n  - will work on stacks or single images.\n\n### Math on Stacks\n\n- ROI on Entire Stack\n  - performs an ROI analysis across the entire stack.\n  - min, max, mean, median, mode, skewness, kurtosis for every slice are\n    exported to the results window and to file to desktop\n  - select what summary statistic to perform discrete fourier analysis\n    to extract dominant frequency components.\n  - i have tested this on oscillatory data (metronomes set to move at\n    fixed rates) and the fourier extracted frequencies appear to work\n    correctly\n- Cumulative Difference Sum on Stack (in progress)\n  - This function works on stacks, first by subtracting the difference\n    in pixel values between frames, creating an absolute value\n    difference stack n-1 frames in length.\n  - Then all pixels from each frame are examined for the mean and\n    standard deviation per frame, stored to the results window, after\n    which a cumulative value is calculated.\n  - This cumulative absolute difference value is then detrended and\n    zeroed to remove mean value offset prior to a discrete fourier\n    analysis to return freuquency components.\n  - The user should provide time interval in seconds for the image\n    stack.\n\n## Typical Workflow\n\n### Converted JPG to raw 16-bit PNG or TIFF Workflow\n\n- Determine your FLIR camera’s calibration constants (i.e. use the\n  Calibration Values Tool)\n- Convert Image to a 16-bit Grayscale File (i.e. Convert FLIR JPG)\n- Import converted file to ImageJ using normal ImageJ file recognition.\n  File-\\\u003eOpen or File-\\\u003eImport Image Sequence can work on PNG and TIFF\n  files.\n- You may prefer to work with TIFF files, but the filetype created by\n  these macros depends on how the raw data were stored by FLIR (PNG or\n  TIFF). If so, you might use ImageJ’s batch conversion tool to convert\n  your files before importing them.\n- Run the FLIR Calibration values macro on the original FLIR file in\n  order to extract the calibration constants into memory\n- Run Raw2Temp or one of the custom Raw2Temp macros for your particular\n  camera\n- Choose your palette (LUT in ImageJ)\n- Use ImageJ ROI tools and Measurement tools\n\n### Single JPG Workflow\n\n- Use the Import JPG tool which will scan the file for calibration\n  constants, extract the raw thermal image, convert this to a PNG or\n  TIFF file, and automatically open it.\n- Inspect the opened image, calibration constants, and object parameters\n  to ensure that these values are appropriate to your application.\n- Choose your palette (LUT in ImageJ)\n- Use ImageJ ROI tools and Measurement tools\n\n### Video Workflow\n\n- Use the Import SEQ or Import CSQ functions that scan the file to\n  determine calibration constants before import\n- Select the video import option and jpegls as the codec (i.e. the\n  defaults) This will keep file size as small as possible and preserves\n  compatibility with the ImageJ FFMPEG implementation\n- The Import SEQ and Import CSQ macros will automatically attempt to\n  calculate temperature\n- Once the file is converted and imported, double check that the\n  calibration constants and object parameters are appropriate and select\n  ok. If you escape at this stage, you should still have a 16-bit\n  grayscale image stack, and could run the Raw2Temp function later\n\n## Custom ROI analysis\n\n- First set the parameters you are interested in extracting in the\n  Analyze-\\\u003eSet Measurements menu.  \n- Typical values are min, max, mean, modal, median, standard deviation,\n  but ImageJ offers so many other values.\n- In ImageJ terminology, “Intensity” or “Gray Value” corresponds to the\n  number stored in each pixel. This might be the 16-bit raw value or it\n  might be the 32-bit decimal converted temperature, depending on when\n  analysis is performed.\n- Take advantage of all the ImageJ ROI tools, or Tools-\\\u003eROI Manager to\n  draw regions of interest over sites of interest.\n- Or, use the ROI 1-6 macros included as described earlier in the\n  document.\n\n## Sample files to test:\n\n\u003chttps://github.com/gtatters/ThermImageJ/blob/master/SampleFiles.zip\u003e\n\n## Video Guide: Installation\n\nSee this screen capture introducing the basic installation steps.\n\u003chttps://youtu.be/8SXhzOlsmKI\u003e\n\n## Video Guide: Demonstration of Functions\n\nSee this screen capture demonstrating basic functions here:\n\u003chttps://youtu.be/5XYZw0kqX64\u003e\n\n## Performance, Speed, File Size Limits, and Caveats\n\n- The maximum number of video frames (i.e. stacks) will limited by the\n  CPU and RAM, but success with videos and image stacks of up to ~1000\n  frames has been tested.\n- Due to memory limits in FIJI, delay converting larger video files to\n  temperature until the files have been otherwise processed. The memory\n  required to work with converted files (32-Bit) is double that required\n  to work with the 16-bit grayscale images. Or consider using the Fast\n  option in the Raw2Temp function, which will create a virtual\n  conversion that is usually quite close to the real data for normal\n  biological temperatures.\n- Consider cropping videos, re-sampling fewer stacks if you have\n  oversampled videos, or performing ROI analyses on the 16-bit raw data\n  and then calculate temperature using the raw2temp function also\n  available in an R package (Thermimage).\n- If you have large video files (\\\u003e2000 frames and high resolution), it\n  is advisable to convert these videos to folders of png files, and use\n  the File –\\\u003e Import –\\\u003e Image Sequence tool to skip files during\n  import as a way of down-sampling.\n- Finally, verify that the temperature values obtained with these macros\n  are similar to the ones obtained using official thermal imaging\n  software. See \u003chttps://github.com/gtatters/ThermimageCalibration\u003e for\n  details on performance accuracy (±0.04C), but a healthy skepticism is\n  advised. Please post in the issues if you do suspect the Raw2Temp\n  conversions are not consistent with expectations.\n\n## File Types\n\n- The radiometric file types at present supported are mainly those from\n  FLIR, however certain file types that can be imported into ImageJ\n  could be used in the future, depending on information from users.\n  Deciphering the radiometric data storage approaches takes time and\n  requires sample files.\n\n- For a discussion about the Babylonian nature of thermal image file\n  types and strategies employed by thermal camera manufacturers see\n  \u003chttps://www.irinfo.org/04-01-2006-colbert/\u003e\n\n## References\n\nThe following open source programs were crucial to the development of\nThermImageJ.\n\n- Thermimage: \u003chttps://github.com/gtatters/Thermimage\u003e\n\n- Exiftool: \u003chttp://www.sno.phy.queensu.ca/~phil/exiftool/\u003e\n\n- Perl: \u003chttp://www.perl.org\u003e\n\n- Discussions on the raw to temperature conversion:\n  \u003chttp://u88.n24.queensu.ca/exiftool/forum/index.php?topic=4898.135\u003e\n\n- Discussions on the file formats:\n  \u003chttps://www.eevblog.com/forum/thermal-imaging/csq-file-format/\u003e\n\n## Contributors\n\nImageJ Macro Development occurred in association with:\n\n- Joshua Robertson (\u003chttps://github.com/joshuakrobertson\u003e)\n\nCommand Line Development occurred in assocation with:\n\n- Ruger Porter\n  (\u003chttps://www.ohio.edu/medicine/about/directory/profiles.cfm?profile=porterw1\u003e)\n\nRaw2Temp development occurred in association with:\n\n- Ray Danner (\u003chttps://github.com/raydanner\u003e)\n\n## Suggestions/Issues/Caveats\n\n- Suggestions for improvements and additions, as well as bugs or issues\n  can be filed here: \u003chttps://github.com/gtatters/ThermImageJ/issues\u003e\n\n- Please include a sample image to help with solving issues\n\n- Please star or follow this github site to keep up to date on new\n  releases as I fix errors following further testing.\n\n- ThermImageJ will still remain a work in progress as I add features\n  that are useful to myself, but might not be readily apparent to other\n  users. Occasional odd short-cuts that are present are likely the\n  result of a project I am currently working on.\n\n- Note: I have no affiliation with thermal image companies nor do I\n  receive any funding or free equipment despite the plethora of\n  customers I have sent to them. This project emerged as a result of the\n  frustration of needing to use Windows only software that has limited\n  journaling and customisation. I should acknowledge that in July 2019,\n  FLIR released a more affordable cross-platform analysis software that\n  some users may prefer to invest in rather than this open source\n  solution. It would be unfair of me to not recommend that you try their\n  software first, since they are the experts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtatters%2FThermImageJ","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtatters%2FThermImageJ","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtatters%2FThermImageJ/lists"}