Coder Social home page Coder Social logo

clij2's Introduction

CLIJ: GPU-accelerated image processing for everyone


CLIJ is deprecated. Visit the CLIJ2 website to learn more.


Introduction

CLIJ is an OpenCL - ImageJ bridge and a Fiji plugin allowing users with entry-level skills in programming to build GPU-accelerated workflows to speed up their image processing. Increased efforts were put on documentation, code examples, interoperability, and extensibility. CLIJ is based on ClearCL, JOCL, Imglib2, ImageJ and SciJava.

If you use CLIJ, please cite it:

Robert Haase, Loic Alain Royer, Peter Steinbach, Deborah Schmidt, Alexandr Dibrov, Uwe Schmidt, Martin Weigert, Nicola Maghelli, Pavel Tomancak, Florian Jug, Eugene W Myers. CLIJ: GPU-accelerated image processing for everyone. Nat Methods 17, 5โ€“6 (2020) doi:10.1038/s41592-019-0650-1

Older version in BioRxiv

If you search for support, please open a thread on the image.sc forum.

Image.sc forum

Overview

Acknowledgements

Development of CLIJ is a community effort. We would like to thank everybody who helped developing and testing. In particular thanks goes to Alex Herbert (University of Sussex), Bram van den Broek (Netherlands Cancer Institute), Brenton Cavanagh (RCSI), Brian Northan (True North Intelligent Algorithms), Bruno C. Vellutini (MPI CBG), Curtis Rueden (UW-Madison LOCI), Damir Krunic (DKFZ), Daniel J. White (GE), Gaby G. Martins (IGC), Guillaume Witz (Bern University), Siรขn Culley (LMCB MRC), Giovanni Cardone (MPI Biochem), Jan Brocher (Biovoxxel), Jean-Yves Tinevez (Institute Pasteur), Johannes Girstmair (MPI CBG), Juergen Gluch (Fraunhofer IKTS), Kota Miura, Laurent Thomas (Acquifer), Matthew Foley (University of Sydney), Matthias Arzt (MPI-CBG), Nico Stuurman (UCSF), Peter Haub, Pete Bankhead (University of Edinburgh), Pradeep Rajasekhar (Monash University), Ruth Whelan-Jeans, Tanner Fadero (UNC-Chapel Hill), Thomas Irmer (Zeiss), Tobias Pietzsch (MPI-CBG), Wilson Adams (VU Biophotonics)

R.H. was supported by the German Federal Ministry of Research and Education (BMBF) under the code 031L0044 (Sysbio II) and D.S. received support from the German Research Foundation (DFG) under the code JU3110/1-1. P.T. was supported by the European Regional Development Fund in the IT4Innovations national supercomputing center-path to exascale project, project number CZ.02.1.01/0.0/0.0/16_013/0001791 within the Operational Programme Research, Development and Education.

Imprint

clij2's People

Contributors

haesleinhuepf avatar iwbh15 avatar lguerard avatar lpuoo avatar maarzt avatar mmongy avatar ruthhwj avatar schmiedc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clij2's Issues

Error message after installation

(Fiji Is Just) ImageJ 2.3.0/1.53f51; Java 1.8.0_202 [64-bit]; Mac OS X 10.14.6; 277MB of 8916MB (3%)
 
java.lang.NoClassDefFoundError: net/haesleinhuepf/clij/macro/CLIJMacroPlugin
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at ij.macro.Functions.call(Functions.java:4519)
	at ij.macro.Functions.getStringFunction(Functions.java:276)
	at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
	at ij.macro.Interpreter.getString(Interpreter.java:1453)
	at ij.macro.Interpreter.doStatement(Interpreter.java:333)
	at ij.macro.Interpreter.doStatements(Interpreter.java:264)

After enabling the clij2 update site.

altitude map of extended depth of focus projection

dear Robert,
this is a sticky note following our discussion at the NEUBIAS course.

it would be great if the "extended depth of focus projection" of CLIJ2 could output not only the "focused" image but also the "altitude" of the best focus. this would allow to process the image on the dapi channel for instance and then apply the best focus to other channels.

many many thanks!
Benoit

IJM Markdown

Hi Robert,
I like your IJM Markdown option. Running this on a different computer but I do not see this option. How do I get this option to show?

Thank you.
Picture1

Request new CLIJ2_paste3D function

Hi Robert,

I hope this message find you well. A member of my team, Marcel Boeglin, has been playing with CLIJ and has asked me to forward his request. Also attached two macros: 1- CPU processing, 2- CLIJ processing with requested new CLIJ function on line 123. He wanted to use CLIJ2_paste3D to process a stack in the GPU and then pull it on the CPU but the result cannot be currently pulled into an existing CPU stack.

Marcel is wondering if it will be possible to create a function like:
Ext.CLIJ2_pull(GPU_Image3D, CPU_ImageStack_ID, Number_Offset)

  • where offset is the slice from which to copy GPU_image3D into CPU_ImageStack
  • where CPU_ImageStack_ID is the image ID of CPU_ImageStack created in ImageJ with the correct width, height and bitdepth.

Best wishes

Bertrand

ImageJ_ExtractRegion3D_toHyperstack_02.txt
ImageJ_ExtractRegion3D_toHyperstack_02_CLIJ2annotations.txt

CLIJx-Assistant

I'm trying to segment my image using the Top Hat Box filter (and some others). I tried to change the radius but nothing seems to change in the image? Why?
Also does red mean it's still processing and when its done the box turns green?
It didn't do anything with the big image so I tried to crop a small one (29MB) still the same.
image

Reusable object classification

@haesleinhuepf
Could you point me to part of your code where you do the object classification in CLIJ?
I was wondering whether we could factor this out into an own repository such that it becomes easier reusable, e.g. for feature tables generated with MorpholibJ and the annotations coming from somewhere else (e.g. the Segmentation Annotator).
(cc @iarganda)

CL_MEM_OBJECT_ALLOCATION_FAILURE on laptop with integrated AND dedicated graphics

clij_problem_exception.txt
clij_problem_info.txt
clij_problem.csv.txt

clij_problem

Hello!

I'm experiencing an issue with, i guess, GPU RAM usage.
I tried to run a clij2 gaussian filter, radius x30y30 on a rather large stack of approx 2359x2363x163 16 bit, 1.7GB, but got an OpenCL error: -4 -> CL_MEM_OBJECT_ALLOCATION_FAILURE

It might be because I'm running a gaming laptop with, both, an integrated GPU, and a dedicated GPU. Maybe clij gets confused by the readouts.
It's an Asus TUF FX705 with an AMD Ryzen 7 3750H and an NVidia GeForce GTX 1660 Ti 6 GB GDDR6.

I tried to include all the information in the screenshot, but forgot the clij versions. I installed it today via FIJI update sites:
clij 1.7.5.1
clij2 2.2.0.11
clijx 0.30.1.0
ImageJ 1.53c

