Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
CourseMaterialImageAnalysis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scientific Computing
bioimage_team
CourseMaterialImageAnalysis
Commits
deaed8cd
Commit
deaed8cd
authored
Sep 10, 2019
by
walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Macro basics tutorial for 2019-09
parent
c7e6bd5b
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
317 additions
and
0 deletions
+317
-0
Tutorial_2019_IJMacroBascis1_3h/Tutorial_IJMacrosBasics1_2019-09-17.pptx
...JMacroBascis1_3h/Tutorial_IJMacrosBasics1_2019-09-17.pptx
+0
-0
Tutorial_2019_IJMacroBascis1_3h/data/download_from_registration_webpage.txt
...croBascis1_3h/data/download_from_registration_webpage.txt
+0
-0
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/good_comments.ijm
...acroBascis1_3h/macros/1_language_basics/good_comments.ijm
+20
-0
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/string_variables.ijm
...oBascis1_3h/macros/1_language_basics/string_variables.ijm
+11
-0
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/variables.ijm
..._IJMacroBascis1_3h/macros/1_language_basics/variables.ijm
+10
-0
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/image_statistics.ijm
...cis1_3h/macros/3_working_with_images/image_statistics.ijm
+13
-0
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/read_image_properties.ijm
...3h/macros/3_working_with_images/read_image_properties.ijm
+15
-0
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/stack_navigation.ijm
...cis1_3h/macros/3_working_with_images/stack_navigation.ijm
+11
-0
Tutorial_2019_IJMacroBascis1_3h/macros/4_customizing_macros/custom_parameters.ijm
...cis1_3h/macros/4_customizing_macros/custom_parameters.ijm
+16
-0
Tutorial_2019_IJMacroBascis1_3h/macros/5_loops/process_folder.ijm
..._2019_IJMacroBascis1_3h/macros/5_loops/process_folder.ijm
+13
-0
Tutorial_2019_IJMacroBascis1_3h/macros/5_loops/simple_loop.ijm
...ial_2019_IJMacroBascis1_3h/macros/5_loops/simple_loop.ijm
+14
-0
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/analyze_blobs.ijm
...croBascis1_3h/macros/input_to_exercises/analyze_blobs.ijm
+16
-0
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/segment_cells_input_for_generalization.ijm
...t_to_exercises/segment_cells_input_for_generalization.ijm
+23
-0
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/troubleshooting_error_message.ijm
...cros/input_to_exercises/troubleshooting_error_message.ijm
+5
-0
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/troubleshooting_with_code_highlights.ijm
...put_to_exercises/troubleshooting_with_code_highlights.ijm
+9
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/first_example.ijm
...Bascis1_3h/macros/solution_to_exercises/first_example.ijm
+9
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/multichannel_image_luts.ijm
.../macros/solution_to_exercises/multichannel_image_luts.ijm
+31
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/open_and_save.ijm
...Bascis1_3h/macros/solution_to_exercises/open_and_save.ijm
+12
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/process_folder_multichannel_images.ijm
...ution_to_exercises/process_folder_multichannel_images.ijm
+42
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/segment_cells.ijm
...Bascis1_3h/macros/solution_to_exercises/segment_cells.ijm
+18
-0
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/segment_cells_generalized.ijm
...acros/solution_to_exercises/segment_cells_generalized.ijm
+29
-0
No files found.
Tutorial_2019_IJMacroBascis1_3h/Tutorial_IJMacrosBasics1_2019-09-17.pptx
0 → 100755
View file @
deaed8cd
File added
Tutorial_2019_IJMacroBascis1_3h/data/download_from_registration_webpage.txt
0 → 100644
View file @
deaed8cd
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/good_comments.ijm
0 → 100755
View file @
deaed8cd
// This program is our second example.
// It sums up two numbers.
//
// Usage:
// * Run it in FIJI (www.fiji.sc)
//
// Author: Robert Haase, MPI CBG,
// rhaase@extern.mpi-cbg.de
// July 2016
// initialise program
a = 1;
b = 2.5;
// run complicated algorithm
final_result = a + b;
print( final_result );
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/string_variables.ijm
0 → 100755
View file @
deaed8cd
// initialise program
firstname = "Robert";
lastname = "Haase";
// run complicated algorithm
name = firstname + " " + lastname;
// show the result
print("Hello " + name + "!");
Tutorial_2019_IJMacroBascis1_3h/macros/1_language_basics/variables.ijm
0 → 100755
View file @
deaed8cd
// initialise program
a = 1;
b = 2.5;
// run complicated algorithm
c = a + b;
// show the result
print(c);
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/image_statistics.ijm
0 → 100755
View file @
deaed8cd
// initialise program
imageFilename = "blobs.gif";
open( imageFilename );
// get image statistics
getStatistics(area, mean, min, max, std);
// show results
print("The grey value ranges from " + min + " to " + max + ". ");
print("It has an average of " + mean + " +- " + std + ". ");
close();
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/read_image_properties.ijm
0 → 100755
View file @
deaed8cd
// initialise program
imageFilename = "blobs.gif";
open( imageFilename );
// read image properties
width = getWidth();
height = getHeight();
getPixelSize(unit, pixelWidth, pixelHeight);
// show results
print("The image is " + width + " times " + height + " pixels wide");
print("Each pixels has a size of " + pixelWidth +
" times " + pixelHeight + " " + unit + "^2");
close();
Tutorial_2019_IJMacroBascis1_3h/macros/3_working_with_images/stack_navigation.ijm
0 → 100755
View file @
deaed8cd
//open an image from the web
run("Fluorescent Cells (400K)");
// get all dimensions
Stack.getDimensions(width, height, channels, slices, frames);
print("channels: " + channels + ", slices: " + slices + ", frames: " + frames );
// set the channel
Stack.setChannel(2);
// alternative:
Stack.setPosition(2,1,1);
Tutorial_2019_IJMacroBascis1_3h/macros/4_customizing_macros/custom_parameters.ijm
0 → 100755
View file @
deaed8cd
// blurs an image and finds maxima
// the user can specify the blurring strength and prominence of the maxima finder.
// specify custom parameters
sigma=2;
maximaProminence=10;
// run processing pipeline
run("Blobs (25K)");
run("Gaussian Blur...", "sigma="+sigma);
run("Find Maxima...", "prominence="+maximaProminence+" light output=[Point Selection]");
print("blur parameter: "+ sigma);
print("maxima prominence parameter: "+maximaProminence);
Tutorial_2019_IJMacroBascis1_3h/macros/5_loops/process_folder.ijm
0 → 100755
View file @
deaed8cd
// initialise program
foldername = "/Users/walker/Desktop/macrocourse_data/";
// get all files in the folder as list
list = getFileList( foldername );
// print out the list; item by item
for (i = 0; i < list.length; i++) {
filename = list[i];
print( filename );
}
Tutorial_2019_IJMacroBascis1_3h/macros/5_loops/simple_loop.ijm
0 → 100755
View file @
deaed8cd
// example of a simple for loop
// do something once
print("Getting started");
//loop
for (i = 0; i < 10; i++) {
print("We are now in loop: "+i);
wait(100); // not needed. just for illustration
}
//finish up
print("Concluding remarks.");
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/analyze_blobs.ijm
0 → 100755
View file @
deaed8cd
// This macro segments and analyzes the particles of the Blobs image.
//
// author: Noreen Walker, MPI-CBG, walker@mpi-cbg.de
// September 2019
// download from the web
run("Blobs (25K)");
// segment the image
setAutoThreshold("Default");
run("Convert to Mask");
// get size statistics
run("Set Measurements...", "area redirect=None decimal=3");
run("Analyze Particles...", "size=20-Infinity display exclude clear");
\ No newline at end of file
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/segment_cells_input_for_generalization.ijm
0 → 100755
View file @
deaed8cd
// Segments cells in the current image, then analyzes particles.
// This macro is very specific to the image name.
// author: Noreen Walker , SCF-MPI-CBG, 2019-09
// here: introduce a variable saveDir
// duplicate so that we still keep the original for intensity measurements
run("Duplicate...", " ");
// segmentation
run("Gaussian Blur...", "sigma=1");
setAutoThreshold("Otsu dark");
run("Convert to Mask");
run("Watershed");
// set the measurements and analyse particles.
run("Set Measurements...", "area mean redirect=cells1.tif decimal=3");
run("Analyze Particles...", "size=20 pixel display exclude clear");
// here: save the results table
\ No newline at end of file
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/troubleshooting_error_message.ijm
0 → 100755
View file @
deaed8cd
Sentence = "Can you can a can as a canner can can a can?";
if (startsWith(Sentence, "Can") {
print(sentence);
}
\ No newline at end of file
Tutorial_2019_IJMacroBascis1_3h/macros/input_to_exercises/troubleshooting_with_code_highlights.ijm
0 → 100755
View file @
deaed8cd
a = 5;
b = 7;
sum = a + b;
ratio = a / b;
print("The sum is + sum);
print("The ratio is " + ratio);
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/first_example.ijm
0 → 100755
View file @
deaed8cd
//
// This program is our first example
//
// Author: Robert Haase, MPI-CBG,
// rhaase@mpi-cbg.de
// July 2015
print("Hello world");
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/multichannel_image_luts.ijm
0 → 100755
View file @
deaed8cd
// Changes the LUT of a 3-channel image and creates a RGB image of the channel 1 and 3.
// author: Noreen Walker , SCF-MPI-CBG, 2019-09
// set parameters
inputFile="/Users/walker/Desktop/macrocourse_data/Cells_image0.tif";
saveDir="/Users/walker/Desktop/macrocourse_results/"
// start processing
open(inputFile);
imageName=getTitle();
run("Split Channels");
// process channel 1
selectWindow("C1-"+imageName);
run("Magenta");
run("Enhance Contrast", "saturated=0.35");
//process channel 3
selectWindow("C3-"+imageName);
run("Cyan");
run("Enhance Contrast", "saturated=0.35");
// merge and save
run("Merge Channels...", "c1=C1-"+imageName+" c3=C3-"+imageName+" create");
run("RGB Color");
saveAs("tif", saveDir+"TwoChannels_"+imageName);
run("Close All");
\ No newline at end of file
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/open_and_save.ijm
0 → 100755
View file @
deaed8cd
// opens an image and saves it again under a different name
// auhor: Noreen Walker, SCF MPI-CBG, September 2019
inputFileName="/Users/walker/Desktop/macrocourse_data/cells1.tif";
open(inputFileName);
// save the image under a different name
saveFileName="/Users/walker/Desktop/macrocourse_results/myGreatNewName.tif";
save(saveFileName);
// rename the open image instead
rename("AnotherTitle");
\ No newline at end of file
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/process_folder_multichannel_images.ijm
0 → 100755
View file @
deaed8cd
// Processes a folder of images. For each image the macro
// changes the LUT of a 3-channel image and creates a RGB image of the channel 1 and 3.
// author: Noreen Walker , SCF-MPI-CBG, 2019-09
// set parameters
inputDir="/Users/walker/Desktop/macrocourse_data/batchdata/";
saveDir="/Users/walker/Desktop/macrocourse_results/"
fileList=getFileList(inputDir);
for (i = 0; i < lengthOf(fileList); i++) {
fileName=fileList[i];
print("Processing file: "+fileName);
open(inputDir+fileName);
// from here on: the macro is unchanged
imageName=getTitle();
run("Split Channels");
// process channel 1
selectWindow("C1-"+imageName);
run("Magenta");
run("Enhance Contrast", "saturated=0.35");
//process channel 3
selectWindow("C3-"+imageName);
run("Cyan");
run("Enhance Contrast", "saturated=0.35");
// merge and save
run("Merge Channels...", "c1=C1-"+imageName+" c3=C3-"+imageName+" create");
run("RGB Color");
saveAs("tif", saveDir+"TwoChannels_"+imageName);
run("Close All");
}
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/segment_cells.ijm
0 → 100755
View file @
deaed8cd
// Segments cells in the current image, then analyzes particles.
// This macro is very specific to the image name.
// solution to exercise.
// author: Noreen Walker , SCF-MPI-CBG, 2019-09
// duplicate so that we still keep the original for intensity measurements
run("Duplicate...", " ");
// segmentation
run("Gaussian Blur...", "sigma=1");
setAutoThreshold("Otsu dark");
run("Convert to Mask");
run("Watershed");
// set the measurements and analyse particles.
run("Set Measurements...", "area mean redirect=cells1.tif decimal=3");
run("Analyze Particles...", "size=20-Infinity pixel show=[Count Masks] display exclude clear summarize");
Tutorial_2019_IJMacroBascis1_3h/macros/solution_to_exercises/segment_cells_generalized.ijm
0 → 100755
View file @
deaed8cd
// Segments cells in the current image, then analyzes particles.
// This macro is can run on an image with arbitrary name
// author: Noreen Walker , SCF-MPI-CBG, 2019-09
// here: introduce a variable saveDir
saveDir="/Users/walker/Desktop/";
imageName=getTitle();
// duplicate so that we still keep the original for intensity measurements
run("Duplicate...", " ");
// segmentation
run("Gaussian Blur...", "sigma=1");
setAutoThreshold("Otsu dark");
run("Convert to Mask");
run("Watershed");
// set the measurements and analyse particles.
run("Set Measurements...", "area mean redirect=" + imageName + " decimal=3");
run("Analyze Particles...", "size=20 pixel display exclude clear");
// here: save the results table
saveAs("Results", saveDir+imageName+"_Results.csv");
// non-generic would be: saveAs("Results", "/Users/walker/Desktop/Results.csv");
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment