3D ROI Manager measurements multi channel

fiji
3d
imagej

#1

Hi all,

I’m struggling with the 3D ROI Manager using the macro language.

What I want is to have the 3D quantification measurements on multi channels, is there no other way to get it other than selecting the channel and measuring one by one ?

Thanks for the help.


#2

Hi @lguerard,

3D manager is not very good with multi-channel or multi-frames images. The idea is to split your channels, extract your objects in one channel and then do the quantification in other channels. Using macro it is fairly easy, here an example:

// use plugins/macros/record to record the necessary opening and channel splitting
// 3 images are opened in this example : labels.tif with segmented object, C1-signal.tif and C2-signaltif with signal to quantify
// select measurments in Manager3D Options, select Plugins/Record to record
run("3D Manager Options", "volume integrated_density mean_grey_value std_dev_grey_value mode_grey_value minimum_grey_value maximum_grey_value distance_between_centers=10 distance_max_contact=1.80 drawing=Contour");// run the manager 3D and add image
run("3D Manager");
// select the image with the labelled objects
selectWindow("labels.tif");
Ext.Manager3D_AddImage();
// do some quantifications, save measurements and close window
selectWindow("C1-signal.tif");
Ext.Manager3D_Quantif();
Ext.Manager3D_SaveResult("Q","/home/boudier.t/C1-Quantif3D.csv");
Ext.Manager3D_CloseResult("Q");
selectWindow("C2-signal.tif");
Ext.Manager3D_Quantif();
Ext.Manager3D_SaveResult("Q","/home/boudier.t/C2-Quantif3D.csv");
Ext.Manager3D_CloseResult("Q");
// Use Q for the Quantification window, D for distances, C for colocalisation, L or V for list voxels and A for All windows
// if list is not visible please refresh list by using Deselect
//Ext.Manager3D_Select(0);
//Ext.Manager3D_DeselectAll();

Hope this helps,

Best,

Thomas


#3

Hi @ThomasBoudier,

Thanks a lot for that, ok so I would have to loop through all the channels, got it thanks.

Do you know if there’s a way to get the 3D Quantification results (something like getResults()) from a macro in order to put it in a “classical” result table so I could put C1 and C2 on the same line ?

Thanks a lot :slight_smile:


#4

Hi @lguerard,

You can get a macro example (quantif 2) where you can loop over the objects to get the results and create a custom ResultsTable :

Example macros for 3D manager

Best,

Thomas


#5

Thanks @ThomasBoudier, I managed to get everything I wanted like that and create a ResultsTable easily :slight_smile:


#6

Hi @ThomasBoudier

Sorry for still asking questions but for another project I managed to get everything working using the 3D iterative thresholding and the 3D watershed.

Is there some documentation about using it in Jython ? Otherwise I can use IJ.run since it’s macro recordable but wanted to know if there was a subtler way to do it :slight_smile: .

Thanks again.


#7

Hi @lguerard,

I am not python expert but I think the best way to do is to use the corresponding java classes. I may suggest you to have a look at the code for the 3D suite plugins to see how to use it as a library. Here an example in BeanShell for Watershed3D :

import mcib3d.image3d.processing.FastFilters3D;
import mcib3d.image3d.regionGrowing.Watershed3D;
import ij.*;

plus=WindowManager.getCurrentImage();
stack=plus.getImageStack();
// get local maxima as seeds
rx=4;
ry=4;
rz=2;
stack2=FastFilters3D.filterImageStack(stack,FastFilters3D.MAXLOCAL,rx,ry,rz,0,false);
plus2=new ImagePlus("seeds",stack2);
plus2.show();
// watershed
voxels_threshold=1000;
seeds_threshold=5000;
Watershed3D water = new Watershed3D(stack, stack2, voxels_threshold, seeds_threshold);
plus3=water.getWatershedImage3D().getImagePlus();
plus3.show();

#8

and another one for Iterative thresholding :

import mcib3d.image3d.IterativeThresholding.TrackThreshold;
import ij.*;

// get current image
plus=WindowManager.getCurrentImage();
// init the iterative thresholding
volMin=10; // minimum volume
volMax=1000; // maximum volume
minCont=0; // min contrast
step=1; // check threshold every step 
thmin=50; // minimum threshold to start = background noise
IT = new TrackThreshold(volMin, volMax, minCont, step, step, thmin);
// various methods
tmethod = TrackThreshold.THRESHOLD_METHOD_STEP; // check threshold every step 
IT.setMethodThreshold(tmethod);
cri = TrackThreshold.CRITERIA_METHOD_MIN_ELONGATION; // favours less elongated objects = rounder objects
IT.setCriteriaMethod(cri);
// segment best objects, else use segment(..)
res = IT.segmentBest(plus, true);
res.show();