I agree with Bradley that it should be part of the SimpleITK Package.  IMHO, it is too integral to the full functioning of the ITK to R interface to keep separate.<div><br></div><div>Here are the pointers to the VTK versions of the routines.  We will need to change it to use ITK arrays instead, but that should not be too difficult.  I am not sure how optimized these are, but once we get the functionality encapsulated and into SimpleITK, we can work on optimization.</div>

<div><br></div><div>Basic data conversion:</div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.cxx;h=d6049a5eb748f878df56d40b4c82aeec7fc51471;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.cxx;h=d6049a5eb748f878df56d40b4c82aeec7fc51471;hb=HEAD</a>
</div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD</a>
</div><div><br></div><div>Interface to the R Interpreter (probably not needed)</div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD</a>
</div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRInterface.h;h=e98ce921b5a16c5299fdb8cccbb29793fcd8989b;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRInterface.h;h=e98ce921b5a16c5299fdb8cccbb29793fcd8989b;hb=HEAD</a>
</div><div><br></div><div><div>Pipeline encapsulation (probably not needed)</div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.cxx;h=bdc99183fb2a6b949228fcadbed63e4a9f0e9d9a;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.cxx;h=bdc99183fb2a6b949228fcadbed63e4a9f0e9d9a;hb=HEAD</a>
</div><div><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.h;h=08f43d42b724a608cc37fdba1268875dab7ceba8;hb=HEAD">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.h;h=08f43d42b724a608cc37fdba1268875dab7ceba8;hb=HEAD</a>
</div><div><br></div><div>- Wes<br><br><div class="gmail_quote">On Wed, Jan 4, 2012 at 10:41 AM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>&gt;</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"><br><div><div class="im"><div>On Jan 4, 2012, at 10:07 AM, Brandon Whitcher wrote:</div>

<br><blockquote type="cite">Wes, thanks for your input here.  That would be great.  Do your methods depend upon any ITK/SimpleITK routines?  I&#39;m wondering if it would be better to keep SimpleITK (the R wrapper version) as a separate R package and then develop additional packages that add features, or just put everything in one package (hmm).  <br>

</blockquote><div><br></div></div><div>For python we have added interface methods to numpy as part of the SimpleITK package. I would think that converting sitk::Images to R arrays would be a very common usage, so it sounds like it should be fairly tightly coupled with the SimpleITK package. Is the multi-dimensional array part of the standard R interface or a separate package.</div>

<div><br></div><div>The swig documentation for R is fairly poor:</div><div><a href="http://www.swig.org/Doc2.0/SWIGDocumentation.html#R" target="_blank">http://www.swig.org/Doc2.0/SWIGDocumentation.html#R</a></div><div><br>

</div><div>Swig has to support more standard features then are listed there.</div><div><br></div><div>If you are wondering how we did the python numpy interface, you can begin by looking at the Wrapping/Python.i file:</div>

<div><br></div><div><a href="http://itk.org/gitweb?p=SimpleITK.git;a=blob;f=Wrapping/Python.i;h=ca732fc3e219e3ec6f76974adc9e015282b52562;hb=HEAD" target="_blank">http://itk.org/gitweb?p=SimpleITK.git;a=blob;f=Wrapping/Python.i;h=ca732fc3e219e3ec6f76974adc9e015282b52562;hb=HEAD</a></div>

<div><br></div><div>I that with this information and the way VTK interfaces with R can help get you started.</div><div><br></div><div>Brad</div><div><div></div><div class="h5"><br><blockquote type="cite">
<br>For me, I&#39;ve developed (with others) a lot of mathematical modelling and statistical inference methods in R that operate on multidimensional arrays (usually coming from one of the medical imaging data formats); e.g., for functional MRI, DTI, HARDI or DCE-MRI.  What we lack is the so-called pre-processing techniques needed in medical image analysis: segmentation, filtering, registration, etc.  Hence, SimpleITK (the R wrapper version) would be a great way to access the techniques listed previously on data that have been read it via R, and stored as multidimensional arrays, then take the output back into R for further analysis and visualization.<br>


