Active contour on large file


I am trying to analyse intracellular prokaryotic pathogens using ICY software protocols with 4-channels max projected tilled large images (2700 px by 3700 px) :

The type of image I want to analyse is the following :

The image comes from an LSM700. Originaly .czi format, I save a stiched max projection in tiff that I use as input in ICY.

  • Upload an original image file here directly or share via a link to a file-sharing site (such as Dropbox).
  • Share a minimal working example of your macro code.

The 4 channels are as follow :
channel 0 : extra cellular prokaryotic cells
channel 1 : eukaryotic cells plasma membrane
channel 2 : DAPI (eukaryotic cells nuclei)
channel 3 : total prokaryotic cells

The protocol allows detection of intracellular prokaryotes using spot detector on channel 0 and 3 then colocalization studio to get channel 3 specific objetcs. hk means detects nuclei to root active contour and get cell edge.

My issue is that even after overnight run, the protocol is stuck at active contour (around 2000 object to analyse). Would you have a way to handle such big files (reslice the images ?).

Have a good day :wink:


I wanted to have a look on your image to see if we can tweak / optimize the Active Contours parameters to make it faster to process your objects but i cannot download it as it requires access approval.
Also do you really need the Active Contours to segment them ? Did you give a try to HK-Means plugin ?

– Stephane

This link should work better :

I already played around with HK-mean but my signal is on membrane edge so HK mean detects patches of membrane but does not reconstitute full cells.

I tried to run the protocol on random images from the same experiment and the following (or similar) error is often returned :

java.lang.ArrayIndexOutOfBoundsException: -5
	at icy.type.collection.array.Array1DUtil.setValue(
	at icy.type.collection.array.Array1DUtil.setValue(
	at icy.type.collection.array.Array1DUtil.setValue(
	at plugins.adufour.activecontours.Polygon2D.toSequence(
	at plugins.adufour.activecontours.ActiveContours.storeResult(
	at plugins.adufour.activecontours.ActiveContours.execute(

It seems that the active contour parameter “amount of iteration” is involved because when I lower it around 1000 iterations, some images are processed. It looks like that when the amount of iterations is set too high, the rendered area goes beyond the limit of the images for some reasons.

I made some tests with your image and well, it’s a difficult one to be honest :sweat_smile:
First because of the signal of the membrane staining means that indeed we require to use the active contours to sort out segmentation of cell body. And also because of the number of cell to segment at once, 2000 objects is a lot for Active Contours which is really a heavy beast that we generally use on 5-30 cells at once.
I tried to play with your image to see if i can get some results and here’s what i got (using a median filter first) on a limited section of your image (to reduce computing time):

Results are not really good but given the input image i don’t know how much better we can get from it. At least using that parameters (with 2500 iterations max) should provide much faster processing time and avoid the weird issues you obtained (probably because some ROIs were going far outside the image area).
Sorry to not have better to propose… Still i don’t know all tools in Icy so maybe some people will have better ideas than using AC here.


– Stephane

1 Like