Skip to content

Plugins not found on MacOS #22

@NoahDolev

Description

@NoahDolev

Hi,

I have successfully setup and used Py ImageJ. However, I am not able to call upon any of the numerous plugins from python.

from skimage import io
import cv2
import os
import imagej
ij = imagej.init('<my-local-path>/Fiji.app')
import imglyb
from PIL import Image

Returns:

Added 375 JARs to the Java classpath.

However, when I attempt to run a Macro:

def improve_raw(impath):
    macro = """open("{}");
               run("Normalize Local Contrast", "block_radius_x=40 block_radius_y=40 standard_deviations=3 center stretch");
               run("Enhance Local Contrast (CLAHE)", "blocksize=127 histogram=256 maximum=3 mask=*None*");
               run("Gaussian Blur 3D...", "x=2 y=2 z=2");
               saveAs("TIFF", "{}");""".format(impath, impath.replace("Tiff_masks", "Tiff_masks_cleaned"))
    ij.script().run('Macro.ijm', macro, True).get()
    return(1)

I receive the following error message:

Unrecognized command: "Normalize Local Contrast"

The macro successfully runs from within ImageJ. Any idea why the same macro doesn't work from within Python?

Thanks.

Best,
Noah

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions