<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>dayel.com</title>
	
	<link>http://www.dayel.com</link>
	<description />
	<lastBuildDate>Mon, 21 Dec 2009 07:04:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dayel" /><feedburner:info uri="dayel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Embedding a 3D figure into a PDF</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/eV9xXs2-jII/</link>
		<comments>http://www.dayel.com/2009/11/embedding-a-3d-figure-into-a-pdf/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 05:32:07 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Data Visualization]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=896</guid>
		<description><![CDATA[How do you share a 3D diagram?  Acrobat!  It turns out that the ubiquitous Acrobat Reader contains a 3D engine that works great for distributing interactive 3D figures.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/896.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<h3>Why use a PDF for 3D?</h3>
<p><a href="/comet/">Some data</a> really needs to be seen in 3D, but how do you easily distribute a 3D diagram? VRML, the <a href="http://vrmlworks.crispen.org/">erstwhile 3D web standard</a>, seems to have <a href="http://www.galaxygoo.org/blogs/2003/04/whatever_happened_to_vrml.html">all but disappeared</a> leaving no widely-adopted replacement (<a href="http://en.wikipedia.org/wiki/O3D">O3D</a> not withstanding).</p>
<p>It turns out that Adobe Acrobat reader contains a 3D engine!  And since it&#8217;s in the ordinary Acrobat Reader, it&#8217;s pretty much ubiquitously installed.  Here are a couple of examples, with links to two of the 3D pdfs I made for the paper; there are more in the <a href="http://www.plosbiology.org/article/info%3Adoi%2F10.1371%2Fjournal.pbio.1000201#s6">supporting information</a> (view with Acrobat for the 3D to work):</p>
<p><a style="http: //www.plosbiology.org/article/fetchSingleRepresentation.action?uri=info;" href="http://www.plosbiology.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pbio.1000201.s006" target="_blank"><img class=" " title="2-D projections (left) and corresponding 1interactive 3-D reconstructions (right) of unconstrained beads (15-µm spacers) showing bilobed and trilobed structure." src="/wp-content/uploads/2009/11/pbio.1000201.FigureS6_202x.png" alt="2-D projections (left) and corresponding 1interactive 3-D reconstructions (right) of unconstrained beads (15-µm spacers) showing bilobed and trilobed structure." /></a></p>
<p><a href="http://www.plosbiology.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pbio.1000201.s007"><img class="   " title="In silico network trajectory relative to bead during smooth motion. " src="/wp-content/uploads/2009/11/pbio.1000201.FigureS7_274x.png" alt="In silico network trajectory relative to bead during smooth motion. " /></a></p>
<div class="clear"></div>
<h3>How to make a 3D PDF</h3>
<p>There are essentially just two steps to making a 3D pdf:</p>
<ol>
<li> converting your model into the U3D format that acrobat uses, and</li>
<li>embedding that U3D file into a pdf.</li>
</ol>
<h3>Converting VRML to U3D</h3>
<p>VTK will produce VRML directly with the <a href="http://www.vtk.org/doc/nightly/html/classvtkVRMLExporter.html">vtkVRMLExporter</a> class (take a look at the <a href="http://github.com/markdayel/comet/blob/master/comet_vtk.cpp">comet_vtk.cpp</a> file to see how we used it).  Calling comet with a single frame (e.g. &#8216;comet vtk 200:200&#8242;) will write out a .vrml file (see the <a href="/comet/wiki/index.php/Display_settings">cometwiki</a> for more details).</p>
<p>To convert the VRML files that VTK produces to the <a href="http://en.wikipedia.org/wiki/Universal_3D">U3D</a> format needed for the pdf you need to buy Acrobat 3D or <a href="http://www.righthemisphere.com/products/dexp/de_std.html">Deep Exploration</a> (the converter in Acrobat 3D is just a re-branded copy of <a href="http://www.righthemisphere.com/products/dexp/de_std.html">Deep Exploration</a> anyway). The academic price for Acrobat 3D was only $70, and <a href="http://millerinstitute.berkeley.edu/">my fellowship</a> payed for it, but the non-academic price for Acrobat 3D (now called Acrobat Pro Extended) is a rather steep $699.</p>
<h3>Embedding the U3D into the PDF</h3>
<p>Once you have the 3D models converted into U3D format, you can just copy and paste them into a pdf using Acrobat itself.  This might work if you only have one model, but I actually found using Acrobat to place the models to be surprisingly difficult.  Pasting the model into the pdf result in a model bigger than the page itself, and I couldn&#8217;t figure out how to resize other than dragging the corner, which doesn&#8217;t preserve the aspect ratio.  It was all very haphazard, and having all the subfigures sized and aligned correctly was nearly impossible.</p>
<p>In the end, I used the <a href="http://www.uoregon.edu/~noeckel/PDFmovie.html">LaTeX movie15 package</a>, which I would recommend over Acrobat 3D if you&#8217;re at all familiar with LaTeX.  Not only does it allow you to easily size and place all the subfigures correctly, but makes it very easy to have a consistent layout between figures.</p>


<p>No related posts.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=eV9xXs2-jII:JKgMAZyvCx8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=eV9xXs2-jII:JKgMAZyvCx8:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=eV9xXs2-jII:JKgMAZyvCx8:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/eV9xXs2-jII" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/11/embedding-a-3d-figure-into-a-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/11/embedding-a-3d-figure-into-a-pdf/</feedburner:origLink></item>
		<item>
		<title>Setting bash variables from an XML file</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/Ey-SMm_w81M/</link>
		<comments>http://www.dayel.com/2009/11/setting-bash-variables-from-xml/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 21:27:39 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=857</guid>
		<description><![CDATA[Here's a quick way to set bash variables using data from an XML file


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/installing-vtk-on-os-x/' rel='bookmark' title='Permanent Link: Installing VTK on Mac OS X'>Installing VTK on Mac OS X</a> <small>Download Universal Binaries of the VTK libraries for OS X here (also how to build them yourself). The comet program...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/857.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<p>Here&#8217;s a quick way to set bash variables using data from an XML file.  Say the xml file is called &#8216;writetext.xml&#8217; and looks like this:</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;writetext&gt;
 &lt;DATE&gt;04/04/09&lt;/DATE&gt;
 &lt;AUTHOR&gt;Mark&lt;/AUTHOR&gt;
 &lt;CROP&gt;TRUE&lt;/CROP&gt;
 &lt;FONT&gt;/Library/Fonts/Arial.ttf&lt;/FONT&gt;
 &lt;FONTSIZE&gt;18&lt;/FONTSIZE&gt;
 &lt;FIXEDFONT&gt;/Library/Fonts/Courier New Bold.ttf&lt;/FIXEDFONT&gt;
 &lt;FIXEDFONTSIZE&gt;18&lt;/FIXEDFONTSIZE&gt;
 &lt;FRAMESTEP&gt;1&lt;/FRAMESTEP&gt;
&lt;/writetext&gt;
</pre>
<p>&#8230;and you want to parse it for the variables &#8216;DATE AUTHOR CROP FONT FONTSIZE FIXEDFONT FIXEDFONTSIZE FRAMESTEP&#8217;, setting the corresponding bash variables to the values in the XML file.</p>
<p>Here&#8217;s a way to do it using xmlstarlet:</p>
<pre class="brush: bash;">
VARIABLES=&quot;DATE AUTHOR CROP FONT FONTSIZE FIXEDFONT FIXEDFONTSIZE FRAMESTEP&quot;

for VARIABLE in $VARIABLES
do
eval $VARIABLE=\&quot;`xmlstarlet sel -t -m //writetext -v $VARIABLE writetext.xml`\&quot;
done
</pre>
<p>Since this code snipped uses xmlstarlet to parse the XML,  you&#8217;ll need to install it first using &#8217;sudo port install xmlstarlet&#8217; on OS X or &#8216;apt-get install xmlstarlet&#8217; on ubuntu/debian.  (You could also potentially use &#8217;sed&#8217; to do the parsing, but I&#8217;m quite happy with xmlstarlet since regular expressions make my head hurt.)</p>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/installing-vtk-on-os-x/' rel='bookmark' title='Permanent Link: Installing VTK on Mac OS X'>Installing VTK on Mac OS X</a> <small>Download Universal Binaries of the VTK libraries for OS X here (also how to build them yourself). The comet program...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=Ey-SMm_w81M:9U9rb7Z4-4k:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=Ey-SMm_w81M:9U9rb7Z4-4k:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=Ey-SMm_w81M:9U9rb7Z4-4k:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/Ey-SMm_w81M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/11/setting-bash-variables-from-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/11/setting-bash-variables-from-xml/</feedburner:origLink></item>
		<item>
		<title>A side view of cells with Galena</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/2psGYEfUFTQ/</link>
		<comments>http://www.dayel.com/2009/09/side-view-of-cells-with-galena/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 04:20:58 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Microscopy]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=556</guid>
		<description><![CDATA[Putting small, cubic, crystals of galena on the surface of a culture dish provides flat surfaces that are ideal for good side-views of attached cells for light microscopy.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/556.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<p>Choanoflagellates are a bit of a challenge to image in several ways.  Putting aside the fact that many of them swim about a lot, even the ones that stick to surfaces tend to attach to the surface of the dish and point directly upwards&#8212;so they look like little circles under the microscope, their collars and flagella not visible because they are pointing directly towards you.  What we need is a flat surface at right angles to the bottom of the dish, that the choanos can attach to and be in the perfect orientation for us to image them.  We also need the substrate to be thin&#8212;too thick, and it&#8217;ll cut off part of the cone of light that forms the image. </p>
<p>I was thinking that the ideal solution would be (very) tiny cubes that would sit with one face on the surface of the dish, and the four adjacent faces providing good, flat, orthogonal surfaces for the choanos to attach to.  What is small and cubic?  I thought of salt&#8212;a naturally occurring cubic-lattice crystal, which wouldn&#8217;t work of course because it would dissolve, but lots of other crystals have cubic lattices!  After ordering a few different minerals with cubic lattice crystals from <a href="http://wardsci.com">Wards</a>, and trying to crush them in a pestle and mortar to make tiny little cubes, I found one with the right properties&#8212;cheap, soft enough to crush into tiny crystals easily, and insoluble in water&#8212;<a href="http://en.wikipedia.org/wiki/Galena">Galena</a> (Lead Sulphide).</p>
<p>The second challenge was to get a (reasonably) uniform size, which is actually really easy.  Just start by griding up some galena in a mortar and pestle (feeling like an old alchemist).  I did this with water to prevent dust because I didn&#8217;t want to inhale lead powder, and wearing gloves&#8212;small things tend to be rather biologically active, and I don&#8217;t want to absorb any lead through my skin if I can help it).  Then I isolated a size range&#8212;putting the galena slush first through a large (150 µm) filter, keeping the flow-through (&lt;150 µm), then through a small (30 µm) filter (nylon mesh) keeping the retentant (30&#8211;150 µm) and washing to remove all of the very small particles.  I stored this under ethanol, to try to prevent the galena dissolving too much.</p>
<div id="attachment_563" class="wp-caption alignright" style="width: 310px"><a href="http://www.dayel.com/wp-content/uploads/2009/09/10x_CM_Galena_Col-_Eaero_E.png"> <img class="size-medium wp-image-563" title="Galena crystals covered in attached choanoflagellates" src="http://www.dayel.com/wp-content/uploads/2009/09/10x_CM_Galena_Col-_Eaero_E-300x224.png" alt="Galena crystals covered in attached choanoflagellates" width="300" height="224" /></a><p class="wp-caption-text">Galena crystals covered in attached choanoflagellates</p></div>
<p>It works quite well (see Figure&#8212;click on it for a larger view).  The crystals aren&#8217;t perfect cubes, but there are lots of flat surfaces orthogonal to the bottom of the dish, and the choanos attach all over them, their cell bodies lining up in their thecae a few microns from the surface.  The crystals are thin enough not to disrupt the imaging too.  The only downside is that they tend to slide over the bottom of the dish if you&#8217;re not careful, ploughing through the choanos on the surface and piling them up on the edge of the crystal.  For long-term growth, I might be a bit concerned about lead dissolving into the solution, but I&#8217;m not sure how much of an issue this is&#8212;galena is not supposed to dissolve very much.  </p>
<p>I&#8217;m not including any high res images of choanos taken this way, because we&#8217;re not yet sure which ones we might want to publish, but I may add some later.</p>


<p>No related posts.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=2psGYEfUFTQ:g5QpF45x5s4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=2psGYEfUFTQ:g5QpF45x5s4:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=2psGYEfUFTQ:g5QpF45x5s4:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/2psGYEfUFTQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/side-view-of-cells-with-galena/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/side-view-of-cells-with-galena/</feedburner:origLink></item>
		<item>
		<title>Valap brush</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/aI8Pox-USp4/</link>
		<comments>http://www.dayel.com/2009/09/valap-brush/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:47:59 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Microscopy]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=360</guid>
		<description><![CDATA[I made a valap brush---essentially a modified soldering iron, with a metal brush at the end.  It heats up just enough to melt the valap---so you dip it into solid valap, which it melts, then you paint the liquid valap on at leisure.


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/side-view-of-cells-with-galena/' rel='bookmark' title='Permanent Link: A side view of cells with Galena'>A side view of cells with Galena</a> <small>Putting small, cubic, crystals of galena on the surface of a culture dish provides flat surfaces that are ideal for...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/360.jpg&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<p>Valap is a soft wax used to seal around a coverslip when you put it on a slide, to keep it in place and prevent evaporation.  It&#8217;s better than nail polish because it sets almost immediately and is non-toxic&#8212;so you can image live cells.  It also stays relatively soft, so you can recover your sample if you need it back, or if you want to flow in a new solution you can easily break the seal, change the solution, and re-seal it in seconds.</p>
<div id="attachment_505" class="wp-caption alignleft" style="width: 240px"><a href="http://www.dayel.com/wp-content/uploads/2009/09/Slide2a.jpg"><img class="size-medium wp-image-505   " title="Slide and coverslip before valap" src="http://www.dayel.com/wp-content/uploads/2009/09/Slide2a-300x300.jpg" alt="Two spacers (made from a cut-up coverslip) make a flow chamber, creating a gap between the coverslip and the slide" width="230" height="230" /></a><p class="wp-caption-text">Figure 1: Two glass spacers (made from a cut-up coverslip) form a flow chamber by creating a gap between the coverslip and the slide</p></div>
<div id="attachment_506" class="wp-caption alignright" style="width: 240px"><a href="http://www.dayel.com/wp-content/uploads/2009/09/Slide5a.jpg"><img class="size-medium wp-image-506  " title="Finished slide and coverslip, sealed with valap" src="http://www.dayel.com/wp-content/uploads/2009/09/Slide5a-300x300.jpg" alt="The finished, sealed chamber, with valap sealing all the edges." width="230" height="230" /></a><p class="wp-caption-text">Figure 2: A finished chamber, sealed with valap on all sides.</p></div>
<div class="clear"></div>
<p>Valap is easy to make: just weigh out equal amounts of vasoline, lanolin and paraffin wax into a beaker, microwave until they melt, and stir well to mix.</p>
<p>The downside of valap is that it&#8217;s essentially wax&#8212;you have to melt it and paint it on.  You can do this by putting a beaker of valap on a hotplate (or special <a href="http://www.google.com/products?q=wax+warmer">wax warmer</a>), but this takes some time to warm up and melt, and it is hard to paint on with a brush as it solidifies on the brush within a second or two.</p>
<p>To solve this, I made a valap brush&#8212;essentially a modified soldering iron, with a metal brush at the end.  It heats up just enough to melt the valap&#8212;the solid valap melts as you touch the brush to it, then you paint the liquid valap on at leisure. :)</p>
<div id="attachment_500" class="wp-caption alignleft" style="width: 250px"><a href="http://www.dayel.com/wp-content/uploads/2009/09/ValapBrush1.JPG"><img class="size-medium wp-image-500 " title="Valap Brush" src="http://www.dayel.com/wp-content/uploads/2009/09/ValapBrush1-300x225.jpg" alt="The valap brush, made from a modified soldering iron" width="240" height="180" /></a><p class="wp-caption-text">Figure 3: The valap brush, made from a modified soldering iron</p></div>
<div id="attachment_501" class="wp-caption alignright" style="width: 250px"><a href="http://www.dayel.com/wp-content/uploads/2009/09/ValapBrush2a.jpg"><img class="size-medium wp-image-501 " title="Tip of the Valap Brush" src="http://www.dayel.com/wp-content/uploads/2009/09/ValapBrush2a-300x300.jpg" alt="The brush tip is made of two parts, thick single-strand copper wire coiled around and supporting a bunch of multistrand flexible wire that makes up the brush tip itself" width="240" height="240" /></a><p class="wp-caption-text">Figure 4: The end of the brush is made of two parts, a thick single-strand copper wire which coils around and supports a bunch of multistrand flexible wire that makes up the brush tip itself</p></div>
<div class="clear"></div>
<p>To make one:</p>
<ol>
<li>Put a $10 lamp dimmer in the line (used to reduce the temperature of the iron to just enough to melt the valap)</li>
<li>Coil some single-strand 16-gauge copper wire by wrapping it around something like a screwdriver, then bend the ends together and insert into the tip of the iron as shown (Figure 4).  Tighten the screw to keep it in place&#8212;I had to put a couple more pieces of copper wire in there to pad out the gap and make a snug fit.</li>
<li>Insert some flexible multistrand wire through the coil (I used some extra-flexible wire from Radio Shack and stripped off the insulation).  Bend one end around to keep it in place and leave the other end sticking out to make the brush part of the tip.</li>
<li>Plug in the iron, starting the dimmer switch all the way down, and gradually increase the dimmer until the iron tip is hot enough to melt the valap, but not so hot that it burns it. Once set to the right temperature, you might want to fix it in place.</li>
</ol>
<p>I find that pouring the valap into a petri-dish (Figure 3) makes it easy to use with the iron.  You should melt the valap with the copper part of the brush, which is quite rigid, then tip the brush to allow the liquid valap to flow onto the flexible brush tip for painting it onto the slide. Also, I put a piece of foil under the stand to catch drips (Figure 3; moved out the way to increase contrast in the photo.)</p>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/side-view-of-cells-with-galena/' rel='bookmark' title='Permanent Link: A side view of cells with Galena'>A side view of cells with Galena</a> <small>Putting small, cubic, crystals of galena on the surface of a culture dish provides flat surfaces that are ideal for...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=aI8Pox-USp4:RxpOfx3mzQ4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=aI8Pox-USp4:RxpOfx3mzQ4:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=aI8Pox-USp4:RxpOfx3mzQ4:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/aI8Pox-USp4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/valap-brush/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/valap-brush/</feedburner:origLink></item>
		<item>
		<title>Comet tutorials</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/o11rt9lRI5s/</link>
		<comments>http://www.dayel.com/2009/09/comet-tutorials/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 22:21:32 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Simulation]]></category>
		<category><![CDATA[Comet]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=475</guid>
		<description><![CDATA[In my first attempt at making screencasts, I've posted two tutorials on how to get the comet program working on OS X.


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/comet/' rel='bookmark' title='Permanent Link: Comet paper accepted'>Comet paper accepted</a> <small>The comet paper (or 'In silico reconstitution of actin based symmetry-breaking and motility') has been accepted to PLoS biology! ...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/475.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<p>In my first attempt at making screencasts, I&#8217;ve posted two tutorials on how to get the <a href="/comet/">comet</a> program working on OS X:</p>
<ul>
<li><a href="/research/comet/comet-tutorial-1/">Comet Tutorial 1 – Running the Program</a></li>
<li><a href="/research/comet/comet-tutorial-2/">Comet Tutorial 2 – Rendering Isosurfaces</a></li>
</ul>
<p>They&#8217;re HD videos (1280&#215;720) hosted by youtube.</p>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/comet/' rel='bookmark' title='Permanent Link: Comet paper accepted'>Comet paper accepted</a> <small>The comet paper (or 'In silico reconstitution of actin based symmetry-breaking and motility') has been accepted to PLoS biology! ...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=o11rt9lRI5s:sCBwZODITtQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=o11rt9lRI5s:sCBwZODITtQ:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=o11rt9lRI5s:sCBwZODITtQ:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/o11rt9lRI5s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/comet-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/comet-tutorials/</feedburner:origLink></item>
		<item>
		<title>Installing VTK on Mac OS X</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/Zq37b5eJljo/</link>
		<comments>http://www.dayel.com/2009/09/installing-vtk-on-os-x/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 04:14:53 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[VTK]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=29</guid>
		<description><![CDATA[Download Universal Binaries of the VTK libraries for OS X here (also how to build them yourself).  The comet program uses VTK for all its 3D rendering---if you want to compile comet with 3D output, you'll need to link against the VTK libraries.  


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/building-gsl-universal-binary/' rel='bookmark' title='Permanent Link: Building GSL as a Universal Binary'>Building GSL as a Universal Binary</a> <small>Here's a universal binary of the Gnu Scientific library (GSL) for OS X, including the ppc, ppc64, i386 and x86_64...</small></li>
<li><a href='http://www.dayel.com/2009/11/setting-bash-variables-from-xml/' rel='bookmark' title='Permanent Link: Setting bash variables from an XML file'>Setting bash variables from an XML file</a> <small>Here's a quick way to set bash variables using data from an XML file...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/29.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<h3>VTK Precompiled Universal Binaries</h3>
<p>The <a href="http://www.dayel.com/cometwiki/">comet program</a> uses <a href="http://www.vtk.org">VTK</a> for all its 3D rendering&#8212;if you want to compile comet with 3D output, you&#8217;ll need to link against the VTK libraries.  I describe below how I built them, but if you simply want to use them, you can download <a href="http://www.dayel.com/comet/libs/vtk/">Universal Binaries of the VTK libraries for OS X</a> here (The current version is 5.5 as of 09/06/09).  The libraries are in the file called &#8216;VTK5.5universal.zip&#8217;, and you can find the the source tree from which they were compiled in &#8216;VTKBuild.zip&#8217;.</p>
<p>To use these for an XCode project, open the project, select Project-&gt;Edit Project Settings and under the Build tab change &#8216;Library Search Paths&#8217; to include the path to the libraries, e.g., /Users/mark/VTK/lib/ and &#8216;Header Search Paths&#8217; to include the path to the header files, e.g., /Users/mark/VTK/include/ (changing the user name and version as appropriate).</p>
<h3>Building VTK as Universal Binaries on OS X</h3>
<p>It took me a little while to get VTK compiled on OS X 10.5, so I&#8217;m posting the instructions here in case they are helpful to others trying to compile it.  VTK uses cmake, which is not very straightforward, but seems robust once you know the secret ways.  This is largely based on the <a href="http://www.vtk.org/Wiki/Cocoa_VTK">vtk wiki</a>, <a href="http://macresearch.org/installing_vtk_on_mac_os_x">the instructions here</a> and some fiddling.  Note:  this is using the CVS version version of VTK (currently 5.5)</p>
<p>First, install the <a href="http://developer.apple.com/tools/download/">Apple Developer Tools (Xcode)</a>, and <a href="http://www.macports.org/">Macports</a>,  then open a terminal and use Macports to install CMake:</p>
<pre><code>sudo port selfupdate
sudo port install cmake</code></pre>
<p>Create a directory for VTK, and download the CVS version of the software:</p>
<pre><code>mkdir VTK
cd VTK
cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK login</code></pre>
<p>enter &#8216;vtk&#8217; as the password, then start the download:</p>
<pre><code>cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK checkout VTK</code></pre>
<p>Make a directory for the build and run cmake from that directory, pointing to the source you just downloaded:</p>
<pre><code>mkdir VTKBuild
cd VTKBuild
cmake ../VTK</code></pre>
<p>Cmake will make its config files based on the system info.  These will be almost right, but we need to open CMakeCache.txt in a text editor and change the following (replace /Users/mark/VTK/VTKBuild with the path you chose above):</p>
<pre><code>CMAKE_BUILD_TYPE:STRING=Release
CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
CMAKE_INSTALL_PREFIX:PATH=/Users/mark/VTK/VTKBuild</code></pre>
<p>Make sure to change the username in that last line to match your own. If you want to make universal binaries, edit these lines including the targets you want:</p>
<pre><code>CMAKE_OSX_ARCHITECTURES:STRING=ppc;ppc64;i386;x86_64
CMAKE_OSX_SYSROOT:PATH=/Developer/SDKs/MacOSX10.5.sdk</code>
</pre>
<p>Then call cmake again and it will write out a makefile:</p>
<pre><code>cmake ../VTK</code></pre>
<p>Finally, compile and install (this takes some time):</p>
<pre><code>make
make install</code></pre>
<p>If all is well, you should have a set of compiled libraries in VTKBuild/bin and include files in VTKBuild/include/vtk-5.5 (depending on the current VTK version number).  If you built universal binaries, you can check the architectures by using lipo:</p>
<pre><code>$ lipo -info libvtkRendering.a
Architectures in the fat file: libvtkRendering.a are: ppc ppc64 i386 x86_64
</code></pre>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/building-gsl-universal-binary/' rel='bookmark' title='Permanent Link: Building GSL as a Universal Binary'>Building GSL as a Universal Binary</a> <small>Here's a universal binary of the Gnu Scientific library (GSL) for OS X, including the ppc, ppc64, i386 and x86_64...</small></li>
<li><a href='http://www.dayel.com/2009/11/setting-bash-variables-from-xml/' rel='bookmark' title='Permanent Link: Setting bash variables from an XML file'>Setting bash variables from an XML file</a> <small>Here's a quick way to set bash variables using data from an XML file...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=Zq37b5eJljo:RpYSI6_zz08:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=Zq37b5eJljo:RpYSI6_zz08:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=Zq37b5eJljo:RpYSI6_zz08:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/Zq37b5eJljo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/installing-vtk-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/installing-vtk-on-os-x/</feedburner:origLink></item>
		<item>
		<title>Comet paper accepted</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/fZddKzWBpv8/</link>
		<comments>http://www.dayel.com/2009/09/comet/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 20:18:10 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Simulation]]></category>
		<category><![CDATA[Actin]]></category>
		<category><![CDATA[Bead Motility]]></category>
		<category><![CDATA[Comet]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=34</guid>
		<description><![CDATA[The comet paper (or 'In silico reconstitution of actin based symmetry-breaking and motility') has been accepted to PLoS biology!  


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/comet-tutorials/' rel='bookmark' title='Permanent Link: Comet tutorials'>Comet tutorials</a> <small>In my first attempt at making screencasts, I've posted two tutorials on how to get the comet program working on...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/34.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<p>The comet paper&#8217;s been accepted to PLoS biology (Yay!) after a lot of work&#8212;easily the most I&#8217;ve ever done on a single project.  The comet project, (or &#8216;In silico reconstitution of actin based symmetry-breaking and motility&#8217; as I titled the paper) is really the first time I&#8217;ve been able to do the kind of science I&#8217;ve wanted to do for a long time&#8212;take a complex biological phenomenon and figure out what&#8217;s going on by simulating it a top-down computer model.  By a top-down model, I mean that rather than throwing everything we know into the model, we simulate just enough to test the hypothesis. That way, if it works, we know exactly how it&#8217;s working.</p>
<p>I&#8217;m quite proud of the paper, and very grateful to my collaborators:  Mark Landeryou for his help with some of the harder parts the programming (all of the thread programming and much of the VTK work), Orkun, Viviana and Dyche for pulling together the experimental data to check the predictions, and Alex for for his help and support with the model and the paper.</p>
<h3>References:</h3>
<p><a href="http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.1000201">Dayel MJ, Akin O, Landeryou M, Risca V, Mogilner A, et al. (2009) In Silico Reconstitution of Actin-Based Symmetry Breaking and Motility. PLoS Biol 7(9):e1000201. doi:10.1371/journal.pbio.1000201</a></p>
<p><a href="http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.1000201"><span>Free open-access article</span></a></p>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/comet-tutorials/' rel='bookmark' title='Permanent Link: Comet tutorials'>Comet tutorials</a> <small>In my first attempt at making screencasts, I've posted two tutorials on how to get the comet program working on...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=fZddKzWBpv8:y6pHsn-DfBw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=fZddKzWBpv8:y6pHsn-DfBw:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=fZddKzWBpv8:y6pHsn-DfBw:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/fZddKzWBpv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/comet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/comet/</feedburner:origLink></item>
		<item>
		<title>Building GSL as a Universal Binary</title>
		<link>http://feedproxy.google.com/~r/dayel/~3/YK60ttZrOVY/</link>
		<comments>http://www.dayel.com/2009/09/building-gsl-universal-binary/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 01:47:02 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.dayel.com/?p=390</guid>
		<description><![CDATA[Here's a universal binary of the Gnu Scientific library (GSL) for OS X, including the ppc, ppc64, i386 and x86_64 architectures.  Works with Leopard and Snow Leopard.


Related posts:<ol><li><a href='http://www.dayel.com/2009/09/installing-vtk-on-os-x/' rel='bookmark' title='Permanent Link: Installing VTK on Mac OS X'>Installing VTK on Mac OS X</a> <small>Download Universal Binaries of the VTK libraries for OS X here (also how to build them yourself). The comet program...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.dayel.com/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=/wp-content/thumbnails/390.png&amp;w=100&amp;h=100&amp;zc=1&amp;ft=png' alt='post thumbnail' /></p>
<h3>GSL</h3>
<p>The <a href="http://www.gnu.org/software/gsl/">GSL (Gnu Scientific Library)</a> is a robust set of math routines, very useful for scientific computing.  The <a href="../comet/">comet program</a> uses the GSL to generate random numbers, and though we don&#8217;t absolutely require the GSL, it is better (more random) than using the standard rand() function.</p>
<p>If you want to link against the GSL and make code that runs on multiple architectures on OS X, you&#8217;ll need a universal binary of the library, like this <a href="http://www.dayel.com/comet/libs/gsl/">precompiled universal binary</a> of the GSL for OS X, including the ppc, ppc64, i386 and x86_64 architectures.</p>
<h3>Building GSL as a Universal Binary</h3>
<p>The script I used to build it is below, and is based on <a href="http://osdir.com/ml/lib.gsl.general/2007-10/msg00023.html">this post</a>.  If you want to compile it yourself, download the latest version of the GSL (.tar.gz file) <a href="http://mirrors.kernel.org/gnu/gsl/">from here</a> or <a href="http://www.gnu.org/prep/ftp.html">one of the mirrors</a>, then run the script below in the same directory.  If you&#8217;re worried about the compiler optimizations affecting accuracy, remove the &#8216;-O3&#8242; from COMPFLAGS.  The finished libraries are in the &#8216;libs&#8217; directory and the headers are in &#8216;include&#8217;.  The script makes universal libraries of all of the &#8216;.a&#8217; files (though I only use libgsl.a)</p>
<pre class="brush: bash;">
#!/usr/bin/env bash

# possible archs: i386 ppc x86_64 ppc64
# note: ppc64 doesn't work in Snow Leopard
ARCHITECTURES=&quot;i386 ppc x86_64&quot;

# number of cpus to use during compile
COMPILETHREADS=2

COMPILER=gcc-4.2
#COMPILER=/Developer/usr/bin/llvm-g++-4.2

# configure flags
CONFFLAGS=&quot;--disable-shared&quot;

# compiler flags
COMPFLAGS=&quot;-O3&quot;

# find the name of the source file
SOURCEFILE=`find . -name &quot;gsl*.tar.gz&quot; -depth 1`
SOURCEFILE=${SOURCEFILE:2:100}
GSLVER=${SOURCEFILE%.tar.gz}

# unzip the main source file
tar -xzf $SOURCEFILE

for ARCH in $ARCHITECTURES
do
echo Compiling for ${ARCH}...

# copy source to new directory
cp -r ${GSLVER} ${GSLVER}_$ARCH
cd ${GSLVER}_$ARCH

# configure for architecture
if [ &quot;$ARCH&quot; != &quot;ppc64&quot; ] ; then  # not sure why we have to do cross compile for ppc64 but not ppc...
env CC=&quot;$COMPILER&quot; CFLAGS=&quot;-arch $ARCH $COMPFLAGS&quot; LDFLAGS=&quot;-arch $ARCH&quot; ./configure $CONFFLAGS --build=$ARCH
else
env CC=&quot;$COMPILER&quot; CFLAGS=&quot;-arch $ARCH $COMPFLAGS&quot; LDFLAGS=&quot;-arch $ARCH&quot; ./configure $CONFFLAGS --host=$ARCH
fi

# compile for architecture
make clean ; nice make -j $COMPILETHREADS

cd ..

done

mkdir include
mkdir libs
cp `find ${GSLVER} -name &quot;*.h&quot;` include

echo
echo
echo Making Universal Binaries...

find ${GSLVER}_$ARCH -name &quot;*.a&quot;

for LIBRARY in `find ${GSLVER}_$ARCH -name &quot;*.a&quot;`
do
echo
LIB=`basename $LIBRARY`
echo Library: $LIB
find . -name $LIB
lipo -create `find . -name $LIB | xargs` -output libs/$LIB
lipo -info libs/$LIB
done

echo
echo Universal Binaries:
echo
lipo -info libs/*.a
</pre>


<p>Related posts:<ol><li><a href='http://www.dayel.com/2009/09/installing-vtk-on-os-x/' rel='bookmark' title='Permanent Link: Installing VTK on Mac OS X'>Installing VTK on Mac OS X</a> <small>Download Universal Binaries of the VTK libraries for OS X here (also how to build them yourself). The comet program...</small></li>
</ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dayel?a=YK60ttZrOVY:DQ_Nmhzhuq8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dayel?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dayel?a=YK60ttZrOVY:DQ_Nmhzhuq8:94cKNvpCvNs"><img src="http://feeds.feedburner.com/~ff/dayel?i=YK60ttZrOVY:DQ_Nmhzhuq8:94cKNvpCvNs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dayel/~4/YK60ttZrOVY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dayel.com/2009/09/building-gsl-universal-binary/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.dayel.com/2009/09/building-gsl-universal-binary/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.344 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-02-24 08:55:40 -->
