imexpr?
douglas brenner wrote on Oct 08, 2008
Starting with a set of images, I want to construct an image in which each pixel has either the minimum or maximum value for that pixel in the original set.
I could use imexpr but I don't see any way other than to use it in a loop, one image at a time. Can I do it with a list and a single call?
Thanks
I could use imexpr but I don't see any way other than to use it in a loop, one image at a time. Can I do it with a list and a single call?
Thanks
Francisco Valdes wrote on Oct 08, 2008
You are correct that imexpr does not work on lists. This is, in part, because of the complexity of each operand also needing to be a list. There are, of course, various ways to accomplish what you want with different levels of scripting and different tasks.
If I understand your need, you want to find the maximum/minimum across a set of images. This is not what tasks like IMEXPR, IMARITH, or IMFUNC are meant to do. The main task that considers an ensemble of images is IMCOMBINE. IMCOMBINE would do want you want, though I think you need to know in advance how many images there are. Suppose you have 20 images and want to compute the maximum:
The minmax algorithm rejects the nlow and nhigh pixels and forms the average of the rest. In the usage above we simply tell it to reject all but one of the lowest values which is the same as finding the maximum.
I can't think of anything else that is as appropriate or that doesn't require a loop or many arguments. For IMEXPR you would need to list out eaach image as an input operand:
The order of the arguments is important consisting of expression, output, and then the images which are appear as a-p in the expression.
If you would like other suggests let me know. Or if I misunderstood what you want to compute.
Yours,
Frank Valdes
If I understand your need, you want to find the maximum/minimum across a set of images. This is not what tasks like IMEXPR, IMARITH, or IMFUNC are meant to do. The main task that considers an ensemble of images is IMCOMBINE. IMCOMBINE would do want you want, though I think you need to know in advance how many images there are. Suppose you have 20 images and want to compute the maximum:
imcombine @images.list maximage reject=minmax nlow=19 nhigh=0
The minmax algorithm rejects the nlow and nhigh pixels and forms the average of the rest. In the usage above we simply tell it to reject all but one of the lowest values which is the same as finding the maximum.
I can't think of anything else that is as appropriate or that doesn't require a loop or many arguments. For IMEXPR you would need to list out eaach image as an input operand:
imexpr "max(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)" maximage image1 image2 image3 ...
The order of the arguments is important consisting of expression, output, and then the images which are appear as a-p in the expression.
If you would like other suggests let me know. Or if I misunderstood what you want to compute.
Yours,
Frank Valdes
douglas brenner wrote on Oct 08, 2008
Thanks, I'll give it a try.
Last post on Oct 08, 2008