<br>I&#39;m looking for the best way to incorporate the impressive variety of ITK routines into my R-based data analysis pipeline.<br><div style="margin:2em 0pt" name="sig_d41d8cd98f"><p>cheers...</p><p>Brandon</p>
</div><div class="gmail_quote">On 3 January 2012 18:28, Wes Turner <span dir="ltr">&lt;<a href="mailto:wes.turner@kitware.com" target="_blank">wes.turner@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<br><br><div class="gmail_quote"><div>On Tue, Jan 3, 2012 at 10:37 AM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word">Hello,<div><br></div><div>It is great to hear that you are approaching ITK for the first time with SimpleITK. Your feed back is very much appreciated so that we can improve the documentations and the compilation procedures for a easier experience.</div>




<div><br></div><div><br></div><div>I have added the source of your Data problem to the FAQ here:</div><div><br></div><div><a href="http://www.itk.org/Wiki/ITK/Release_4/SimpleITK/FAQ#Where_is_the_Input_Data.3F_or_Why_is_my_Testing.2FData_directory_empty.3F" target="_blank">http://www.itk.org/Wiki/ITK/Release_4/SimpleITK/FAQ#Where_is_the_Input_Data.3F_or_Why_is_my_Testing.2FData_directory_empty.3F</a></div>




<div><br></div><div>The output you have attached looks great! I hope you have had success trying additional filters by now.</div><div><br></div><div>You said that you want to read Nifti and ANALYZE data with R. ITK  and SimpleITK also have good support for these image formats, so you may be able to read directly with SimpleITK&#39;s ReadImage method or the ImageFileReader object.</div>




<div><br></div><div>There is currently no optimized method for exporting a SimpleITK image into an R array. So you are likely must use the slow SetPixel and GetPixel methods. </div></div></blockquote><div><br></div></div>


<div>
There are methods currently in VTK for conversion between VTK and R structures for some subset of formats.  I would be willing to provide some help and guidance.  It is only two classes and should be a short putt.</div>
<div><br></div><div>- Wes</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div style="word-wrap:break-word"><div><br></div><div>
For visualization in SimpleITK we have a primitive sitk.Show method. This method currently just writes the image out to disk and then loads is up in ImageJ. To use the, you need a recent version of ImageJ. We hope to make this methods more configurable in the future, and take advantage built in language specific visualization tools. However, with SimpleITK supporting 2D, 3D image, along with all the vector pixel types, and complex pixel types etc... many existing tools don&#39;t have the needs support for all these possibilities.</div>




<div><br></div><div>Enjoy,</div><div><div><br></div><div>Brad</div><div><br></div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px"><font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">========================================================</font></div>




<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px"><font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Bradley Lowekamp  </font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px">




<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Medical Science and Computing for</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px">




<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Office of High Performance Computing and Communications</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px">




<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">National Library of Medicine </font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:12px">




<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3"><a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a></font></div></div></div><div><br><div><div>On Jan 2, 2012, at 3:46 AM, Brandon Whitcher wrote:</div>




<br><blockquote type="cite">Following up on my previous message I found a copy of cthead1.png at <br><br><a href="http://itk.org/gitweb?p=SimpleITKData.git;a=commitdiff;h=f7d86582b91a35e5c8d30f1b58320bc47cc658fa" target="_blank">http://itk.org/gitweb?p=SimpleITKData.git;a=commitdiff;h=f7d86582b91a35e5c8d30f1b58320bc47cc658fa</a><br>





<br>...and downloaded it.  I have attached it and the &quot;out.png&quot; file from your example code.<br><br><span style="font-family:courier new,monospace">&gt; source(&quot;load.R&quot;)</span><div><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">Creating a generic function for ‘print’ from package ‘base’ in the global environment</span><br style="font-family:courier new,monospace"></div><span style="font-family:courier new,monospace">&gt; img &lt;- ReadImage( &quot;Input/cthead1.png&quot; )</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">&gt; (pid &lt;- Image_GetPixelIDValue( img ))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">[1] 1</span><div>

<br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">&gt; simg &lt;- SmoothingRecursiveGaussian( img, 4 )</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; cimg &lt;- Cast( simg, pid )</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">&gt; WriteImage( cimg, &quot;out.png&quot; )</span><br><br></div>Success!<br><br>Now I need to read up on ITK functions and how to take an array in R (containing ANALYZE or NIfTI data) and pass it into ITK, process it and bring it back in order to visualize/manipulate in R.  I have a package that performs basic I/O for ANALYZE and NIfTI using S4 objects in R (called oro.nifti) and it would be great to pass these arrays (along with the metadata) back-and-forth with SimpleITK.<br>





