SlideShare a Scribd company logo
1 of 36
Download to read offline
ImageJ 2013
Advanced topics
José María Mateos, Javier Pascau
{jmmateos,jpascau}@hggm.es
bout these slides
ese slides contain the contents of the ImageJ
rse taught at the Universidad Carlos III de Madrid
p://www.uc3m.es) on December 2013.
d course is based on the book “Image Processing
h ImageJ”, Packt Publishing, 2013, by José María
eos and Javier Pascau
p://www.packtpub.com/image-processing-with-
gej/book.)
ese slides are published under a Attribution
ative Commons License. You are free to copy and
stribute the material in any medium or format and
emix, transform, and build upon the material for
purpose, even commercially.
dex
The particle analyzer.
Macros.
Plugins.
article Analyzer
How many particles…?
article Analyzer
Solution 1: count by hand (no!)
Solution 2: Analyze | Analyze Particles…
Typical workflow:
a. Convert to grayscale (16-bit, 8-bit).
b. Filter noise and remove background (if needed).
c. Threshold (make binary).
d. Morphological operation (optional, typical:
watershed).
e. Run Particle Analyzer.
article Analyzer
acros
A macro is a sequence of operations
performed on a image (from filtering to ROI
drawing, to measurements, type conversion,
stack processing… almost anything).
Macros are useful for repeatability, batch
processing, automation of repetitive tasks.
acros and plugins: differences
A macro contains operations already
present in ImageJ. A plugin adds new
functionality to ImageJ.
A macro can be created without any
programming knowledge. A plugin needs
Java programming knowledge.
A macro is (relatively) slow. A plugin is
immensely faster.
acros: the easy way
A macro can be created simply by recording
the different processing options while they
are being made.
Also, there is a macro language
(programming!) that adds useful features
and can be used to complement the
recorder.
he macro recorder
The recorder window is opened in Plugins |
Macros | Record…
This window will list all the commands used
during the session.
he macro recorder
omment
Example: open sample image “Dot Blot”,
draw a line across the second row, then plot
the profile.
Parameters are stored
he macro recorder
After clicking on the Create button, a text
editor appears. Its contents come from the
recorder window and can be edited.
he macro recorder
We can then save the macro file (with
whatever name we want) from File | Save
As… from the text editor.
Saved macros can be run directly from
Plugins | Macros | Run…. They can also be
dragged & dropped into the main ImageJ
window and the text editor will open them.
he macro recorder
If you close all image windows (the “Dot blot”
image and the profile) and click on Macros |
Run Macro or CTRL + R on the editor...
he macro recorder
Once recorded, we can modify the resulting
macro to change different parameters.
It is important to add comments to
macros.
o A comment is a line that begins with // and contains
an explanation about what the macro does in plain
language.
he macro language
Two fundamental resources:
o http://rsb.info.nih.gov/ij/developer/macro/macros.html
o http://rsb.info.nih.gov/ij/developer/macro/functions.html
These two links contain all the relevant
information regarding macro development.
Also: take a look at what others did before
you:
o http://rsb.info.nih.gov/ij/macros/
o Ej: OpenDialogDemo.txt
he macro language
Hello world” under ImageJ:
he macro language
Syntax similar to Javascript / Java.
Available operators:
o The usual math (+,-,*,/,%).
o for / while / do - while loops.
o if - else blocks.
Softly typed variables (implicit types).
May declare new functions.
o function test(a, b, c) { … }
xample: print numbers 1 - 10
for (i = 1; i <= 10; i++) {
print(i);
}
xample: print even numbers 1 - 10
for (i = 1; i <= 10; i++) {
if (i % 2 == 0) {
print(i);
}
}
he macro language
Variables can be used in the ImageJ
commands.
For non-programmers: a variable is a name
that we give to a certain value.
edian_radius = 20;
un("Median...", "radius=&median_radius");
/ Another way:
/ run("Median...", "radius="+median_radius);
he macro language
In strings, the “+” operator concatenates
values.
This is useful when generalizing macros.
= "This is a string";
rint(a);
= a + ". And this is another string";
rint(b);
he macro language
Arrays: special type of variable that may hold
several values.
myArray = newArray(10);
// When created, all values are 0
for (i = 0; i < myArray.length; i++) {
print(myArray[i]);
}
// We can fill in its values just like
// any other variable
for (i = 0; i < myArray.length; i++) {
myArray[i] = i;
// myArray[0] = 0;... and so on
}
// Let's print the new values
for (i = 0; i < myArray.length; i++) {
print(myArray[i]);
}
eating a GUI
Editing variable values directly on the code
is not the best way to work.
You can easily create graphical user
interfaces (GUIs) to ask the user for
parameter values.
Check the documentation for the Dialog
functions.
portant considerations
A macro is always applied to the active
(selected) image.
To change between open images, use the
selectWindow(name) or selectImage(id)
functions. Get names and IDs with getTitle()
and getImageID().
A new image is always selected. Typical
workflow: open image → get name for later
use.
he batch mode
Ok, you have written your macro. You can
apply it to a single image.
How do you apply it to a whole folder?
Solution: the batch mode.
Another solution: iterate through the different
files (you will do that during the practice
sessions).
he batch mode
In Process | Batch | Macro… you can copy &
paste the code of a macro file and select
input and output directories.
ugins
As said before, a plugins add new
functionalities to ImageJ.
Several plugins are already included by
default (check the plugins/ folder).
Many different plugins available to users.
Check Fiji or a more-or-less official listing at
http://rsb.info.nih.gov/ij/plugins/
stalling a plugin
You should refer to the specific plugin
documentation.
In any case, most times it is straightforward:
just copy the .class or .jar file into the
plugins/ folder (or a subfolder) of your
ImageJ installation and restart ImageJ.
ugin structure
ome interesting plugins
LOCI Bioformats.
Auto Threshold.
Volume Viewer.
JACoP (a compilation of colocalisation
tools).
Trainable Weka Segmentation.
OCI Bioformats
http://loci.wisc.edu/software/bio-formats
This plugin opens dozens of different image
formats that are not supported by ImageJ
natively.
Example: .lei files (Leica microscopes).
Already included in Fiji.
uto Threshold
http://fiji.sc/wiki/index.php/Auto_Threshold
olume Viewer
http://rsb.info.nih.gov/ij/plugins/volume-viewer.html
ACoP
http://rsb.info.nih.gov/ij/plugins/track/jacop.html
Compilation of co-localization tools.
ainable Weka Segmentation
http://fiji.sc/Trainable_Weka_Segmentation
Applies machine learning techniques to
image segmentation procedures.
The segmenter learns how to separate
different image regions and applies that
gained knowledge automatically.

