Kevin Mader, Maria Büchner
20 March 2014
ETHZ: 227-0966-00L
Once you have logged in
Open Matlab
Type in the following commands exactly!
This will start Fiji
In Matlab run the following code Copy / Paste from Here
cd('~')
unzip('http://jenkins.imagej.net/job/Stable-Fiji/lastSuccessfulBuild/artifact/fiji-nojre.zip','./')
addpath 'Fiji.app/scripts'
Miji % start Miji
cd('~')
% to test if it works
% Miji_Test
If the Java Heap Space is not high enough strange error messages may appear. Increase the Java Heap Space using the preferences (in this movie)
Pushing Matlab Images to ImageJ
% random 500 x 500 array
imData=rand(500);
MIJ.createImage('test',imData,true);
Reading Images from FIJI to Matlab
MIJ.run('Embryos (42K)');
imData = MIJ.getCurrentImage;
% take the sum of red, green, and blue
imSum = sum(double(imData(:,:,1)),3);
subplot(1,2,1)
imagesc(imSum);
subplot(1,2,2);
imagesc(imSum<150)
FIJI has a built in basic particle analyzer in the Analyze_\( \rightarrow \) _Analyze Particles… menu and the Set Measurements… menu.
This is used to specify what the particle analyzer does when it runs on an image, the settings we use for this exercise are:
MIJ.run('Set Measurements...', 'area centroid perimeter bounding fit shape stack redirect=None decimal=3');
Which mean calculate area, centroid (center of volume), perimeter, bounding box, fit an ellipse, shape metrics, stack (keep the z position).
MIJ.run('Analyze Particles...', 'show=Ellipses display clear');
These settings are more basic and just show the ellipse fits in a new window, display the results in a table, and clear after runing.
Download the new image generator function and save (right click raw and then click “Save Link As”) it in your home directory cell_simulator.m to generate images with varying parameters (keep noise at 0 and illumination at 1 for now)
cell_radius_std=0
how does the angle compare now? Why?Using the following code as a starting point, can you write your own function to perform the shape analysis within Matlab.
diag(1:20)
)You need to have Java3D installed so it will not work on the tardis (computer lab) machines, but it should work on your personal computer
The following python script / Paraview state file (they perform the same task but one is more of a macro while the other is a saved state file) show how to use the “Threshold” and “Extract Surface” commands to get meshes from voxel data.
FIJI has a more advcaned built in “3D Object Counter” in the Analyze_\( \rightarrow \) _3D Object Counter menu. It has a number of options built into the function itself, it also has an option item (3D OC Options) where even more parameters can be adjusted
MIJ.run('3D Objects Counter', 'threshold=128 slice=0 min.=0 objects surfaces centroids centres_of_masses statistics summary');
MIJ.run('3D OC Options', 'volume surface nb_of_obj._voxels nb_of_surf._voxels integrated_density mean_gray_value std_dev_gray_value median_gray_value minimum_gray_value maximum_gray_value centroid mean_distance_to_surface std_dev_distance_to_surface median_distance_to_surface centre_of_mass bounding_box dots_size=5 font_size=10 show_numbers white_numbers store_results_within_a_table_named_after_the_image_(macro_friendly) redirect_to=none')
Video Instructions Additional more detailed Web Instructions
Tensor Glyph Plugin can be used to visualize tensor, in particular the shape tensor. Specific instructions for setting this plugin up on a Mac are here