<br>cheers...<br><br>Brandon<div><div></div><div><br><br><br><div class="gmail_quote">On 2 January 2012 08:37, Brandon Whitcher <span dir="ltr">&lt;<a href="mailto:bwhitcher@gmail.com" target="_blank">bwhitcher@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Brad, as you can tell I&#39;m completely new to ITK... thank-you for your patience.  My SimpleITK (source) Testing/Data directory is empty from my &quot;clone-ing&quot; via Git (I am also a Git novice, sorry).  Looking at the version control tree at<br>






<br><a href="http://itk.org/gitweb?p=SimpleITK.git;a=tree;f=Testing;h=eb50d756edee129fc26beb6d4c00f288ea49309a;hb=HEAD" target="_blank">http://itk.org/gitweb?p=SimpleITK.git;a=tree;f=Testing;h=eb50d756edee129fc26beb6d4c00f288ea49309a;hb=HEAD</a><br>






<br>...I get...<br><br><span style="font-family:courier new,monospace">m--------- - Data history</span><br><br>...which doesn&#39;t look too promising from my knowledge of file permissions.  How can I overcome this?  May I ask for &quot;cthead1.png&quot; via email to try this example ASAP?<br>






<br>cheers...<span><font color="#888888"><br><br>Brandon</font></span><div><div><br><br><div class="gmail_quote">On 2 January 2012 04:21, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</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">Hello Brandon,<div><br></div><div>As is frequently the case the first exception is the cause of the remainder. To understand the first error message some explanation of the how SimpleITK manages image types is needed.</div>






<div><br></div><div>There may be some relevant information in the SimpleITK presentation from MICCAI 2011:</div><div><a href="https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true" target="_blank">https://github.com/SimpleITK/SimpleITK-MICCAI-2011-Tutorial/blob/master/Presentation/SimpleITK-MICCAI-2011.pdf?raw=true</a></div>






<div><br></div><div><br></div><div>The sitk::Image class is a typeless image class which wraps numerous ITK image types. Externally the sitk::Image class presents the same interface for all images, wether it is a scalar itk::Image, a multicomponent itk::VectorImage, or even a run-line compressed itk::LabelMap. And then each of these ITK image types are templated over the dimension and the pixel type. So SimpleITK presents dozens of itk images types through a single sitk::Image object. </div>






<div><br></div><div>So SimpelITK is not strongly typed on these individual image types, but it is type aware.</div><div><br></div><div>ITK  filters are also templated on the input, and output image types. But SimpleITK again type not expose the details of all the templated types, and instead just exposes a generic interface to the image filter, and internally is instantiates the image filter with all the plausible input image types, and the sensible corresponding output image types. </div>






<div><br></div><div>There are a few methods which can be used to interrogate the image after it&#39;s loaded:</div><div><br></div><div>First there is the ToString member function which just dumps out  bunch of information about the internal ITK object:</div>






<div><br></div><div>&gt;cat( Image_ToString( myimage ) )</div><div><br></div><div>And more specific methods:</div><div><br></div><div>&gt; Image_GetDimension( myimage )</div><div><div>&gt; Image_GetPixelIDTypeAsString( myimage )</div>






<div>&gt; Image_GetPixelIDValue( myimage )</div><div><br></div></div><div>So lets look at what happens with the image you have chosen to run this script with</div><div><br></div><div><div><div><div>On Jan 1, 2012, at 9:03 AM, Brandon Whitcher wrote:</div>






<br><blockquote type="cite">Brad,<br><br>I have attempted to run SimpleGaussian.R in an interactive R session by executing<br><br></blockquote></div><blockquote type="cite">
<br><div>using the &quot;spine1.png&quot; image (attached, along with load.R).<br></div></blockquote><div><br></div><div>The data used for the tests can be found in the {SIMPLEITK_SOURCE}/Testing/Data.</div><div>
<br><blockquote type="cite"><br>The code fails to produce a smoothed image, here is the output<br><br><span style="font-family:courier new,monospace">&gt; source(&quot;load.R&quot;) # library(SimpleITK)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; args &lt;- c(&quot;spine1.png&quot;, 5, &quot;spine1_smooth.png&quot;) # commandArgs(TRUE)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; myreader &lt;- ImageFileReader()</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; myreader &lt;- ImageFileReader_SetFileName(myreader, args[[1]])</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; myimage &lt;- ImageFileReader_Execute(myreader)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"></blockquote><div><br></div></div><div><div>if you run:</div><div><div>&gt;cat( Image_ToString( myimage ) )</div><div>