More Related Content

What's hot (19)

ENVI Pocket Guide: Volume 2 | Intermediate
ENVI Pocket Guide: Volume 2 | IntermediateENVI Pocket Guide: Volume 2 | Intermediate
ENVI Pocket Guide: Volume 2 | Intermediate
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
M14 overview
M14 overviewM14 overview
M14 overview
 
ENVI basic function overview
ENVI basic function overviewENVI basic function overview
ENVI basic function overview
 
Classification methods envi
Classification methods enviClassification methods envi
Classification methods envi
 
Gimp 2
Gimp 2Gimp 2
Gimp 2
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
ENVI Pocket Guide: Volume 1 | Basics
ENVI Pocket Guide: Volume 1 | BasicsENVI Pocket Guide: Volume 1 | Basics
ENVI Pocket Guide: Volume 1 | Basics
 
Computer Graphics Introduction
Computer Graphics IntroductionComputer Graphics Introduction
Computer Graphics Introduction
 
Adobe photoshop
Adobe photoshopAdobe photoshop
Adobe photoshop
 
Matlab GUI
Matlab GUIMatlab GUI
Matlab GUI
 
MXD Edit
MXD EditMXD Edit
MXD Edit
 
GUI in Matlab - 2
GUI in Matlab - 2GUI in Matlab - 2
GUI in Matlab - 2
 
