Skip to content

Unclear how to initialize pyimagej in python scripts #12

Open

Description

@hinerm

In the Fiji script editor, the simple script:

import imagej
ij = imagej.init()

print(ij.getVersion())

produces output: 2.16.0/Inactive

I'm not sure if I should be initializing differently. Presumably I don't need to point to my local install? But I'm not sure how to get the legacy service active.

Also, isn't it problematic to be running imagej.init repeatedly? My intuition is that we want to initialize pyimagej once when launching in python mode, ensure it is done properly, make ij available for all, and kill other attempts to call init in the script editor..

Activity

  1. hinerm commented on Aug 24, 2025

    @hinerm
    MemberAuthor

    Ah found it..

    #@ ImageJ ij
  2. hinerm commented on Aug 24, 2025

    @hinerm
    MemberAuthor

    I tried adding a ScriptHeader that would automatically populate this text on new scripts. This functionality seems disabled by default and even then possibly unsupported... I think this would be a good direction though to avoid anyone attempting to initialize their own pyimagej

  3. hinerm commented on Aug 24, 2025

    @hinerm
    MemberAuthor

    At the least we need some templates for Python (pyimagej) and to work this into the pyimagej docs. imagej/pyimagej#333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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