<br></div><div>You should see the following line:</div><div><br></div><div>RTTI typeinfo:   itk::VectorImage&lt; unsigned char, 2u&gt;</div><div><br></div><div>Or if you run:</div><div><br></div><div>&gt; Image_GetPixelIDTypeAsString( myimage )</div>






<div>[1] &quot;vector of 8-bit unsigned integer&quot;</div><div><br></div><div>So with either of these methods you see that this file is not a black and white image that it first appears, but actually a RGB image loaded into an Itk::VectorImage</div>






</div></div><div><br><blockquote type="cite"><span style="font-family:courier new,monospace">&gt; pixeltype &lt;- Image_GetPixelIDValue(myimage)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; myfilter &lt;- SmoothingRecursiveGaussianImageFilter()</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; myfilter &lt;- SmoothingRecursiveGaussianImageFilter_SetSigma(myfilter, as.double(args[2]))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; smoothedimage &lt;- SmoothingRecursiveGaussianImageFilter_Execute(myfilter, myimage)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">Warning message:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">In f(...) :</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">  Exception thrown in SimpleITK SmoothingRecursiveGaussianImageFilter_Execute: /srv/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.txx:173:</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">sitk::ERROR: Pixel type: vector of 8-bit unsigned integer is not supported in 2D byN3itk6simple37SmoothingRecursiveGaussianImageFilterE</span><br style="font-family:courier new,monospace">






</blockquote><div><br></div></div><div>While this error message could use improvement  ( and will be improved ). It basically says that this filter doesn&#39;t work with this particular image type  ( it should also list the types of images it does work with ). This particular filter currently only works with scalar image type. So this image with sitkVectorUInt8 pixels is not going to work. </div>






<div><div><br></div><div><br></div><br><blockquote type="cite">
<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; mycaster &lt;- CastImageFilter()</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; mycaster &lt;- CastImageFilter_SetOutputPixelType(mycaster, pixeltype)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; castedimage &lt;- CastImageFilter_Execute(mycaster, soothedimage)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">Error in CastImageFilter_Execute(mycaster, soothedimage) : </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">  object &#39;soothedimage&#39; not found</span><br style="font-family:courier new,monospace">






</blockquote><div><br></div></div><div>There appears to be a typeo &quot;soothedimage&quot; should be &quot;smoothedimage&quot;. However, I think the same error message should be generated because the smoothedimage was not assigned due to the previous exception.</div>






<div><br><blockquote type="cite">
<span style="font-family:courier new,monospace">&gt; </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; mywriter &lt;- ImageFileWriter()</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">&gt; mywriter &lt;- ImageFileWriter_SetFileName(mywriter, args[[3]])</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">&gt; mywriter &lt;- ImageFileWriter_Execute(mywriter, castedimage)</span><br style="font-family:courier new,monospace">







<span style="font-family:courier new,monospace">Error in ImageFileWriter_Execute(mywriter, castedimage) : </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">  object &#39;castedimage&#39; not found</span><br>







<br>I am not sure what to make of the warnings or errors (sorry).  Any advice or modifications would be helpful.  I am using spine1.png since I cannot locate STAPLE1.png in either the ITK or SimpleITK directories.<br><br>






</blockquote><div><br></div></div><div>Using the functional interface the following may be simpler:</div><div><br></div><div>img &lt;- ReadImage( &quot;/src/SimpleITK/Testing/Data/Input/cthead1.png&quot; )</div><div>pid &lt;- Image_GetPixelIDValue( img )</div>






<div>simg &lt;- SmoothingRecursiveGaussian( img, 4 )</div><div>cimg &lt;- Cast( simg, pid )</div><div>WriteImage( cimg, &quot;out.png&quot; )</div><div><br></div><div>Good luck,</div><div>Brad</div><br><blockquote type="cite">






<div><div>
thanks,<br><br>Brandon<br><br><br><div class="gmail_quote">On 31 December 2011 18:34, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">Hello again,<div><br></div><div>I was not able to get the R packaging to work as described in the link provided. I did find a manual way to load the SimpleITK R library.</div><div><br></div>







<div>Copy the SimpleITK.R file and the libSimpleITK.so ( renamed to SimpleITK.so ) into your current path, such as with the following commands:</div><div><br></div><div><div>cp SimpleITK/SimpleITK-build/Wrapping/SimpleITK.R</div>







