Remote ImageJ - Running macros on a distant machine Volker Bcker - - PowerPoint PPT Presentation

remote imagej
SMART_READER_LITE
LIVE PREVIEW

Remote ImageJ - Running macros on a distant machine Volker Bcker - - PowerPoint PPT Presentation

Remote ImageJ - Running macros on a distant machine Volker Bcker Montpellier RIO Imaging www.mri.cnrs.fr IFR122 INSERM 29.10.2010 REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 1/29 Remote ImageJ - Outline the context at the MRI imaging


slide-1
SLIDE 1

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 1/29

Remote ImageJ -

Running macros on a distant machine

Volker Bäcker

Montpellier RIO Imaging www.mri.cnrs.fr IFR122 INSERM 29.10.2010

slide-2
SLIDE 2

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 2/29

Remote ImageJ - Outline

  • the context at the MRI imaging facility
  • design decisions
  • components
  • SIJAME – messaging middleware
  • Modal-Dialog-Killer
  • Macro_IO_Settings
  • Remote-Filesystem-View
  • Remote Macro Runner
  • conclusions and future work
slide-3
SLIDE 3

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 3/29

Motivation – MRI, the facility 2009 59 531 11 150 40000

slide-4
SLIDE 4

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 4/29

Motivation – MRI Image Analysis

  • development of

image analysis and automation solutions

  • n demand

13

// wound healing macro

run("Find Edges", "stack"); run("Invert", "stack"); setAutoThreshold("Pdark"); run("Convert to Mask"); resetThreshold(); run("Invert", "stack"); run("Dilate", "stack"); ...

slide-5
SLIDE 5

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 5/29

Motivation – The Problem

✔ automated image analysis ✗ macro-batch-processing blocks machines ✗ installation / maintenance on many machines ✗ transfer of images between machines

slide-6
SLIDE 6

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 6/29

Motivation – The Solution: Cicero

  • upload images to file-server
  • index images in database
  • access via web-application
  • run macros from web-application

ImageJ server huygens server application server webserver database fileserver upload

slide-7
SLIDE 7

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 7/29

Motivation – The Solution: Cicero

slide-8
SLIDE 8

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 8/29

Remote ImageJ – Analysis

  • Remote ImageJ -

run macros on a distant machine

ImageJ server fileserver

run(“Ma) RoiManag ...

  • images are on a

fileserver

slide-9
SLIDE 9

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 9/29

Remote ImageJ – Analysis & Design

  • use ImageJ and plugins only
  • send macros from client to

server and answers back

  • asynchronous

communication

  • access paths as seen by the

server

  • synchronous

communication

  • server can be headful
  • avoid modal dialogs
  • modularity
  • independent components

that play together

slide-10
SLIDE 10

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 10/29

Remote ImageJ – Components

  • Existing
  • SIJAME – SImple JAva Message Exchange
  • Modal-Dialog-Killer
  • Macro_IO_Settings
  • Remote-Filesystem-View
  • Remote Macro Runner
  • Future
  • Queue-Manager
slide-11
SLIDE 11

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 11/29

Remote ImageJ – SIJAME

  • SIJAME
  • socket based communication
  • messages are transferred binary
  • message can carry

serializable data

  • server can put message

in a queue

  • synchronous or

asynchronous communication

  • symetric:

– client is a server – answer-queue

slide-12
SLIDE 12

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 12/29

SIJAME asynchronous

ImageJ server

  • 1. client sends message,

closes connection and keeps on working

  • 2. server puts message

in a queue

  • 3. consumers are informed

when the first message changes

  • 4. consumer sends an

answer-message back

slide-13
SLIDE 13

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 13/29

SIJAME synchronous

ImageJ server

  • 1. client sends message

and waits for answer,

  • 4. sends close to finish

conversation

  • 2. consumers are informed

that a message arrived

  • 3. consumer sends answer
  • n the same channel
slide-14
SLIDE 14

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 14/29

  • communication middleware SIJAME
  • problem of modal dialogs on the server
slide-15
SLIDE 15

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 15/29

Modal Dialog Killer

GenericDialog GenericDialog WaitForUserDialog JDialog MessageDialog