Uses of 3D
Uses of 3DUses of 3D
Uses of 3D
 
Ai Test
Ai TestAi Test
Ai Test
 
Introduction to GIMP
Introduction to GIMPIntroduction to GIMP
Introduction to GIMP
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
 

Similar to Image j advanced

Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Dinh Sinh Mai
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 
CIS 407 STUDY Inspiring Innovation--cis407study.com
CIS 407 STUDY Inspiring Innovation--cis407study.comCIS 407 STUDY Inspiring Innovation--cis407study.com
CIS 407 STUDY Inspiring Innovation--cis407study.comKeatonJennings91
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1rupeshkanu
 
NCC assingment l4dc ddoocp
NCC assingment l4dc ddoocpNCC assingment l4dc ddoocp
NCC assingment l4dc ddoocpDavid Parker
 
Image processing using matlab
Image processing using matlabImage processing using matlab
Image processing using matlabdedik dafiyanto
 
Android based application for graph analysis final report
Android based application for graph analysis final reportAndroid based application for graph analysis final report
Android based application for graph analysis final reportPallab Sarkar
 
Designing A Project Using Java Programming
Designing A Project Using Java ProgrammingDesigning A Project Using Java Programming
Designing A Project Using Java ProgrammingKaty Allen
 
Safe Clearing of Private Data
Safe Clearing of Private DataSafe Clearing of Private Data
Safe Clearing of Private DataPVS-Studio
 
Design Patterns By Sisimon Soman
Design Patterns By Sisimon SomanDesign Patterns By Sisimon Soman
Design Patterns By Sisimon SomanSisimon Soman
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docxmercysuttle
 
Android memory and performance optimization
Android memory and performance optimizationAndroid memory and performance optimization
Android memory and performance optimizationveeracynixit
 

Similar to Image j advanced (20)

Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]Python imaging-library-overview - [cuuduongthancong.com]
Python imaging-library-overview - [cuuduongthancong.com]
 
CS267_Graph_Lab
CS267_Graph_LabCS267_Graph_Lab
CS267_Graph_Lab
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
CIS 407 STUDY Inspiring Innovation--cis407study.com
CIS 407 STUDY Inspiring Innovation--cis407study.comCIS 407 STUDY Inspiring Innovation--cis407study.com
CIS 407 STUDY Inspiring Innovation--cis407study.com
 
02 c++g3 d (1)
02 c++g3 d (1)02 c++g3 d (1)
02 c++g3 d (1)
 
Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1Excel Vba Basic Tutorial 1
Excel Vba Basic Tutorial 1
 
Mat-lab image processing tatorial
Mat-lab  image processing tatorialMat-lab  image processing tatorial
Mat-lab image processing tatorial
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
NCC assingment l4dc ddoocp
NCC assingment l4dc ddoocpNCC assingment l4dc ddoocp
NCC assingment l4dc ddoocp
 
Image processing using matlab
Image processing using matlabImage processing using matlab
Image processing using matlab
 
Android based application for graph analysis final report
Android based application for graph analysis final reportAndroid based application for graph analysis final report
Android based application for graph analysis final report
 
Matlab dip
Matlab dipMatlab dip
Matlab dip
 
Designing A Project Using Java Programming
Designing A Project Using Java ProgrammingDesigning A Project Using Java Programming
Designing A Project Using Java Programming
 
Safe Clearing of Private Data
Safe Clearing of Private DataSafe Clearing of Private Data
Safe Clearing of Private Data
 
Design Patterns By Sisimon Soman
Design Patterns By Sisimon SomanDesign Patterns By Sisimon Soman
Design Patterns By Sisimon Soman
 
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx1 of 6  LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docx
 
