gtatters / ThermImageJ

ImageJ functions and macros for working with thermal image files
Other
44 stars 6 forks source link
exiftool ffmpeg fiji fiji-macro heat-transfer imagej imagej-macro perl temperature-reading thermal-imaging

ThermImageJ - Thermal Image Functions and Macros for ImageJ

ThermImageJ is a collection of ImageJ functions and macros to allow for import and conversion of thermal image files and to assist in extracting raw data from infrared thermal images and converting these to temperatures using standard equations in thermography.

These macros will allow you to import most FLIR jpgs and videos and process the images in ImageJ.

ThermImageJ emerged from Thermimage (https://github.com/gtatters/Thermimage), the latter an R package with similar tools but more emphasis on biological heat transfer analysis.

Compatibility

How to Cite

Requirements

External Software Downloads

ThermImageJ Downloads from this Github site

Installation Instructions

Installation Checks

Verify exiftool is installed by launching a terminal (or cmd prompt) window and typing the following bash commands:

exiftool -ver
which exiftool
## 12.62
## /usr/local/bin/exiftool

If you see a version number (probably > 10) and no error, then exiftool is installed properly. The second line will tell you the path to where it is installed.

Do the same for perl:

perl -ver
which perl
## 
## This is perl 5, version 38, subversion 0 (v5.38.0) built for darwin-thread-multi-2level
## 
## Copyright 1987-2023, Larry Wall
## 
## Perl may be copied only under the terms of either the Artistic License or the
## GNU General Public License, which may be found in the Perl 5 source kit.
## 
## Complete documentation for Perl, including FAQ lists, should be found on
## this system using "man perl" or "perldoc perl".  If you have access to the
## Internet, point your browser at https://www.perl.org/, the Perl Home Page.
## 
## /usr/local/bin/perl

Verify no errors on your system to ensure perl is installed correctly.

Check that the perl script is accessible by perl (be sure to provide the proper path to the split.pl file on your system):

perl /Applications/Fiji.app/scripts/split.pl

You should see the following warning message:

“Error: Please specify input file, output folder, the output filename base, pattern to split, and output file extension.”

This is a good error, and verifies that the perl script is installed where your machine can access it!

If you see:

“Can’t open perl script”/Applications/Fiji.app/scripts/split.pl”: No such file or directory”

you will need to re-check the location of the script or the path information provided at the top of the ThermImageJ.ijm file.

Now, do the same for ffmpeg:

ffmpeg -version
which ffmpeg
## ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
## built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
## 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
## libavutil      58. 29.100 / 58. 29.100
## libavcodec     60. 31.102 / 60. 31.102
## libavformat    60. 16.100 / 60. 16.100
## libavdevice    60.  3.100 / 60.  3.100
## libavfilter     9. 12.100 /  9. 12.100
## libswscale      7.  5.100 /  7.  5.100
## libswresample   4. 12.100 /  4. 12.100
## libpostproc    57.  3.100 / 57.  3.100
## /usr/local/bin/ffmpeg

Setting and verifying paths to command line tools

Once you have installed everything above, and verified no errors, you can check or change the directory paths in FIJI/ImageJ.

The ThermImageJ.ijm toolset file will detect whether you are using Mac OSX, Linux or Windows and attempts to define the appropriate file paths automatically. Thus, you should not need to change parameters, but it is useful to check and become familiar with the process or do any customisation necessary for your FIJI installation.

Navigate to the ThermImageJ.ijm toolset file and open it using a text editor or the built-in ImageJ macro editor:

Depending on your operating system or how system files are installed you may need to edit the specific path locations for your respective system:

This also applies to the location of the split.pl file that should be placed in the scripts folder inside the Fiji folder.

ThermImageJ assumes you have placed the split.pl file into a scripts subfolder where Fiji is installed, so hopefully you will not need to change this:

Setting ThermImageJ Macros Up in FIJI/ImageJ

Once you have installed everything above, and verified no errors, you can set the macros up in FIJI/ImageJ.

Launch FIJI, left click the more-tools menu, which is the >> on the far right side of the menu bar:

Which will reveal any of the toolsets in the folder. Click on ThermImageJ to replace the present icons with ThermImageJ specific icons / macros:

Once installed, the toolbar menu populates with new icons corresponding to the primary ThermImageJ functions:

Once installed, the toolset should also populate the Plugin Dropdown Menu with the same, and some additional macros used less often:

Customising the Toolset

Feel free to edit your version of ThermImageJ.ijm and if you break it, you can always download a new one.

You can edit it with any text editor or with the built-in ImageJ text editor by selecting Plugins–>Macros–>Edit and navigating to the Fiji/macros/toolset folder and selecting the ThermImageJ file. Or from within ImageJ/Fiji, holding the shift key down, select the >> “More Tools” link and still hold the shift key down, click on ThermImageJ to open the file up within the built-in text editor.

If you do make changes and save them, you will either need to restart Fiji, or restore the toolset bar by clicking on the >> “More Tools” link, selecting Restore Start-Up Tools then clicking on the >> “More Tools” link and selecting ThermImageJ again.

Main Functions and Features

File Operations

Direct Import of Raw Data

Import (and Conversion) using Command-Line Programs

Lookup tables and adjusting colour ranges


Bits and Bytes

Utilities

Temperature Conversion

ROI (Region of Interest) Tools

Other ROI tools

Math on Stacks

Typical Workflow

Converted JPG to raw 16-bit PNG or TIFF Workflow

Single JPG Workflow

Video Workflow

Custom ROI analysis

Sample files to test:

https://github.com/gtatters/ThermImageJ/blob/master/SampleFiles.zip

Video Guide: Installation

See this screen capture introducing the basic installation steps. https://youtu.be/8SXhzOlsmKI

Video Guide: Demonstration of Functions

See this screen capture demonstrating basic functions here: https://youtu.be/5XYZw0kqX64

Performance, Speed, File Size Limits, and Caveats

File Types

References

The following open source programs were crucial to the development of ThermImageJ.

Contributors

ImageJ Macro Development occurred in association with:

Command Line Development occurred in assocation with:

Raw2Temp development occurred in association with:

Suggestions/Issues/Caveats