Skip to next in a Icy protocol Range Loop


in an Icy protocol I am processing z-slices in a Range Loop to analyze the ROIs defined on them. For some good reasons a few slices do not have ROIs: is there a possibility to skip to the next index to process the subsequent slice ?

One alternative I see is to first loop through the slices and retain the indices of those featuring ROIs in a list and then loop over that.

Thanks already for any help on this.

Dear Gucki,

Could you please post a representative Z-stack and your Icy protocol in order to clarify your question?

If you don’t absolutely need to process the Z-stack slice by slice, the ROI statistics blocks extracts directly information from all ROIs of a given Z stack including their Z position (you can add it with “Select features…”).
I join a snapshot of the corresponding protocol and the corresponding test stack.

test_stack.tif (7.5 MB)

@imagejan : Icy protocols use the .protocol extension… Would it be possible to add this extension to the list of files that can be uploaded on the forum? Many thanks in advance!

Best regards,

Good idea, I just added protocol to the list of authorized extensions on this forum, so you should now be able to upload Icy protocols.

While we’re at it: are the #icy folks considering joining this forum as a community partner any time soon?


Hi Marion,

thanks for your reply! Finally I have an image and the central part of my current protocol to illustrate (attached zip file).

For now I go the “alternative” way to check which slice contains a ROI. The attached protocol contains a bit more to get to that point: first the image is thresholded and only the largest ROI is retained. Then I convert the (3D-) ROI to a sequence, check and note where ROIs are and then iterate over just the “interesting” slices. Within the loop there is an ActiveContour box - just to do something with the slices (the actual protocol is a bit more complex, but works fine so far).

Thanks again,
Ekkehard (2.7 MB)

Dear @Gucki,

Many thanks for sending a simplified version of your protocol and a test image, this is really helpful.

To loop on an array of ROIs, I suggest to use the Batch block. I join an example of protocol (21.6 KB) that runs on your test image and a screenshot of it. Instead of looping on the slices, it loops on the ROIs.

Does it answer your question?

Best regards,

Dear @imagejan,

Many thanks for adding the .protocol to the list of extensions!
We, the #icy folks have a meeting this week to discuss about our communication channels, notably this forum. We’ll likely come back to you soon.

Best regards,