Log polar coordinates
Log polar coordinatesLog polar coordinates
Log polar coordinates
 
Android memory and performance optimization
Android memory and performance optimizationAndroid memory and performance optimization
Android memory and performance optimization
 

More from Jorge Antonio Parra Serquen (12)

Procesamiento informacion
Procesamiento informacionProcesamiento informacion
Procesamiento informacion
 
Sis percep0
Sis percep0Sis percep0
Sis percep0
 
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816 (1)
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816 (1)Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816 (1)
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816 (1)
 
Redesia2
Redesia2Redesia2
Redesia2
 
Dialnet preprocesamientodeimagenesaplicadasamamografiasdig-4829296
Dialnet preprocesamientodeimagenesaplicadasamamografiasdig-4829296Dialnet preprocesamientodeimagenesaplicadasamamografiasdig-4829296
Dialnet preprocesamientodeimagenesaplicadasamamografiasdig-4829296
 
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816
Dialnet estudio delefectodelasmascarasdeconvolucionenimagen-4902816
 
Tema4
Tema4Tema4
Tema4
 
A02v6n2
A02v6n2A02v6n2
A02v6n2
 
Segmentación por umbralización método de otsu
Segmentación por umbralización   método de otsuSegmentación por umbralización   método de otsu
Segmentación por umbralización método de otsu
 
Formato inventario 2011BBB
Formato inventario  2011BBBFormato inventario  2011BBB
Formato inventario 2011BBB
 
Servidor hpVVVV
Servidor hpVVVVServidor hpVVVV
Servidor hpVVVV
 
Linked data
Linked dataLinked data
Linked data
 

Recently uploaded

National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 

Recently uploaded (20)

National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 