slide-16
SLIDE 16

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 16/29

  • communication middleware SIJAME
  • problem of modal dialogs on the server
  • how to specify input files and folders for macro
slide-17
SLIDE 17

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 17/29

specify input – standard approach

inDir = getDirectory("Select the input folder!");

files = getFileList(inDir);

  • folder can contain other images
  • need to filter
  • code to load dependent files
  • naming scheme can change

➔ edit lists of files instead of

selecting folders

YGZG7-gfp001 YGZG7-gfp002 YGZG7-dapi001 YGZG7-dapi002

slide-18
SLIDE 18

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 18/29

Macro_IO_Settings

add a list

  • one per channel

add files

  • select multiple files
  • select a folder (recursively)
  • tif, all images, all files

filter unwanted

slide-19
SLIDE 19

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 19/29

Macro_IO_Settings

call("fr.cnrs.mri.macro.io.IOSettings.resetFileLists"); call("fr.cnrs.mri.macro.io.IOSettings.show"); waitForUser("Please select the input files and press ok"); list = call("fr.cnrs.mri.macro.io.IOSettings.getFileList"); if (list=="none") { IJ.log("No files selected! Macro stopped."); return; } files = split(list, ","); for (i=0; i<files.length; i++) { file = files[i]; ...

lists of lists as strings

  • lists separated by ;
  • elements separated by ,
slide-20
SLIDE 20

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 20/29

  • communication middleware SIJAME
  • problem of modal dialogs on the server
  • how to specify input files and folders for macro
  • distant input files and folders
slide-21
SLIDE 21

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 21/29

Remote-Filesystem-View

  • when connected

io-settings will show remote paths in FileDialog

slide-22
SLIDE 22

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 22/29

Remote-Filesystem-View

RemoteFilesystemView RemoteFilesystemClient SIJAME RemoteFilesystemServer SIJAME synchronous

remote system

  • configure visible root-folder
  • use folders:
  • <login-name>
  • common
slide-23
SLIDE 23

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 23/29

  • communication middleware SIJAME
  • problem of modal dialogs on the server
  • how to specify input files and folders for macro
  • distant input files and folders
  • run macros on a remote machine
slide-24
SLIDE 24

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 24/29

Remote-Macro-Runner Client

  • send macro +

io-settings

  • io-settings can

use remote- filesystem-view

  • asynchronous

communication

  • macro must have

return value

  • runs SIJAME

server to get answers back

slide-25
SLIDE 25

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 25/29

Remote-Macro-Runner Server

  • queue incoming

messages

  • messages are handled in

the order of arrival

  • use modal-dialog-killer
  • set io-settings from

message and execute macro

  • send answer message

with return value back to client

  • multiple clients can use the same server

in the same time

slide-26
SLIDE 26

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 26/29

Conclusions

  • communication middleware SIJAME
  • synchronous and asynchronous communication
  • problem of modal dialogs on the server
  • Modal-Dialog-Killer
  • how to specify input files and folders for macro
  • Macro_IO_Settings
  • distant input files and folders
  • Macro_IO_Settings + RemoteFilesystemView
  • run macros on a remote machine
  • RemoteMacroRunner

ImageJ server fileserver

slide-27
SLIDE 27

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 27/29

Future Work

ImageJ server fileserver

run(“Ma) RoiManag ... run(“Ma) RoiManag ...

Queue-Manager ImageJ server Queue-Manager

  • persist queue
  • distribute jobs to multiple ImageJ-servers
slide-28
SLIDE 28

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 28/29

Future Work

  • support scripts
  • Javascript and other scripting languages from FIJI
  • Visual Scripting - MRI Cell Image Analyzer
  • ImageFlow - Dr. Kai Uwe Barthel
  • handle other parameters in the same way as paths
  • gui input on client – send to server
  • secure internet communication
  • authentication, secure sockets, certificates
  • integrate into CICERO-image-database
slide-29
SLIDE 29

REMOTE IMAGEJ - volker.baecker@mri.cnrs.fr 29/29

Thank you

for your attention! Thanks to Wayne Rasband and the ImageJ-community Thanks to the MRI-team:

Pierre Travo Olivier Miquel Corine Tran-Aupiais Sylvain De Rossi, Virginie Georget, Alexandre Granier, Stephanie Vaudescal, ...