Turn off Image Pyramid Generation or Add Channels more that two images at a time?

Discuss questions and projects related to processing of imaging data here
Post Reply
user-6685
Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Turn off Image Pyramid Generation or Add Channels more that two images at a time?

Post by user-6685 »

Does anyone know of a way to turn off the automatic Image Pyramid generation in Zen that occurs every time a new image is generated? Specifically, I am running some macros that generate several threshold images and working towards generating a 20-channel image for subsequent complex analysis. Because Zen only lets you merge two images at a time (Add Channels), each merge involves generating an Image Pyramid for progressively larger and larger images (more channels), so tons of processing time spend on generating Image Pyramids for intermediate images that are discarded at the end of the script run. Not opening the images doesn't help, as Image Pyramid runs on any images temporarily stored in the RAM / buffer.

Alternatively, if there was a way to use ADD CHANNELS or a similar command to merge multiple images at once into one multi-channel image, I would only have to generate the Image Pyramid for the final output, 20-channel image (which I am saving).

Thanks for your help.
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

Dear Jason Dugas,

first of all, there is a very general way to suppress pyramid calculation:

Code: Select all

Zen.Processing.Options.IsImagePyramidEnabled = False
second, there are some alternatives to add channels

Code: Select all

image3 = Zen.Processing.Utilities.AddChannels(image1, image2)

image.AddChannel(image1)

Image.AddSubImage(image1, ...)
I hope that these aspects can help you.
user-6685
Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Sadly these solutions didn't work

Post by user-6685 »

Thanks for the suggestions. Unfortunately, these solutions didn't work for me.

The IsImagePyramidEnabled function only turns off Image Pyramid generation for mid-sized images. Large images (which are what are slowing me down) are still getting Image Pyramid calculation (and that is what the Macro Object Model help states as well).

For the suggested alternatives to AddChannels, all of those still only add ONE channel at a time. I was hoping there was a solution to add MULTIPLE, differently-named channels to an existing image all at once.

Thanks in advance for any other suggestions.

Jason
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

IsImagePyramidEnabled
Dear Jason Dugas,

we are planning a Hotfix so that IsImagePyramidEnabled will work independent of the image size.

Do you work with Zen blue 2.6 or is it possible for you to upgrade to this version?
user-6685
Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Post by user-6685 »

I should be upgrading to 2.6 in the very near future, so that would be great. Do you know if there is any way to do the Add Channels (or similar function) with more than 2 images at a time? That would also be awesome and very useful.

Thanks for the heads up!

Jason
user-4
Posts: 397
Joined: Thu Jan 01, 1970 1:00 am

Post by user-4 »

having a way to Add more than 2 images
The bottlenecks are reading, pixel access and writing.

Therefore no real gain is expected when doing this process with multiple images at a time.
Post Reply