Image j advanced

  • 1. ImageJ 2013 Advanced topics José María Mateos, Javier Pascau {jmmateos,jpascau}@hggm.es
  • 2. bout these slides ese slides contain the contents of the ImageJ rse taught at the Universidad Carlos III de Madrid p://www.uc3m.es) on December 2013. d course is based on the book “Image Processing h ImageJ”, Packt Publishing, 2013, by José María eos and Javier Pascau p://www.packtpub.com/image-processing-with- gej/book.) ese slides are published under a Attribution ative Commons License. You are free to copy and stribute the material in any medium or format and emix, transform, and build upon the material for purpose, even commercially.
  • 5. article Analyzer Solution 1: count by hand (no!) Solution 2: Analyze | Analyze Particles… Typical workflow: a. Convert to grayscale (16-bit, 8-bit). b. Filter noise and remove background (if needed). c. Threshold (make binary). d. Morphological operation (optional, typical: watershed). e. Run Particle Analyzer.
  • 7. acros A macro is a sequence of operations performed on a image (from filtering to ROI drawing, to measurements, type conversion, stack processing… almost anything). Macros are useful for repeatability, batch processing, automation of repetitive tasks.
  • 8. acros and plugins: differences A macro contains operations already present in ImageJ. A plugin adds new functionality to ImageJ. A macro can be created without any programming knowledge. A plugin needs Java programming knowledge. A macro is (relatively) slow. A plugin is immensely faster.
  • 9. acros: the easy way A macro can be created simply by recording the different processing options while they are being made. Also, there is a macro language (programming!) that adds useful features and can be used to complement the recorder.
  • 10. he macro recorder The recorder window is opened in Plugins | Macros | Record… This window will list all the commands used during the session.
  • 11. he macro recorder omment Example: open sample image “Dot Blot”, draw a line across the second row, then plot the profile. Parameters are stored
  • 12. he macro recorder After clicking on the Create button, a text editor appears. Its contents come from the recorder window and can be edited.
  • 13. he macro recorder We can then save the macro file (with whatever name we want) from File | Save As… from the text editor. Saved macros can be run directly from Plugins | Macros | Run…. They can also be dragged & dropped into the main ImageJ window and the text editor will open them.
  • 14. he macro recorder If you close all image windows (the “Dot blot” image and the profile) and click on Macros | Run Macro or CTRL + R on the editor...
  • 15. he macro recorder Once recorded, we can modify the resulting macro to change different parameters. It is important to add comments to macros. o A comment is a line that begins with // and contains an explanation about what the macro does in plain language.
  • 16. he macro language Two fundamental resources: o http://rsb.info.nih.gov/ij/developer/macro/macros.html o http://rsb.info.nih.gov/ij/developer/macro/functions.html These two links contain all the relevant information regarding macro development. Also: take a look at what others did before you: o http://rsb.info.nih.gov/ij/macros/ o Ej: OpenDialogDemo.txt
  • 17. he macro language Hello world” under ImageJ:
  • 18. he macro language Syntax similar to Javascript / Java. Available operators: o The usual math (+,-,*,/,%). o for / while / do - while loops. o if - else blocks. Softly typed variables (implicit types). May declare new functions. o function test(a, b, c) { … }
  • 19. xample: print numbers 1 - 10 for (i = 1; i <= 10; i++) { print(i); }
  • 20. xample: print even numbers 1 - 10 for (i = 1; i <= 10; i++) { if (i % 2 == 0) { print(i); } }
  • 21. he macro language Variables can be used in the ImageJ commands. For non-programmers: a variable is a name that we give to a certain value. edian_radius = 20; un("Median...", "radius=&median_radius"); / Another way: / run("Median...", "radius="+median_radius);
  • 22. he macro language In strings, the “+” operator concatenates values. This is useful when generalizing macros. = "This is a string"; rint(a); = a + ". And this is another string"; rint(b);
  • 23. he macro language Arrays: special type of variable that may hold several values. myArray = newArray(10); // When created, all values are 0 for (i = 0; i < myArray.length; i++) { print(myArray[i]); } // We can fill in its values just like // any other variable for (i = 0; i < myArray.length; i++) { myArray[i] = i; // myArray[0] = 0;... and so on } // Let's print the new values for (i = 0; i < myArray.length; i++) { print(myArray[i]); }
  • 24. eating a GUI Editing variable values directly on the code is not the best way to work. You can easily create graphical user interfaces (GUIs) to ask the user for parameter values. Check the documentation for the Dialog functions.
  • 25. portant considerations A macro is always applied to the active (selected) image. To change between open images, use the selectWindow(name) or selectImage(id) functions. Get names and IDs with getTitle() and getImageID(). A new image is always selected. Typical workflow: open image → get name for later use.
  • 26. he batch mode Ok, you have written your macro. You can apply it to a single image. How do you apply it to a whole folder? Solution: the batch mode. Another solution: iterate through the different files (you will do that during the practice sessions).
  • 27. he batch mode In Process | Batch | Macro… you can copy & paste the code of a macro file and select input and output directories.
  • 28. ugins As said before, a plugins add new functionalities to ImageJ. Several plugins are already included by default (check the plugins/ folder). Many different plugins available to users. Check Fiji or a more-or-less official listing at http://rsb.info.nih.gov/ij/plugins/
  • 29. stalling a plugin You should refer to the specific plugin documentation. In any case, most times it is straightforward: just copy the .class or .jar file into the plugins/ folder (or a subfolder) of your ImageJ installation and restart ImageJ.
  • 31. ome interesting plugins LOCI Bioformats. Auto Threshold. Volume Viewer. JACoP (a compilation of colocalisation tools). Trainable Weka Segmentation.
  • 32. OCI Bioformats http://loci.wisc.edu/software/bio-formats This plugin opens dozens of different image formats that are not supported by ImageJ natively. Example: .lei files (Leica microscopes). Already included in Fiji.
  • 36. ainable Weka Segmentation http://fiji.sc/Trainable_Weka_Segmentation Applies machine learning techniques to image segmentation procedures. The segmenter learns how to separate different image regions and applies that gained knowledge automatically.