Skip to content

Image j macros#21

Open
kgofron wants to merge 2 commits intoareaDetector:masterfrom
kgofron:ImageJ_macros
Open

Image j macros#21
kgofron wants to merge 2 commits intoareaDetector:masterfrom
kgofron:ImageJ_macros

Conversation

@kgofron
Copy link
Copy Markdown
Member

@kgofron kgofron commented Jul 8, 2021

At NSLS2 we find useful macros that populate PVs into the EPICS imagej viewers.
Given that there are 100's of cameras and detectors at the NSLS2, this saves a lot of time.
These scripts were developed for integration with CSS/Phoebus, but could be used/ expanded for use with other EPICS clients.
Installation requires copying 4 files into the ImageJ 'macros' folder.

# EPICS_AD_Viewer macro
#
# Place 4 files in /usr/share/imagej/macros folder
# Channel Access:
#   CSS_epics.ijm
#   css_imagej.sh
# PV Access:
#   CSS_epics_pva.ijm
#   css_imagej_pva.sh
#
# From CSS/Phoebus/... call .sh script
# Channel Access:
#   /usr/share/imagej/macros/css_imagej.sh $(Sys)$(Dev)image1:
# PV Access:
#   /usr/share/imagej/macros/css_imagej_pva.sh $(Sys)$(Dev)Pva1:Image
# which will start imagej viewer with populated PVs

@ericonr
Copy link
Copy Markdown
Member

ericonr commented Aug 7, 2025

Can you include newer versions of these scripts, if still interested?

@kgofron
Copy link
Copy Markdown
Member Author

kgofron commented Sep 20, 2025

Sure, after ICALEPS 25 meeting.

@ericonr
Copy link
Copy Markdown
Member

ericonr commented Oct 20, 2025

Ping :)

@kgofron
Copy link
Copy Markdown
Member Author

kgofron commented Jan 26, 2026

Hi Enrico,

I checked the setup, and the ImageJ scripts themselves do not need to be modified. The important part is how and from where they are invoked by CSS/Phoebus.

The main consideration is the installation location of the ImageJ EPICS macros. By default, ImageJ expects macros to reside in its macros directory. However, at ORNL we deploy these macros as part of a site-wide custom ImageJ installation on a mounted filesystem, rather than under the system ImageJ package path.

For example, on my Ubuntu office laptop system I placed the macros in folder (even though i use ubuntu imgej package):

/SNS/software/ImageJ/macros

This mirrors the beamline deployment and allows existing CSS/Phoebus screens to work unchanged on my laptop. The key requirement is that CSS/Phoebus must consistently point to the macro launch scripts at the chosen location, regardless of whether that location is the system ImageJ install or a centrally managed one (e.g., via Puppet/Ansible).

In short:

Macros can live wherever ImageJ is installed for the site.

CSS/Phoebus should call the corresponding .sh launcher scripts from that location.

Using a shared, mounted ImageJ installation simplifies deployment across all beamlines.

@ericonr
Copy link
Copy Markdown
Member

ericonr commented Mar 18, 2026

Kaz, I'm not sure I understand fully. Does this mean this PR doesn't need to be merged at all, or that the scripts don't require any updates?

Maybe this could be best solved with deployment documentation?

@kgofron
Copy link
Copy Markdown
Member Author

kgofron commented Mar 31, 2026

Hi Erico,

Thanks for the question — let me clarify.

I do think this PR should be merged. The main value here is that it provides the four scripts that each site will need to deploy into their respective ImageJ directories. Even if the scripts themselves don’t require further changes right now, having them versioned and available in the repository simplifies adoption and keeps deployments consistent across sites.

To make the usage clearer, I can add a Phoebus button example as part of the standard “first screen” for areaDetector. That would demonstrate how these scripts are intended to be invoked in practice and reduce ambiguity for new users.

I agree that deployment documentation would also help, and I’m happy to contribute a short section describing where the scripts should go and how they are used.

So in short:

The PR should be merged to make the scripts available and standardized
No immediate script changes are required
I’ll follow up with UI integration (Phoebus) and documentation to clarify usage

Let me know if that addresses your concern.

Best,
Kaz

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants