Skip to content

Conversation

@kgofron
Copy link
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
Member

ericonr commented Aug 7, 2025

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

@kgofron
Copy link
Member Author

kgofron commented Sep 20, 2025

Sure, after ICALEPS 25 meeting.

@ericonr
Copy link
Member

ericonr commented Oct 20, 2025

Ping :)

@kgofron
Copy link
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.

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