Profile Tools is a plugin dedicated for profile processing and analyzing in ImageJ. Profile Tools is accessible via both ImageJ GUI and macro.
Highlights of the current version:
Profile Tools requires Java Embedded Python (Jep) and Numpy to run Python scripts.
Prerequisite
Before installing Jep, make sure the following are completed.
Setup Java Embedded Python (Jep)
Install Jep (e.g. install Jep using pip install
)
Detailed installation instructions can be found on Jep github repo.
Add Jep to PATH environment variable (Tip: use pip show
to display the Jep package location if Jep was installed using pip)
Install Profile Tools
Copy ProfileTools_.jar and the Jep JAR packages to the ImageJ plugin directory.
Restart ImageJ
Java SE 1.8
Jep 4.0.6
Python 3.10.6
Numpy 1.23.6
Scipy 1.9.0
Profile tools currently supports three types of python scripts:
Python script with a single profile plot as input and a single profile plot as output
To run such a python script, pt_single_plot_to_single_plot
function is required to be defined in the python script and the profile processing pipeline should be included in the body of the function.The first and second input arguments are X- and Y-axis data from the input ImageJ profile plot. The return value of this function should be a tuple containing X-axis and Y-axis data for the result profile plot. All X- and Y-axis data for input and output profile plots are 1-dimensional Numpy arrays. You may add more input arguments in the function definition but please make sure to use Python 3 type hint to specify the input argument type. Currently int, float, bool, and str are supported by Profile Tools. Profile Tools will automatically generate ImageJ GUI and macro interface according to the function definition. The variable names in the ImageJ interface will be the names of the input arguments defined in the python function. The result will be displayed as an ImageJ plot.
Please check ProfileOffset.py and ProfileOffsetMacro.ijm in the /examples/PythonScript directory for examples.
Python script with a single profile plot as input and a single value as output
To run such a python script, pt_single_plot_value
function is required to be defined in the python script and the profile processing pipeline should be included in the body of the function.The first and second input arguments are X- and Y-axis data from the input ImageJ profile plot. And the return value should be a value (of any type that can be converted into string). All the X- and Y-axis data for input profile plots are 1-dimensional numpy arrays. You may add more input arguments in the function definition but please make sure to use Python 3 type hint to specify the input argument type. Currently int, float, bool, and str types are supported by Profile Tools. Profile Tools will automatically generate ImageJ GUI and macro interface according to the function definition. The variable names in the ImageJ interface will be the names of the input arguments defined in the python function. The result plot will be displayed in the Log window of ImageJ.
Please check ProfileMean.py and ProfileMeanMacro.ijm in the examples/PythonScript directory for examples.
Python script with two profile plots as input and a single profile plot as output
To run such a python script, pt_double_plot_to_single_plot
function is required to be defined in the python script and the data processing pipeline should be included in the body of the function.The first and second input arguments are X- and Y-axis data from the first input ImageJ profile plot.The third and fourth input arguments are X- and Y-axis data from the second input ImageJ profile plot. And the return value of this function should be a tuple containing X- and Y-axis data for the result profile plot. All the X- and Y-axis data for input and output profile plots are 1-dimensional numpy arrays. You may add more input arguments in the function definition but please make sure to use Python 3 type hint to specify the input argument type. Currently only int, float, bool, and str types are supported by Profile Tools. Profile Tools will automatically generate ImageJ GUI and macro interface according to the function definition. The variable names in the ImageJ interface will be the names of the input arguments defined in the python function. The result plot will be displayed as an ImageJ plot.
Please check ProfileWeightedSum.py and ProfileWeightedSumMacro.ijm in the examples/PythonScript directory for examples.
ImageJ macro examples
Python script examples
I welcome comments, suggestions, bug reports, etc.
Jian Zhong