[yt-dev] Fwd: [yt_analysis/yt] annotate_image (issue #430)

Nathan Goldbaum nathan12343 at gmail.com
Fri Sep 28 15:43:55 PDT 2012


Hi Sam and Matt,

My preference would be to make some kind of wrapper for the camera that acts like a FixedResolutionBuffer object.  I mocked up something very similar for the OffAxisProjectionPlot which seems to work pretty well.

In turn, it would then be pretty easy to mock of a VolumeRenderingPlot (which doesn't necessarily have to be based on plot window) to make fancy, annotated matplotlib plots based on images returned from the volume renderer.

However, if someone wanted to just deal with bitmaps but still annotate them, a fix for this specific problem would be take the transpose out of write_bitmap and instead have it happen in the cython code that generates the image array in the first place or immediately after in camera.snapshot().  I'm not sure whether what Sam is envisioning would necessarily fix the issue with the transposed text since the image would still be written out with write_bitmap.

Cheers,

Nathan

On Sep 28, 2012, at 12:30 PM, Sam Skillman wrote:

> Hi all,
> 
> So one of the main reasons why this is so messy, IMO, is that we don't have a self-describing image.  All we have is a numpy array.  Would it worthwhile to do something like create an ImageArray, which subclasses numpy ndarray? 
> 
> http://docs.scipy.org/doc/numpy/user/basics.subclassing.html#simple-example-adding-an-extra-attribute-to-ndarray
> 
> We could then append on things like x-axis, y-axis, optionally things like field names, and who knows what else?  For example:
> http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/2225815c19a844c9974838543f09e267.ipynb
> 
> This would significantly help manage the rendering output since we lose info about the image as soon as we lose the camera.  We could additionally write a thin layer to save these images out in hdf5, looping over the info dictionary for attributes.  
> 
> Thoughts?
> 
> Sam
> 
> On Fri, Sep 28, 2012 at 1:00 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi all,
> 
> We got an anonymous bug today.  My guess is this is related to the
> transpose in write_image.
> 
> -Matt
> 
> 
> ---------- Forwarded message ----------
> From: Anonymous <issues-reply at bitbucket.org>
> Date: Fri, Sep 28, 2012 at 7:32 AM
> Subject: [yt_analysis/yt] annotate_image (issue #430)
> To: matthewturk at gmail.com
> 
> 
> --- you can reply above this line ---
> 
> New issue 430: annotate_image
> https://bitbucket.org/yt_analysis/yt/issue/430/annotate_image
> 
> Anonymous:
> 
> Text is transposed with annotate_image.
> 
> 
> --
> 
> This is an issue notification from bitbucket.org. You are receiving
> this either because you are the owner of the issue, or you are
> following the issue.
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20120928/b4e03406/attachment.html>


More information about the yt-dev mailing list