I can easily reproduce the error, in case you need more information.

Thank you!
Christian

p.s.: CLIJ is crazy! I'm also looking forward to clesperanto, especially for Python! I'm still trying to make the prototype work on my computer (edit: It works now! It's nice :) ).

edit: Now with text-files

AMD issue

Dear future-self, dear AMD fans,

I have a script crashing an AMD based machine. The screen turns black and the computer has to be restarted. The affected system is a Ryzen 3700U CPU / Vega 10 GPU. The same script runs fine on a Ryzen 2300U / Vega 6 and Ryzen 4700U / Vega 7. Driver update doesn't help and "wait(1000);" commands also don't help. The crash is reproducibly happening with the same script but at different positions. I'm carefully suspecting hardware related issues.
Will attach the script and corresponding log files down here:

What should be the input format?

Hi,

I'm using the Java API(from Scala), and it's getting really hard to obtain a result other that a black image out of any of the transformations that I've tried.
What should be the input format for the images? I've tried all sort of images including grayscale 8-bit images, with no success.
The situation changes when I pull the image from the GPU using pullBinary() instead of pull(). This is my code,

// init CLIJ and GPU
import net.haesleinhuepf.clij2.CLIJ2
import net.haesleinhuepf.clij.clearcl.ClearCLBuffer
val clij2 = CLIJ2.getInstance()

val inputImagePlus = new ImagePlus("pepinito", bi)
inputImagePlus.show()
val input = clij2.push(inputImagePlus)
val destination = clij2.create(input)
val number_of_erotions_and_dilations = 1

clij2.openingBox(input, destination, number_of_erotions_and_dilations)

val destinationImagePlus = clij2.pull(destination)

// show result ===>>> this one won't work
destinationImagePlus.show()

// show result ===>>> this one will work like a charm!
clij2.show(destination, "output")

// cleanup memory on GPU
clij2.release(input)
clij2.release(destination)

I tried all sort of images for the 'bi' BufferedImage.

Still, I would like at least a grayscale image as output, not a binary one.
@haesleinhuepf

SphereTransform: center coords are not relative

The arguments to SphereTransform are called relative_center_{xyz}, but the call to ReslicePolar.reslice is performing translation in pixel units, without any normalization:

ReslicePolar.reslicePolar(clij2, pushed, result,
delta_angle_in_degrees, 0f, 0f,
relative_center_x, relative_center_y, relative_center_z,
1f, 1f, 1f,
0f, 0f, 0f,
0f, 0f, 0f);

public static boolean reslicePolar(CLIJ2 clij2, ClearCLBuffer src, ClearCLBuffer dst, Float deltaAngle, Float startInclinationDegrees, Float startAzimuthDegrees, Float centerX, Float centerY, Float centerZ, Float scaleFactorX, Float scaleFactorY, Float scaleFactorZ,
float translation_x, float translation_y, float translation_z, float rotation_x, float rotation_y, float rotation_z) {

I'd suggest to either rename the arguments to center_{xyz}, or to (re-)introduce some normalization to image dimensions before that call.

Feature Request: Rotate 3D on hyperstacks

I'd like to request a feature in future CLIJ versions that performs a 3D rotation on the XYZ data of a multi-dimensional hyperstack. Basically, perform a 3D rotation at each channel, timepoint, position, etc. And then return a rotated stack with the same number of dimensions as the input hyperstack.

I originally posted about this on image.sc here.

connectedComponentsLabeling - Diamond yields Box results

Howdy!

Just a heads up - I was playing around with the connectedComponentsLabeling algorithms yesterday and noticed that the Diamond and Box algorithms both yielded the Box result. This was true for all of the different functions in CLIJ (CLIJ2, CLIJx, etc.). I'm assuming both are running the same code.

Pixel calibration

Hi,

It seems that the plugins does not carry pixel calibration from the input image to the processed image, I tested with 3D Median in a sphere.

Best,

Thomas

Linear interpolation doesn't work on Intel GPUs

Affine transform uses OpenCL interpolation (CLK_FILTER_NEAREST) which is apparently not supported, or not functional.

This bug is reproducible using this macro:

run("T1 Head (16-bits)");
run("Duplicate...", " ");

transform = "-center rotate=45 center";

run("CLIJ2 Macro Extensions", "cl_device=[Intel(R) UHD Graphics 620]");
Ext.CLIJ2_clear();

image = getTitle();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();

run("CLIJ2 Macro Extensions", "cl_device=[Quadro P520]");
Ext.CLIJ2_clear();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();

image

Thanks to Johannes Girstmair for reporting!

CLIJ issue in applying non local means filter on GPU

Hello, I am trying to apply non local means filter on my 3D CT images which are 1GB files. I have GPU rtx 2080 with 8GB memory installed and CLIJ GUI shows right GPU. But when I try to apply this filter, it says,

package net.haesleinhuepf.clij2.plugins, clij2_, version 0.0
Overwriting image in cache.
CLIJ2 Warning: You're creating an image with size 3.6 gigabytes, which exceeds your GPUs capabilities (max 2.0 gigabytes).
package net.haesleinhuepf.clijx.plugins, clijx_, version 0.0
CLIJ2 Warning: You're creating an image with size 3.6 gigabytes, which exceeds your GPUs capabilities (max 2.0 gigabytes).
CLIJ2 Warning: You're creating an image with size 3.6 gigabytes, which exceeds your GPUs capabilities (max 2.0 gigabytes).
CLIJ Error: Creating an image or kernel failed because your device ran out of memory.
You can check memory consumption in CLIJ2 by calling these methods from time to time and see which images live in memory at specific points in your workflow: Ext.CLIJ2_reportMemory(); // ImageJ Macro print(clij2.reportMemory()); // Java/groovy/jythonFor support please contact the CLIJ2 developers via the forum on https://image.sc .
Therefore, please report the complete error message, the code snippet or workflow you were running, an example image if possible and details about your graphics hardware.

Am I making a mistake or there is some bug in here? Can anyone comment on this please?

statisticsOfLabelledPixels suggestion

Hello,

I just wanted to suggest the addition of a column called Name_Input and Name_LabelMap so that it is easy to figure out the origin of the results.

(When using Ext.CLIJ2_statisticsOfLabelledPixels(image1, image2), and Ext.CLIJ2_statisticsOfBackgroundAndLabelledPixels(image2, image3))

Also, the stack position (C, T) for the input would be helpful.

Thanks a lot

generate parametric image output image issue

generate parametric image from vector or results table column has the description of label image and vector inverted and the destination image is not created correctly but would rather need to be created as a copy of the input label image.

The following IJ macro should show that issue:

run("Set Measurements...", "area mean standard modal min centroid center perimeter bounding fit shape feret's integrated median skewness kurtosis area_fraction stack display redirect=None decimal=3");
run("Blobs (25K)");
setOption("BlackBackground", true);
run("Convert to Mask");
blobs = getTitle();
run("Analyze Particles...", "display clear");

run("CLIJ2 Macro Extensions", "device=");
Ext.CLIJ2_clear();

Ext.CLIJ2_push(blobs);
ccl = "connected_components_labeling";
Ext.CLIJ2_connectedComponentsLabelingDiamond(blobs, ccl);

//columName = getString("Column", "Perimeter");
columName = "Perim.";
columnContent = Table.getColumn(columName);
vectorArray = Array.concat(0,columnContent);

newImage("Vector_" + columName, "32-bit black", vectorArray.length, 1, 1);
vector = getTitle();

for (i = 0; i < vectorArray.length; i++) {
	setPixel(i, 0, vectorArray[i]);
}
resetMinAndMax;

Ext.CLIJ2_push(vector);

destination = "destination";
Ext.CLIJ2_generateParametricImage(ccl, vector, destination);

Ext.CLIJ2_pull(destination);

Can't run ClijX richradson lucy deconvolution using clfft

When I try to run Clijx richardson lucy deconvolution, I get this exception. I am running Fiji in linux and the server I am on has two nvidia gpus and a cpu so I think this may be an issue of it trying to create a context for each of these three devices? Although I am not sure since I'm having trouble analyzing this error.

(Fiji Is Just) ImageJ 2.14.0/1.54f; Java 1.8.0_322 [64-bit]; Linux 3.10.0-1160.83.1.el7.x86_64; 913MB of 121978MB (<1%)
 
net.haesleinhuepf.clij.clearcl.exceptions.ClearCLTooManyContextsException: Too many contexts have been created and not released
	at net.haesleinhuepf.clij.clearcl.ClearCLDevice.createContext(ClearCLDevice.java:221)
	at net.haesleinhuepf.clij.CLIJ.<init>(CLIJ.java:156)
	at net.haesleinhuepf.clij.CLIJ.getInstance(CLIJ.java:172)
	at net.haesleinhuepf.clij.CLIJ.getInstance(CLIJ.java:166)
	at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:265)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
	at ij.IJ.runUserPlugIn(IJ.java:246)
	at ij.IJ.runPlugIn(IJ.java:210)
	at ij.Executer.runCommand(Executer.java:152)
	at ij.Executer.run(Executer.java:70)
	at java.lang.Thread.run(Thread.java:750)

`

Present in our Open Source Neuro Seminar Series?

We at Open Neuroscience are reaching out because we would love to have your project featured on our seminar series on World Wide Science! The goal is to highlight projects that are listed in our website and allow developers to discuss their projects and get feedback from the community.

If this sounds interesting, please go ahead and fill in this form with the talk details and your availability.

We hold our seminars every other week at 15:00 UTC. Talks are live on Zoom and broadcasted via YouTube, and last between 30-45 mins + discussion. Since there are so many other science-specific seminars, we try to focus more on the tool/method and why/how people needed/wanted to make it. The format is flexible so you can showcase your open source tools as best you prefer.

Weโ€™re available for any questions at [email protected]. Thank you!

Only able to install via updating fiji

You can only install it by going through the update fiji menu which automatically updates fiji when you open it, but updating fiji breaks something i need to use it for...

Error when computing of Standard Deviation in Clij2

Standard Deviation of all on GPU in Clij2 throws and Error.
Interestingly the masked standard deviation works.

(Fiji Is Just) ImageJ 2.3.0/1.53s; Java 1.8.0_322 [64-bit]; Linux 4.18.0-348.20.1.el8_5.x86_64; 443MB of 19319MB (2%)
 
java.lang.NullPointerException
	at net.haesleinhuepf.clij2.CLIJ2.execute(CLIJ2.java:537)
	at net.haesleinhuepf.clij2.plugins.VarianceOfAllPixels.varianceOfAllPixels(VarianceOfAllPixels.java:62)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.standardDeviationOfAllPixels(StandardDeviationOfAllPixels.java:46)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.standardDeviationOfAllPixels(StandardDeviationOfAllPixels.java:42)
	at net.haesleinhuepf.clij2.CLIJ2Ops.standardDeviationOfAllPixels(CLIJ2Ops.java:1769)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.executeCL(StandardDeviationOfAllPixels.java:31)
	at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:478)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
	at ij.IJ.runUserPlugIn(IJ.java:239)
	at ij.IJ.runPlugIn(IJ.java:203)
	at ij.Executer.runCommand(Executer.java:152)
	at ij.Executer.run(Executer.java:67)
	at java.lang.Thread.run(Thread.java:750)
package net.haesleinhuepf.clij2.plugins, clij2_, version 0.0
sumPixels is deprecated. Check the documentation for a replacement. https://clij.github.io/clij2-doccs/reference
Error when trying to create kernel squared_sum_project
net.haesleinhuepf.clij.clearcl.exceptions.OpenCLException: OpenCL error: -45 -> CL_INVALID_PROGRAM_EXECUTABLE
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkOpenCLErrorCode(BackendUtils.java:352)
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$getKernelPeerPointer$19(ClearCLBackendJOCL.java:601)
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:156)
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.getKernelPeerPointer(ClearCLBackendJOCL.java:593)
	at net.haesleinhuepf.clij.clearcl.ClearCLCompiledProgram.createKernel(ClearCLCompiledProgram.java:137)
	at net.haesleinhuepf.clij.clearcl.ClearCLProgram.createKernel(ClearCLProgram.java:685)
	at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.getKernel(CLKernelExecutor.java:382)
	at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.enqueue(CLKernelExecutor.java:258)
	at net.haesleinhuepf.clij2.CLIJ2.lambda$executeSubsequently$1(CLIJ2.java:579)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:569)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:556)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:551)
	at net.haesleinhuepf.clij2.CLIJ2.execute(CLIJ2.java:536)
	at net.haesleinhuepf.clij2.plugins.VarianceOfAllPixels.varianceOfAllPixels(VarianceOfAllPixels.java:62)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.standardDeviationOfAllPixels(StandardDeviationOfAllPixels.java:46)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.standardDeviationOfAllPixels(StandardDeviationOfAllPixels.java:42)
	at net.haesleinhuepf.clij2.CLIJ2Ops.standardDeviationOfAllPixels(CLIJ2Ops.java:1769)
	at net.haesleinhuepf.clij2.plugins.StandardDeviationOfAllPixels.executeCL(StandardDeviationOfAllPixels.java:31)
	at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:478)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
	at ij.plugin.filter.PlugInFilterRunner.<init>(PlugInFilterRunner.java:114)
	at ij.IJ.runUserPlugIn(IJ.java:239)
	at ij.IJ.runPlugIn(IJ.java:203)
	at ij.Executer.runCommand(Executer.java:152)
	at ij.Executer.run(Executer.java:67)
	at java.lang.Thread.run(Thread.java:750)

Switching the CL-Device while the assistant is running makes it crash.

Hi

Great tool, clij.
Just getting used to it. Amazing

I started using it, but I get these error messages when I via the 'clij assistant':

  • Filter(noise removal) --> Gaussian Blur3D(CLIJ2)
  • Transform --> Make Isotropic
  • Transform --> Rigid Transform
  • Transform --> also a few others but not all

Attached is an example of error I get for 'Gaussian Blur3D(CLIJ2)' .
clij_error

I am using the graphics card of my windows laptop
GPU

Hope its something easy. And not so silly from my side. :) :)

ClearCLException "problem while setting argument 'src'" on MacOS

Dear future self,

there is a not-reproducible bug, potentially only on Macs with specific Hardware (suspicion).

Sytem config:

ImageJ:
Version: 2.1.0/1.53c
Build: 5f23140693

macOS Catalina. Version 10.15.5
MacBook Pro (16-inch, 2019)
Processor 2.3 GHz 8-Core Intel Core i9
Memory: 32 GB 2667 MHz DDR4
Graphics: AMD Radeon Pro 5500M 8 GB
Intel UHD Graphics 630 1536 M

Executed code

// top hat
run("T1 Head (2.4M, 16-bits)");
run("CLIJ2 Macro Extensions", "cl_device=[Intel(R) UHDGraphics 620]");
image1 = "t1-head.tif";
Ext.CLIJ2_push(image1);
image2 = "top_hat-427502308";
radius_x = 10.0;
radius_y = 10.0;
radius_z = 10.0;
// study time tracing of the Top Hat filter
Ext.CLIJ2_startTimeTracing();
Ext.CLIJ2_topHatBox(image1, image2, radius_x, radius_y,radius_z);
Ext.CLIJ2_stopTimeTracing();
Ext.CLIJ2_pull(image2);// determine and print time 
Ext.CLIJ2_getTimeTracing(time_traces);
print(time_traces);

Error message:

Overwriting image in cache.
net.haesleinhuepf.clij.clearcl.exceptions.ClearCLException: problem while setting argument 'dst' at index 0 

	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.setArgumentsInternal(ClearCLKernel.java:426)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.lambda$run$0(ClearCLKernel.java:481)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:64)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:477)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:459)
	at net.haesleinhuepf.clij.utilities.CLKernelExecutor.lambda$enqueue$0(CLKernelExecutor.java:333)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.utilities.CLKernelExecutor.enqueue(CLKernelExecutor.java:331)
	at net.haesleinhuepf.clij.CLIJ.lambda$execute$0(CLIJ.java:278)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.CLIJ.execute(CLIJ.java:255)
	at net.haesleinhuepf.clij.CLIJ.execute(CLIJ.java:235)
	at net.haesleinhuepf.clij.kernels.Kernels.copyInternal(Kernels.java:835)
	at net.haesleinhuepf.clij.kernels.Kernels.copy(Kernels.java:847)
	at net.haesleinhuepf.clij.macro.CLIJHandler.pushInternal(CLIJHandler.java:316)
	at net.haesleinhuepf.clij.macro.CLIJHandler.pushToGPU(CLIJHandler.java:268)
	at net.haesleinhuepf.clij2.plugins.Push.executeCL(Push.java:30)
	at net.haesleinhuepf.clij.macro.CLIJHandler.lambda$handleExtension$0(CLIJHandler.java:163)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.macro.CLIJHandler.handleExtension(CLIJHandler.java:53)
	at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288)
	at ij.macro.Functions.doExt(Functions.java:4967)
	at ij.macro.Functions.getStringFunction(Functions.java:278)
	at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
	at ij.macro.Interpreter.getString(Interpreter.java:1453)
	at ij.macro.Interpreter.doStatement(Interpreter.java:333)
	at ij.macro.Interpreter.doStatements(Interpreter.java:264)
	at ij.macro.Interpreter.run(Interpreter.java:160)
	at ij.macro.Interpreter.run(Interpreter.java:93)
	at ij.macro.Interpreter.run(Interpreter.java:104)
	at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
	at ij.IJ.runMacro(IJ.java:153)
	at ij.IJ.runMacro(IJ.java:142)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1148)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1144)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1095)
	at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1144)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:145)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: net.haesleinhuepf.clij.clearcl.exceptions.ClearCLException
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:178)
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.setKernelArgument(ClearCLBackendJOCL.java:614)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.setArgumentsInternal(ClearCLKernel.java:417)
	... 50 more
Caused by: java.lang.NullPointerException
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$setKernelArgument$20(ClearCLBackendJOCL.java:707)
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:171)
	... 52 more


 //###########################################################################
// Preamble:
#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable

#pragma OPENCL EXTENSION cl_amd_printf : enable

#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable

#ifndef M_PI
    #define   M_PI 3.14159265358979323846f /* pi */
#endif

#ifndef M_LOG2E
    #define   M_LOG2E   1.4426950408889634074f /* log_2 e */
#endif
 
#ifndef M_LOG10E
    #define   M_LOG10E   0.43429448190325182765f /* log_10 e */
#endif
 
#ifndef M_LN2
    #define   M_LN2   0.69314718055994530942f  /* log_e 2 */
#endif

#ifndef M_LN10
    #define   M_LN10   2.30258509299404568402f /* log_e 10 */
#endif

#ifndef BUFFER_READ_WRITE
    #define BUFFER_READ_WRITE 1

#define MINMAX_TYPE long


inline char2 read_buffer4dc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global char * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, position.w};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
        // todo: correct pos.w
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height + pos.w * read_buffer_width * read_buffer_height * read_buffer_depth ;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) { // todo: check pos.w
        return (char2){0, 0};
    }
    return (char2){buffer_var[pos_in_buffer],0};
}

inline uchar2 read_buffer4duc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global uchar * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, position.w};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
        // todo: correct pos.w
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height + pos.w * read_buffer_width * read_buffer_height * read_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) { // todo: check pos.w
        return (uchar2){0, 0};
    }
    return (uchar2){buffer_var[pos_in_buffer],0};
}

inline short2 read_buffer4di(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global short * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, position.w};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
        // todo: correct pos.w
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height + pos.w * read_buffer_width * read_buffer_height * read_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) { // todo: check pos.w
        return (short2){0, 0};
    }
    return (short2){buffer_var[pos_in_buffer],0};
}

inline ushort2 read_buffer4dui(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global ushort * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, position.w};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
        // todo: correct pos.w
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height + pos.w * read_buffer_width * read_buffer_height * read_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) { // todo: check pos.w
        return (ushort2){0, 0};
    }
    return (ushort2){buffer_var[pos_in_buffer],0};
}

inline float2 read_buffer4df(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global float* buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, position.w};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
        // todo: correct pos.w
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height + pos.w * read_buffer_width * read_buffer_height * read_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) { // todo: check pos.w
        return (float2){0, 0};
    }
    return (float2){buffer_var[pos_in_buffer],0};
}

inline void write_buffer4dc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global char * buffer_var, int4 pos, char value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height + pos.w * write_buffer_width * write_buffer_height * write_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) { // todo: check pos.w
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer4duc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global uchar * buffer_var, int4 pos, uchar value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height + pos.w * write_buffer_width * write_buffer_height * write_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) { // todo: check pos.w
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer4di(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global short * buffer_var, int4 pos, short value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height + pos.w * write_buffer_width * write_buffer_height * write_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) { // todo: check pos.w
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer4dui(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global ushort * buffer_var, int4 pos, ushort value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height + pos.w * write_buffer_width * write_buffer_height * write_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) { // todo: check pos.w
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer4df(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global float* buffer_var, int4 pos, float value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height + pos.w * write_buffer_width * write_buffer_height * write_buffer_depth;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) { // todo: check pos.w
        return;
    }
    buffer_var[pos_in_buffer] = value;
}



inline char2 read_buffer3dc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global char * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, 0};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) {
        return (char2){0, 0};
    }
    return (char2){buffer_var[pos_in_buffer],0};
}

inline uchar2 read_buffer3duc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global uchar * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, 0};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) {
        return (uchar2){0, 0};
    }
    return (uchar2){buffer_var[pos_in_buffer],0};
}

inline short2 read_buffer3di(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global short * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, 0};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) {
        return (short2){0, 0};
    }
    return (short2){buffer_var[pos_in_buffer],0};
}

inline ushort2 read_buffer3dui(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global ushort * buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, 0};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) {
        return (ushort2){0, 0};
    }
    return (ushort2){buffer_var[pos_in_buffer],0};
}

inline float2 read_buffer3df(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global float* buffer_var, sampler_t sampler, int4 position )
{
    int4 pos = (int4){position.x, position.y, position.z, 0};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.z = max((MINMAX_TYPE)pos.z, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
        pos.z = min((MINMAX_TYPE)pos.z, (MINMAX_TYPE)read_buffer_depth - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width + (long)pos.z * read_buffer_width * read_buffer_height;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height || pos.z < 0 || (long)pos.z >= read_buffer_depth) {
        return (float2){0, 0};
    }
    return (float2){buffer_var[pos_in_buffer],0};
}

inline void write_buffer3dc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global char * buffer_var, int4 pos, char value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer3duc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global uchar * buffer_var, int4 pos, uchar value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer3di(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global short * buffer_var, int4 pos, short value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer3dui(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global ushort * buffer_var, int4 pos, ushort value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer3df(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global float* buffer_var, int4 pos, float value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width + (long)pos.z * write_buffer_width * write_buffer_height;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height || pos.z < 0 || (long)pos.z >= write_buffer_depth) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline char2 read_buffer2dc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global char * buffer_var, sampler_t sampler, int2 position )
{
    int2 pos = (int2){position.x, position.y};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height) {
        return (char2){0, 0};
    }
    return (char2){buffer_var[pos_in_buffer],0};
}

inline uchar2 read_buffer2duc(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global uchar * buffer_var, sampler_t sampler, int2 position )
{
    int2 pos = (int2){position.x, position.y};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height) {
        return (uchar2){0, 0};
    }
    return (uchar2){buffer_var[pos_in_buffer],0};
}

inline short2 read_buffer2di(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global short * buffer_var, sampler_t sampler, int2 position )
{
    int2 pos = (int2){position.x, position.y};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height) {
        return (short2){0, 0};
    }
    return (short2){buffer_var[pos_in_buffer],0};
}

inline ushort2 read_buffer2dui(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global ushort * buffer_var, sampler_t sampler, int2 position )
{
    int2 pos = (int2){position.x, position.y};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height) {
        return (ushort2){0, 0};
    }
    return (ushort2){buffer_var[pos_in_buffer],0};
}

inline float2 read_buffer2df(long read_buffer_width, long read_buffer_height, long read_buffer_depth, __global float* buffer_var, sampler_t sampler, int2 position )
{
    int2 pos = (int2){position.x, position.y};
    if (true) { // if (CLK_ADDRESS_CLAMP_TO_EDGE & sampler) {
        pos.x = max((MINMAX_TYPE)pos.x, (MINMAX_TYPE)0);
        pos.y = max((MINMAX_TYPE)pos.y, (MINMAX_TYPE)0);
        pos.x = min((MINMAX_TYPE)pos.x, (MINMAX_TYPE)read_buffer_width - 1);
        pos.y = min((MINMAX_TYPE)pos.y, (MINMAX_TYPE)read_buffer_height - 1);
    }
    long pos_in_buffer = (long)pos.x + (long)pos.y * read_buffer_width;
    if (pos.x < 0 || (long)pos.x >= read_buffer_width || pos.y < 0 || (long)pos.y >= read_buffer_height) {
        return (float2){0, 0};
    }
    return (float2){buffer_var[pos_in_buffer],0};
}

inline void write_buffer2dc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global char * buffer_var, int2 pos, char value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer2duc(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global uchar * buffer_var, int2 pos, uchar value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer2di(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global short * buffer_var, int2 pos, short value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer2dui(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global ushort * buffer_var, int2 pos, ushort value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline void write_buffer2df(long write_buffer_width, long write_buffer_height, long write_buffer_depth, __global float* buffer_var, int2 pos, float value )
{
    long pos_in_buffer = (long)pos.x + (long)pos.y * write_buffer_width;
    if (pos.x < 0 || (long)pos.x >= write_buffer_width || pos.y < 0 || (long)pos.y >= write_buffer_height) {
        return;
    }
    buffer_var[pos_in_buffer] = value;
}

inline uchar clij_convert_uchar_sat(float value) {
    if (value > 255) {
        return 255;
    }
    if (value < 0) {
        return 0;
    }
    return (uchar)value;
}


inline char clij_convert_char_sat(float value) {
    if (value > 127) {
        return 127;
    }
    if (value < -128) {
        return -128;
    }
    return (char)value;
}


inline ushort clij_convert_ushort_sat(float value) {
    if (value > 65535) {
        return 65535;
    }
    if (value < 0) {
        return 0;
    }
    return (ushort)value;
}


inline short clij_convert_short_sat(float value) {
    if (value > 32767) {
        return 32767;
    }
    if (value < -32768) {
        return -32768;
    }
    return (short)value;
}

inline uint clij_convert_uint_sat(float value) {
    if (value > 4294967295) {
        return 4294967295;
    }
    if (value < 0) {
        return 0;
    }
    return (uint)value;
}

inline int clij_convert_int_sat(float value) {
    if (value > 2147483647) {
        return 2147483647;
    }
    if (value < -2147483648) {
        return -2147483648;
    }
    return (int)value;
}

inline float clij_convert_float_sat(float value) {
    return value;
}

#define READ_IMAGE(a,b,c) READ_ ## a ## _IMAGE(a,b,c)
#define WRITE_IMAGE(a,b,c) WRITE_ ## a ## _IMAGE(a,b,c)

#endif



 //###########################################################################
// Defines:
#define WRITE_IMAGE_2D(a,b,c) 	write_buffer2dui(GET_IMAGE_WIDTH(a),GET_IMAGE_HEIGHT(a),GET_IMAGE_DEPTH(a),a,b,c)
#define DTYPE_IMAGE_IN_3D 	__global ushort*
#define GET_IMAGE_OUT_HEIGHT(image_key) 	IMAGE_SIZE_ ## image_key ## _HEIGHT
#define DTYPE_IN 	ushort
#define DTYPE_IMAGE_OUT_3D 	__global ushort*
#define GET_IMAGE_OUT_DEPTH(image_key) 	IMAGE_SIZE_ ## image_key ## _DEPTH
#define GET_IMAGE_HEIGHT(image_key) 	IMAGE_SIZE_ ## image_key ## _HEIGHT
#define IMAGE_SIZE_dst_HEIGHT 	256
#define GET_IMAGE_IN_HEIGHT(image_key) 	IMAGE_SIZE_ ## image_key ## _HEIGHT
#define READ_IMAGE_3D(a,b,c) 	read_buffer3dui(GET_IMAGE_WIDTH(a),GET_IMAGE_HEIGHT(a),GET_IMAGE_DEPTH(a),a,b,c)
#define GET_IMAGE_DEPTH(image_key) 	IMAGE_SIZE_ ## image_key ## _DEPTH
#define READ_IMAGE_2D(a,b,c) 	read_buffer2dui(GET_IMAGE_WIDTH(a),GET_IMAGE_HEIGHT(a),GET_IMAGE_DEPTH(a),a,b,c)
#define IMAGE_SIZE_dst_WIDTH 	256
#define GET_IMAGE_OUT_WIDTH(image_key) 	IMAGE_SIZE_ ## image_key ## _WIDTH
#define GET_IMAGE_IN_WIDTH(image_key) 	IMAGE_SIZE_ ## image_key ## _WIDTH
#define WRITE_IMAGE_3D(a,b,c) 	write_buffer3dui(GET_IMAGE_WIDTH(a),GET_IMAGE_HEIGHT(a),GET_IMAGE_DEPTH(a),a,b,c)
#define DTYPE_IMAGE_IN_2D 	__global ushort*
#define GET_IMAGE_IN_DEPTH(image_key) 	IMAGE_SIZE_ ## image_key ## _DEPTH
#define DTYPE_IMAGE_OUT_2D 	__global ushort*
#define IMAGE_SIZE_src_WIDTH 	256
#define CONVERT_DTYPE_OUT 	clij_convert_ushort_sat
#define MAX_ARRAY_SIZE 	1000
#define GET_IMAGE_WIDTH(image_key) 	IMAGE_SIZE_ ## image_key ## _WIDTH
#define IMAGE_SIZE_dst_DEPTH 	129
#define DTYPE_OUT 	ushort
#define IMAGE_SIZE_src_HEIGHT 	256
#define IMAGE_SIZE_src_DEPTH 	129





 //###########################################################################
// Source: 'duplication.cl' relative to Kernels
__kernel void copy_3d (DTYPE_IMAGE_OUT_3D dst, DTYPE_IMAGE_IN_3D src) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);
  const int dz = get_global_id(2);

  const int4 pos = (int4){dx,dy,dz,0};

  const DTYPE_IN out = READ_IMAGE_3D(src,sampler,pos).x;
  WRITE_IMAGE_3D(dst, pos, CONVERT_DTYPE_OUT(out));
}

__kernel void copy_2d(DTYPE_IMAGE_OUT_2D dst, DTYPE_IMAGE_IN_2D src) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);


  const int2 pos = (int2){dx,dy};

  const DTYPE_IN out = READ_IMAGE_2D(src,sampler,pos).x;
  WRITE_IMAGE_2D(dst,pos, CONVERT_DTYPE_OUT(out));
}

__kernel void copySlice(DTYPE_IMAGE_OUT_2D dst, DTYPE_IMAGE_IN_3D src, int slice) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);

  const int4 pos4 = (int4){dx,dy,slice,0};
  const int2 pos2 = (int2){dx,dy};

  const DTYPE_IN out = READ_IMAGE_3D(src,sampler,pos4).x;
  WRITE_IMAGE_2D(dst,pos2, CONVERT_DTYPE_OUT(out));
}

__kernel void putSliceInStack(DTYPE_IMAGE_OUT_3D dst, DTYPE_IMAGE_IN_2D src, int slice) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);

  const int2 pos2 = (int2){dx,dy};
  const int4 pos4 = (int4){dx,dy,slice,0};

  const DTYPE_IN out = READ_IMAGE_2D(src,sampler,pos2).x;
  WRITE_IMAGE_3D(dst,pos4, CONVERT_DTYPE_OUT(out));
}


__kernel void crop_3d(DTYPE_IMAGE_OUT_3D dst, DTYPE_IMAGE_IN_3D src, int start_x, int start_y, int start_z) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);
  const int dz = get_global_id(2);


  const int sx = start_x + dx;
  const int sy = start_y + dy;
  const int sz = start_z + dz;

  const int4 dpos = (int4){dx,dy,dz,0};
  const int4 spos = (int4){sx,sy,sz,0};

  const DTYPE_IN out = READ_IMAGE_3D(src,sampler,spos).x;
  WRITE_IMAGE_3D(dst,dpos, CONVERT_DTYPE_OUT(out));
}


__kernel void crop_2d(DTYPE_IMAGE_OUT_2D dst, DTYPE_IMAGE_IN_2D src, int start_x, int start_y) {
  const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;

  const int dx = get_global_id(0);
  const int dy = get_global_id(1);

  const int sx = start_x + dx;
  const int sy = start_y + dy;

  const int2 dpos = (int2){dx,dy};
  const int2 spos = (int2){sx,sy};

  const DTYPE_IN out = READ_IMAGE_2D(src,sampler,spos).x;
  WRITE_IMAGE_2D(dst,dpos, CONVERT_DTYPE_OUT(out));
}




CLIJ Error: For support please contact the CLIJ2 developers via the forum on https://image.sc or create an issue on https://github.com/clij/clij2/issues .
Therefore, please report the complete error message, the code snippet or workflow you were running, an example image if possible and details about your graphics hardware.

net.haesleinhuepf.clij.clearcl.exceptions.ClearCLException: problem while setting argument 'src' at index 7 

	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.setArgumentsInternal(ClearCLKernel.java:426)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.lambda$run$0(ClearCLKernel.java:481)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:64)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:477)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:459)
	at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.lambda$enqueue$1(CLKernelExecutor.java:267)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.enqueue(CLKernelExecutor.java:266)
	at net.haesleinhuepf.clij2.CLIJ2.lambda$executeSubsequently$0(CLIJ2.java:466)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:456)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:443)
	at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:438)
	at net.haesleinhuepf.clij2.CLIJ2.execute(CLIJ2.java:423)
	at net.haesleinhuepf.clij2.utilities.CLIJUtilities.executeSeparableKernel(CLIJUtilities.java:77)
	at net.haesleinhuepf.clij2.plugins.Minimum3DBox.minimumBox(Minimum3DBox.java:47)
	at net.haesleinhuepf.clij2.plugins.Minimum3DBox.minimum3DBox(Minimum3DBox.java:43)
	at net.haesleinhuepf.clij2.CLIJ2Ops.minimum3DBox(CLIJ2Ops.java:4250)
	at net.haesleinhuepf.clij2.plugins.TopHatBox.topHatBox(TopHatBox.java:44)
	at net.haesleinhuepf.clij2.CLIJ2Ops.topHatBox(CLIJ2Ops.java:688)
	at net.haesleinhuepf.clij2.plugins.TopHatBox.executeCL(TopHatBox.java:34)
	at net.haesleinhuepf.clij.macro.CLIJHandler.lambda$handleExtension$0(CLIJHandler.java:163)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.macro.CLIJHandler.handleExtension(CLIJHandler.java:53)
	at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288)
	at ij.macro.Functions.doExt(Functions.java:4967)
	at ij.macro.Functions.getStringFunction(Functions.java:278)
	at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
	at ij.macro.Interpreter.getString(Interpreter.java:1453)
	at ij.macro.Interpreter.doStatement(Interpreter.java:333)
	at ij.macro.Interpreter.doStatements(Interpreter.java:264)
	at ij.macro.Interpreter.run(Interpreter.java:160)
	at ij.macro.Interpreter.run(Interpreter.java:93)
	at ij.macro.Interpreter.run(Interpreter.java:104)
	at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
	at ij.IJ.runMacro(IJ.java:153)
	at ij.IJ.runMacro(IJ.java:142)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1148)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1144)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1095)
	at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1144)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:145)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: net.haesleinhuepf.clij.clearcl.exceptions.ClearCLException
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:178)
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.setKernelArgument(ClearCLBackendJOCL.java:614)
	at net.haesleinhuepf.clij.clearcl.ClearCLKernel.setArgumentsInternal(ClearCLKernel.java:417)
	... 54 more
Caused by: java.lang.NullPointerException
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$setKernelArgument$20(ClearCLBackendJOCL.java:707)
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:171)
	... 56 more
net.haesleinhuepf.clij.clearcl.exceptions.ClearCLException
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:178)
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.enqueueReadFromBuffer(ClearCLBackendJOCL.java:790)
	at net.haesleinhuepf.clij.clearcl.ClearCLBuffer.writeTo(ClearCLBuffer.java:400)
	at net.haesleinhuepf.clij.clearcl.ClearCLBuffer.writeTo(ClearCLBuffer.java:366)
	at net.haesleinhuepf.clij.converters.implementations.ClearCLBufferToImagePlusConverter.convert(ClearCLBufferToImagePlusConverter.java:61)
	at net.haesleinhuepf.clij.converters.implementations.ClearCLBufferToImagePlusConverter.convert(ClearCLBufferToImagePlusConverter.java:26)
	at net.haesleinhuepf.clij.CLIJ.convert(CLIJ.java:475)
	at net.haesleinhuepf.clij.CLIJ.show(CLIJ.java:358)
	at net.haesleinhuepf.clij.macro.CLIJHandler.pullFromGPU(CLIJHandler.java:253)
	at net.haesleinhuepf.clij2.plugins.Pull.executeCL(Pull.java:24)
	at net.haesleinhuepf.clij.macro.CLIJHandler.lambda$handleExtension$0(CLIJHandler.java:163)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
	at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
	at net.haesleinhuepf.clij.macro.CLIJHandler.handleExtension(CLIJHandler.java:53)
	at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288)
	at ij.macro.Functions.doExt(Functions.java:4967)
	at ij.macro.Functions.getStringFunction(Functions.java:278)
	at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
	at ij.macro.Interpreter.getString(Interpreter.java:1453)
	at ij.macro.Interpreter.doStatement(Interpreter.java:333)
	at ij.macro.Interpreter.doStatements(Interpreter.java:264)
	at ij.macro.Interpreter.run(Interpreter.java:160)
	at ij.macro.Interpreter.run(Interpreter.java:93)
	at ij.macro.Interpreter.run(Interpreter.java:104)
	at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
	at ij.IJ.runMacro(IJ.java:153)
	at ij.IJ.runMacro(IJ.java:142)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1148)
	at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1144)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1095)
	at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1144)
	at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:145)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$enqueueReadFromBuffer$24(ClearCLBackendJOCL.java:792)
	at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:171)
	... 40 more

The bug cannot be reproduced on our Windows/Linux/Mac test systems. We keep it here for later reference. Thanks to Dominic Waithe for reporting.

Make interpolation method selectable in AffineTransforms

At the moment, the transform decides automatically to do linear interpolation, it would be nice if nearest-neighbor versus linear interpolation could be chosen.

This is relevant, e.g. if label images are transformed.

Also affected:

  • RigidTransform
  • Scale
  • Translate
  • Rotate

Geforce GT 730 Win10 CL_INVALID_COMMAND_QUEUE and CL_OUT_OF_RESOURCES errors

Hi Robert,

I'm getting error messages and no output running CLIJ2: Gaussian 3D (sometimes) and Convolve (always) from an imageJ macro:

I'm writing an IJ macro for the reference implementation of the accelerated deconvolution algorithm I mentioned earlier, and trying to do it in CLIJ2 as much as possible. See it here:
https://github.com/chalkie666/imagejMacros/blob/master/DeconvolutionDemos/AgardAccellVanCittertGoldReferenceImplementation.ijm

As of now, the script should run fine (testing image data is in the same repository)
but, i'm getting very glitchy action on my new computer at home, with windows 10 64, nvidia geforce GT 730 (2GB), nvidia driver installed today, 27.21.14.6589 (driver version from windows task manager), from nvidia download file 465.89-desktop-win10-64bit-international-dch-whql.exe

Maybe its just me, maybe a bad card.... its been around a while....
I will try to test on my little 2 in 1 with integrated intel HD graphics and see if I get the same CL errors.

But maybe you have a clue what the problem might be? Is this card too old?

One last thing.... is the Convolve 2 images together gadget working in real spac3 (slow) or via FFT (fast)? Just out of interest.... I will want to run stuff using the CL-FFT stuff eventually.

cheers

Dan

CLIJ Error: For support please contact the CLIJ2 developers via the forum on https://image.sc or create an issue on https://github.com/clij/clij2/issues .
Therefore, please report the complete error message, the code snippet or workflow you were running, an example image if possible and details about your graphics hardware.

net.haesleinhuepf.clij.clearcl.exceptions.OpenCLException: OpenCL error: -36 -> CL_INVALID_COMMAND_QUEUE
at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkOpenCLError(BackendUtils.java:346)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$waitQueueToFinish$46(ClearCLBackendJOCL.java:1208)
at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:171)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.waitQueueToFinish(ClearCLBackendJOCL.java:1207)
at net.haesleinhuepf.clij.clearcl.ClearCLQueue.waitToFinish(ClearCLQueue.java:56)
at net.haesleinhuepf.clij.clearcl.ClearCLKernel.lambda$run$0(ClearCLKernel.java:497)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:64)
at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:477)
at net.haesleinhuepf.clij.clearcl.ClearCLKernel.run(ClearCLKernel.java:459)
at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.lambda$enqueue$1(CLKernelExecutor.java:267)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
at net.haesleinhuepf.clij.clearcl.util.CLKernelExecutor.enqueue(CLKernelExecutor.java:266)
at net.haesleinhuepf.clij2.CLIJ2.lambda$executeSubsequently$1(CLIJ2.java:502)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:492)
at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:479)
at net.haesleinhuepf.clij2.CLIJ2.executeSubsequently(CLIJ2.java:474)
at net.haesleinhuepf.clij2.CLIJ2.execute(CLIJ2.java:459)
at net.haesleinhuepf.clij2.plugins.Convolve.convolve(Convolve.java:53)
at net.haesleinhuepf.clij2.CLIJ2Ops.convolve(CLIJ2Ops.java:7271)
at net.haesleinhuepf.clij2.plugins.Convolve.executeCL(Convolve.java:43)
at net.haesleinhuepf.clij.macro.CLIJHandler.lambda$handleExtension$0(CLIJHandler.java:163)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
at net.haesleinhuepf.clij.macro.CLIJHandler.handleExtension(CLIJHandler.java:53)
at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288)
at ij.macro.Functions.doExt(Functions.java:4967)
at ij.macro.Functions.getStringFunction(Functions.java:278)
at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
at ij.macro.Interpreter.getString(Interpreter.java:1453)
at ij.macro.Interpreter.doStatement(Interpreter.java:333)
at ij.macro.Interpreter.doBlock(Interpreter.java:712)
at ij.macro.Interpreter.doStatement(Interpreter.java:323)
at ij.macro.Interpreter.doFor(Interpreter.java:634)
at ij.macro.Interpreter.doStatement(Interpreter.java:305)
at ij.macro.Interpreter.doStatements(Interpreter.java:264)
at ij.macro.Interpreter.run(Interpreter.java:160)
at ij.macro.Interpreter.run(Interpreter.java:93)
at ij.macro.Interpreter.run(Interpreter.java:104)
at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
at ij.IJ.runMacro(IJ.java:153)
at ij.IJ.runMacro(IJ.java:142)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1148)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1144)
at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1095)
at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1144)
at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:145)
at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
net.haesleinhuepf.clij.clearcl.exceptions.OpenCLException: OpenCL error: -5 -> CL_OUT_OF_RESOURCES
at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkOpenCLError(BackendUtils.java:346)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.lambda$enqueueReadFromBuffer$24(ClearCLBackendJOCL.java:791)
at net.haesleinhuepf.clij.clearcl.backend.BackendUtils.checkExceptions(BackendUtils.java:171)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.enqueueReadFromBuffer(ClearCLBackendJOCL.java:790)
at net.haesleinhuepf.clij.clearcl.ClearCLBuffer.writeTo(ClearCLBuffer.java:400)
at net.haesleinhuepf.clij.clearcl.ClearCLBuffer.writeTo(ClearCLBuffer.java:366)
at net.haesleinhuepf.clij.converters.implementations.ClearCLBufferToImagePlusConverter.convert(ClearCLBufferToImagePlusConverter.java:73)
at net.haesleinhuepf.clij.converters.implementations.ClearCLBufferToImagePlusConverter.convert(ClearCLBufferToImagePlusConverter.java:26)
at net.haesleinhuepf.clij.CLIJ.convert(CLIJ.java:475)
at net.haesleinhuepf.clij.CLIJ.show(CLIJ.java:358)
at net.haesleinhuepf.clij.macro.CLIJHandler.pullFromGPU(CLIJHandler.java:253)
at net.haesleinhuepf.clij2.plugins.Pull.executeCL(Pull.java:24)
at net.haesleinhuepf.clij.macro.CLIJHandler.lambda$handleExtension$0(CLIJHandler.java:163)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:97)
at net.haesleinhuepf.clij.clearcl.util.ElapsedTime.measure(ElapsedTime.java:28)
at net.haesleinhuepf.clij.macro.CLIJHandler.handleExtension(CLIJHandler.java:53)
at ij.macro.ExtensionDescriptor.dispatch(ExtensionDescriptor.java:288)
at ij.macro.Functions.doExt(Functions.java:4967)
at ij.macro.Functions.getStringFunction(Functions.java:278)
at ij.macro.Interpreter.getStringTerm(Interpreter.java:1475)
at ij.macro.Interpreter.getString(Interpreter.java:1453)
at ij.macro.Interpreter.doStatement(Interpreter.java:333)
at ij.macro.Interpreter.doBlock(Interpreter.java:712)
at ij.macro.Interpreter.doStatement(Interpreter.java:323)
at ij.macro.Interpreter.doFor(Interpreter.java:634)
at ij.macro.Interpreter.doStatement(Interpreter.java:305)
at ij.macro.Interpreter.doStatements(Interpreter.java:264)
at ij.macro.Interpreter.run(Interpreter.java:160)
at ij.macro.Interpreter.run(Interpreter.java:93)
at ij.macro.Interpreter.run(Interpreter.java:104)
at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:161)
at ij.IJ.runMacro(IJ.java:153)
at ij.IJ.runMacro(IJ.java:142)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1148)
at net.imagej.legacy.IJ1Helper$3.call(IJ1Helper.java:1144)
at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1095)
at net.imagej.legacy.IJ1Helper.runMacro(IJ1Helper.java:1144)
at net.imagej.legacy.plugin.IJ1MacroEngine.eval(IJ1MacroEngine.java:145)
at org.scijava.script.ScriptModule.run(ScriptModule.java:157)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.