Hi Martin,

Many thanks for your answer - I was actually hoping that you would respond !

I haven't studied ROI use in any detail yet, but at first glance it
doesn't seem to be as integrated into JAI operations as I thought it
would be.  But I'll look into it more.

I think I'll try your suggestion of extending AreaOpImage to combine
the steps in the masking and convolution process.  At some stage I'll
be working with large grid coverages so avoiding the overhead of
intermediate images would be very useful.  I'll let you know how I go
!

As an aside, I created a sub-class of GridCoverage2D to make it easier
to work with data that change frequently.  It caches new pixel values
until the coverage is queried, or the cache is full, at which time it
uses a TiledImage with the same backing data buffer as the grid
coverage and a JAI iterator to update the coverage.  This has been
working very well so far - although I saw a warning (from Andrea ?)
about using this approach a while ago.  I think it might be useful to
add some of the grid calculation methods that I'm using to this class
also, in which case it might be more generally useful for other
Geotools users.  And instead of a sub-class it could also be made into
a decorator which might be more convenient sometimes.

All the best,
Michael

2009/1/7 Martin Desruisseaux <martin.desruisse...@geomatys.fr>:
> Hello Michael
>
> ROI is one aspect of JAI that I lack experience in. The approach that I'm
> writting below may be less efficient than ROI. I posting it just in case, but 
> it
> may be worth to explore more on the ROI side.
>
> A possible approach may be to binarize the mask in order to create a new image
> containing only 0 and 1 values. Note: I would not recommand to use ImageWorker
> if you can avoid it. I would rather suggest to use the JAI Binarize descriptor
> directly:
>
> http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/operator/BinarizeDescriptor.html
>
> Then you can multiply your numeric image by that mask, so the masked values 
> get
> 0. You can then convolved as you did, those 0 values will change the sum. For
> the last binarize step, I would suggest again the JAI operation rather than
> ImageWorker.
>
> However the above involves a lot of images (up 6) because of intermediate 
> steps.
> Maybe this is not an issue. But if it is, you could also create your own JAI
> operations doing all this work in one step. It also give you more control on
> what is computed exactly. If you wish to do so, the first step would be to
> create a subclass of javax.media.jai.AreaOpImage.
>
>        Martin
>
>

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to