<div>cp SimpleITK/SimpleITK-build/Wrapping/SimpleITK.R ./</div></div><div><br></div><div><br></div><div>The fire up R and type:</div><div><br></div><div><div>$ R</div><div><br></div><div>R version 2.14.0 (2011-10-31)</div>







<div>...</div><div><br></div><div>&gt; dyn.load( paste(&quot;SimpleITK&quot;, .Platform$dynlib.ext, sep=&quot;&quot; ))</div><div>&gt; source ( &quot;SimpleITK.R&quot; )</div><div>Creating a generic function for ‘print’ from package ‘base’ in the global environment</div>







<div>&gt; cacheMetaData( 1 )</div></div><div><br></div><div>Here is an example that was working at one point:</div><div><br></div><div><a href="http://www.itk.org/SimpleITKDoxygen/html/SimpleGaussian_8R-example.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/SimpleGaussian_8R-example.html</a></div>







<div><br></div><div>However the &quot;library( SimpleITK )&quot; call is used for when SimpleITK is installed as a package not the adhoc approach used above.</div><div><br></div><div>Good Luck,</div><div>Brad</div><div><div>







<div><br><div><div>On Dec 31, 2011, at 1:11 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">Hello Brandon,<div><br></div><div>The particular files you looking for are in the SimpleITK source directory not the build. You will need both the DESCRIPTION and the zzz.R files from the {SIMPLEITK_SOURCE}/Wrapping/R_Package directory.</div>







<div><br></div><div>We have been calling R a Tier 2 or Tier 3 language in SimpleITK because is not as well supported as the other wrapped languages such as Python, Java, CSharp or even Ruby, or TCL. The primary reason for this is that we have not gotten the automatic testing working for R, so that it will show up on the nightly dashboard. Additionally, we also are hoping for contribution from the community to get the R language specific features polished and up to the expected R standard conventions.</div>







<div><br></div><div>I hope this helps you with getting SimpleITK working R,</div><div><br></div><div>Brad</div><div><br><div>
<div style="word-wrap:break-word;font-size:12px"><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">========================================================</font></div>







<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Bradley Lowekamp<span> </span><span> </span></font></div>







<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Medical Science and Computing for</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">







<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">Office of High Performance Computing and Communications</font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">







<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3">National Library of Medicine<span> </span></font></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">







<font style="font:normal normal normal 12px/normal Helvetica" face="Helvetica" size="3"><a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a></font></div></div></div>
</div>
<br><div><div>On Dec 31, 2011, at 9:28 AM, Brandon Whitcher wrote:</div><br><blockquote type="cite">Dear ITK/SimpleITK experts,<br><br>I have installed SimpleITK by turning off all wrapping facilities except WRAP_R.  I am now following the instructions in<br>







<br><div style="margin-left:40px"><a href="http://www.itk.org/SimpleITKDoxygen/html/Wrapping.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/Wrapping.html</a><br>
</div><br>Specifically, <br><br><ul><li>6) Copy the file</li></ul>
<div><pre>       SimpleITK/Wrapping/R_Package/DESCRIPTION
</pre></div><p> into the current</p>
<div><pre>       SimpleITK/DESCRIPTION
</pre></div>...but I cannot find the file Wrapping/R_package/DESCRIPTION in my SimpleITK-binary installation.  Where is this file?<br><br>thank-you,<br><br>Brandon<br></blockquote></div></div></div></blockquote></div></div>




</div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div><font color="#540000"><br></font></div></div></blockquote></div><div><div style="word-wrap:break-word">




<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>




<br></span></div><br>
</div>
<br></div></div><br></div></div><div>_____________________________________<br>
Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></div></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4920" value="+15188814920" target="_blank">518-881-4920</a><br>
</font></span></blockquote></div><br>
</blockquote></div></div></div><div><div></div><div class="h5"><br><div>
<div style="word-wrap:break-word;font-size:12px"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">========================================================</font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Bradley Lowekamp<span> </span><span> </span></font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Medical Science and Computing for</font></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Office of High Performance Computing and Communications</font></p>

<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">National Library of Medicine<span> </span></font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">

<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica"><a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a></font></p><br></span></div><br>
</div>
<br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Wesley D. Turner, Ph.D.<br>Kitware, Inc.<br>Technical Leader<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4920<br>


</div>