Hi Sam,<div><br></div><div>Is this a step closer to adding in a colorbar-type legend for the transfer function used in the volume rendering?</div><div><br></div><div>From</div><div>G.S.<br><br><div class="gmail_quote">On Fri, Sep 28, 2012 at 4:04 PM, Sam Skillman <span dir="ltr"><<a href="mailto:samskillman@gmail.com" target="_blank">samskillman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div><br></div><div>So I got a bit ambitious and tried this idea of an ImageArray out, and so far I really like it.  It is in my fork, and here are the differences:</div>
<div><br></div><div><a href="https://bitbucket.org/samskillman/yt/compare/2c5e5476cd58..yt_analysis/yt:yt" target="_blank">https://bitbucket.org/samskillman/yt/compare/2c5e5476cd58..yt_analysis/yt:yt</a></div>

<div><br></div><div>With that in place, I can do the following:</div><div><br></div><div><a href="http://paste.yt-project.org/show/2738/" target="_blank">http://paste.yt-project.org/show/2738/</a></div><div><br></div><div>
This produces these images:</div>

<div><a href="http://i.imgur.com/gdwYJ.png" target="_blank">http://i.imgur.com/gdwYJ.png</a></div><div>and</div><div><a href="http://i.imgur.com/tADlk.png" target="_blank">http://i.imgur.com/tADlk.png</a></div><div><br></div>
<div>And spits out this for the keys/values for the ImageArray.info:</div>

<div><div>Ray casting100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 </div><div>fields ['x']</div><div>normal_vector [ 0.15205718  0.91234311 -0.38014296]</div>


<div>north_vector [ 0.06249512  0.37497071  0.92492774]</div><div>dataset /media/zz3/scratch/skillman/test_data/DD1701</div><div>width (1.5, 1.5, 1.5)</div><div>east_vector [-0.98639392  0.16439899  0.        ]</div><div>


type rendering</div></div><div><br></div><div>This does all of the transposing and y-axis flipping that is necessary to get back the images that you'd expect. </div><div><br></div><div>Anyways, I think I really like it, and I'm happy to PR this in, but even if you guys don't like it I'm going to use it...a lot.  It does touch a bunch of the cameras, so some testing should be done.</div>


<div><br></div><div>Nathan: I think this will help push it in the right direction since it will give the necessary information to the image object returned from the camera.  A thin wrapper that adds on TFs and such would be great!</div>


<div><br></div><div>Cheers,</div><div>Sam</div><div class="HOEnZb"><div class="h5"><div><br></div><div><br></div><div><br><div class="gmail_quote">On Fri, Sep 28, 2012 at 4:43 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Sam and Matt,</div><div><br></div><div>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.</div>


<div><br></div><div>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.</div>


<div><br></div><div>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.</div>


<div><br></div><div>Cheers,</div><div><br></div><div>Nathan</div><div><div><br><div><div>On Sep 28, 2012, at 12:30 PM, Sam Skillman wrote:</div><br><blockquote type="cite">Hi all,<div><br></div><div>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? </div>




<div><br></div><div><a href="http://docs.scipy.org/doc/numpy/user/basics.subclassing.html#simple-example-adding-an-extra-attribute-to-ndarray" target="_blank">http://docs.scipy.org/doc/numpy/user/basics.subclassing.html#simple-example-adding-an-extra-attribute-to-ndarray</a></div>




<div><br></div><div>We could then append on things like x-axis, y-axis, optionally things like field names, and who knows what else?  For example:</div><div><div><a href="http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/2225815c19a844c9974838543f09e267.ipynb" target="_blank">http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/2225815c19a844c9974838543f09e267.ipynb</a></div>




</div><div><br></div><div>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.  </div>




<div><br></div><div>Thoughts?</div><div><br></div><div>Sam<br><div><br><div class="gmail_quote">On Fri, Sep 28, 2012 at 1:00 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
We got an anonymous bug today.  My guess is this is related to the<br>
transpose in write_image.<br>
<br>
-Matt<br>
<div><div><br>
<br>
---------- Forwarded message ----------<br>
From: Anonymous <<a href="mailto:issues-reply@bitbucket.org" target="_blank">issues-reply@bitbucket.org</a>><br>
Date: Fri, Sep 28, 2012 at 7:32 AM<br>
Subject: [yt_analysis/yt] annotate_image (issue #430)<br>
To: <a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a><br>
<br>
<br>
--- you can reply above this line ---<br>
<br>
New issue 430: annotate_image<br>
<a href="https://bitbucket.org/yt_analysis/yt/issue/430/annotate_image" target="_blank">https://bitbucket.org/yt_analysis/yt/issue/430/annotate_image</a><br>
<br>
Anonymous:<br>
<br>
Text is transposed with annotate_image.<br>
<br>
<br>
--<br>
<br>
This is an issue notification from <a href="http://bitbucket.org/" target="_blank">bitbucket.org</a>. You are receiving<br>
this either because you are the owner of the issue, or you are<br>
following the issue.<br>
</div></div>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</blockquote></div><br></div></div>
_______________________________________________<br>yt-dev mailing list<br><a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br><a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>


</blockquote></div><br></div></div></div><br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
<br></blockquote></div><br></div>