Problems with an Imagej Plugin

Problems with an ImageJ plugin

It looks like the Nifti_io plugin adds commands for importing but doesn't use the I/O plugin mechanism of ImageJ: HandleExtraFileTypes.

I would recommend downloading Fiji and giving it a try. It bundles a lot of useful ImageJ plugins, and the default File > Open will fall back to Bio-Formats, which provides a NiftiReader implementation.

Selection problems after Bio Format Importer, czi and zvi Files, ImageJ

One of the Solutions I realised is a Change of scale. My original files use pixels, whereas the BioFormat importer converts the scale into microns.

Analyze--> Set Scale... --> Click to remove scale or changing the scale solves one part of the problem.

For a macro following code restores the scale:

run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");

Still somethng about the colour values changes, I can't find, create selection is still not working properly.

Adding HandleExtraFileTypes to imageJ

After downloading the plugin file, in ImageJ plugin menu, pick install, select the file/folder you downloaded and ImageJ will install it (ImageJ finds the plugin folder for you here). Restart ImageJ and the plugin should work.

ImageJ (plugin Java): auto threshold method doesn't work

The auto-threshold methods in the Threshold dialog all are algorithms working on single channel (8-bit or 16-bit) images. In the Color Threshold dialog, they are applied exclusively to the Brightness channel of your 24-bit color image.

To reproduce this in Java, use the following code:

IJ.run(imp, "HSB Stack", "");
imp.setSlice(3);
IJ.setAutoThreshold(imp, "Triangle dark");
Prefs.blackBackground = true;
IJ.run(imp, "Convert to Mask", "only");

(Converting your image to 8-bit is nothing else than using the Brightness channel, discarding the Hue and Saturation information. Unless you really make use of the other sliders in the Color Threshold dialog, you can just as well convert the image to 8-bit before applying the threshold.)

ImageJ no error messages for plugin development

I suspect you are using ImageJ 1.x, e.g. downloaded from here? And trying to compile via Plugins>Compile and Run...?

In general, I would recommend developing Java code in Eclipse - as having a proper IDE is vastly more powerful than what you can get in ImageJ.

If all you need to do is write simple Macros calling existing ImageJ functions then writing them in the various non-Java scripting languages within ImageJ is perfectly sufficient.

If you decide Eclipse isn't your thing and you want to continue developing within ImageJ, I would strongly recommend using the Fiji distribution of ImageJ - as it includes a robust script editor.

If you use this editor to write Java code, it will save your scripts to disk as .java files and then call the Java compiler (javac) on them, which will give you a more complete picture of any compilation problems.



Related Topics



Leave a reply



Submit