Brian, nice to meet you. Is this code available via a repository such as sourceforge, R-Forge or github? I may be able to come up with some resource to contribute to this effort (maybe). <br><br>cheers...<br><br>Brandon<br>
<br><br><div class="gmail_quote">On 24 January 2012 15:02, brian avants <span dir="ltr"><<a href="mailto:stnava@gmail.com">stnava@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 everyone<br>
<br>
we've been working on this as well --- actually, mainly shrinidhi<br>
(cc'd). he's got simpleitk => R compilation set up with cmake and<br>
more or less ready to go as an R package. the package needs to be<br>
filled out, though, with R friendly wrapper functions. i will<br>
discuss again with him tomorrow.<br>
<span class="HOEnZb"><font color="#888888"><br>
brian<br>
</font></span><div class="im HOEnZb"><br>
<br>
<br>
<br>
<br>
On Tue, Jan 24, 2012 at 9:48 AM, Brandon Whitcher <<a href="mailto:bwhitcher@gmail.com">bwhitcher@gmail.com</a>> wrote:<br>
</div><div class="HOEnZb"><div class="h5">> Wes and Bradley,<br>
><br>
> I know we've gone silent on the R <-> ITK front, I'm still trying to find<br>
> someone who will do the heavy lifting.<br>
><br>
> Just to let you (and the other ITK list users) that the annual R users<br>
> meeting will be at Vanderbilt University, Nashville, from 12-15 June.<br>
><br>
> <a href="http://biostat.mc.vanderbilt.edu/wiki/Main/UseR-2012" target="_blank">http://biostat.mc.vanderbilt.edu/wiki/Main/UseR-2012</a><br>
><br>
> Abstracts are being accepted until 12 March. It would be a great way of<br>
> promoting ITK to the R community!<br>
><br>
> What are your thoughts?<br>
><br>
> cheers...<br>
><br>
> Brandon<br>
><br>
><br>
> On 4 January 2012 17:42, Wes Turner <<a href="mailto:wes.turner@kitware.com">wes.turner@kitware.com</a>> wrote:<br>
>><br>
>> I agree with Bradley that it should be part of the SimpleITK Package.<br>
>> IMHO, it is too integral to the full functioning of the ITK to R interface<br>
>> to keep separate.<br>
>><br>
>> Here are the pointers to the VTK versions of the routines. We will need<br>
>> to change it to use ITK arrays instead, but that should not be too<br>
>> difficult. I am not sure how optimized these are, but once we get the<br>
>> functionality encapsulated and into SimpleITK, we can work on optimization.<br>
>><br>
>> Basic data conversion:<br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.cxx;h=d6049a5eb748f878df56d40b4c82aeec7fc51471;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.cxx;h=d6049a5eb748f878df56d40b4c82aeec7fc51471;hb=HEAD</a><br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD</a><br>
>><br>
>> Interface to the R Interpreter (probably not needed)<br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRAdapter.h;h=83a2a833c18d8d8ce36d1f4e77e5cf12b5d2c217;hb=HEAD</a><br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRInterface.h;h=e98ce921b5a16c5299fdb8cccbb29793fcd8989b;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRInterface.h;h=e98ce921b5a16c5299fdb8cccbb29793fcd8989b;hb=HEAD</a><br>
>><br>
>> Pipeline encapsulation (probably not needed)<br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.cxx;h=bdc99183fb2a6b949228fcadbed63e4a9f0e9d9a;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.cxx;h=bdc99183fb2a6b949228fcadbed63e4a9f0e9d9a;hb=HEAD</a><br>
>><br>
>> <a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.h;h=08f43d42b724a608cc37fdba1268875dab7ceba8;hb=HEAD" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkRCalculatorFilter.h;h=08f43d42b724a608cc37fdba1268875dab7ceba8;hb=HEAD</a><br>
>><br>
>> - Wes<br>
>><br>
>><br>
>> On Wed, Jan 4, 2012 at 10:41 AM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>
>> wrote:<br>
>>><br>
>>><br>
>>> On Jan 4, 2012, at 10:07 AM, Brandon Whitcher wrote:<br>
>>><br>
>>> Wes, thanks for your input here. That would be great. Do your methods<br>
>>> depend upon any ITK/SimpleITK routines? I'm wondering if it would be better<br>
>>> to keep SimpleITK (the R wrapper version) as a separate R package and then<br>
>>> develop additional packages that add features, or just put everything in one<br>
>>> package (hmm).<br>
>>><br>
>>><br>
>>> For python we have added interface methods to numpy as part of the<br>
>>> SimpleITK package. I would think that converting sitk::Images to R arrays<br>
>>> would be a very common usage, so it sounds like it should be fairly tightly<br>
>>> coupled with the SimpleITK package. Is the multi-dimensional array part of<br>
>>> the standard R interface or a separate package.<br>
>>><br>
>>> The swig documentation for R is fairly poor:<br>
>>> <a href="http://www.swig.org/Doc2.0/SWIGDocumentation.html#R" target="_blank">http://www.swig.org/Doc2.0/SWIGDocumentation.html#R</a><br>
>>><br>
>>> Swig has to support more standard features then are listed there.<br>
>>><br>
>>> If you are wondering how we did the python numpy interface, you can begin<br>
>>> by looking at the Wrapping/Python.i file:<br>
>>><br>
>>><br>
>>> <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><br>
>>><br>
>>> I that with this information and the way VTK interfaces with R can help<br>
>>> get you started.<br>
>>><br>
>>> Brad<br>
>>><br>
>>><br>
>>> For me, I've developed (with others) a lot of mathematical modelling and<br>
>>> statistical inference methods in R that operate on multidimensional arrays<br>
>>> (usually coming from one of the medical imaging data formats); e.g., for<br>
>>> functional MRI, DTI, HARDI or DCE-MRI. What we lack is the so-called<br>
>>> pre-processing techniques needed in medical image analysis: segmentation,<br>
>>> filtering, registration, etc. Hence, SimpleITK (the R wrapper version)<br>
>>> would be a great way to access the techniques listed previously on data that<br>
>>> have been read it via R, and stored as multidimensional arrays, then take<br>
>>> the output back into R for further analysis and visualization.<br>
>>><br>
>>> I'm looking for the best way to incorporate the impressive variety of ITK<br>
>>> routines into my R-based data analysis pipeline.<br>
>>><br>
>>> cheers...<br>
>>><br>
>>> Brandon<br>
>>><br>
>>> On 3 January 2012 18:28, Wes Turner <<a href="mailto:wes.turner@kitware.com">wes.turner@kitware.com</a>> wrote:<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Tue, Jan 3, 2012 at 10:37 AM, Bradley Lowekamp<br>
>>>> <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>
>>>>><br>
>>>>> Hello,<br>
>>>>><br>
>>>>> It is great to hear that you are approaching ITK for the first time<br>
>>>>> with SimpleITK. Your feed back is very much appreciated so that we can<br>
>>>>> improve the documentations and the compilation procedures for a easier<br>
>>>>> experience.<br>
>>>>><br>
>>>>><br>
>>>>> I have added the source of your Data problem to the FAQ here:<br>
>>>>><br>
>>>>><br>
>>>>> <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><br>
>>>>><br>
>>>>> The output you have attached looks great! I hope you have had success<br>
>>>>> trying additional filters by now.<br>
>>>>><br>
>>>>> You said that you want to read Nifti and ANALYZE data with R. ITK and<br>
>>>>> SimpleITK also have good support for these image formats, so you may be able<br>
>>>>> to read directly with SimpleITK's ReadImage method or the ImageFileReader<br>
>>>>> object.<br>
>>>>><br>
>>>>> There is currently no optimized method for exporting a SimpleITK image<br>
>>>>> into an R array. So you are likely must use the slow SetPixel and GetPixel<br>
>>>>> methods.<br>
>>>><br>
>>>><br>
>>>> There are methods currently in VTK for conversion between VTK and R<br>
>>>> structures for some subset of formats. I would be willing to provide some<br>
>>>> help and guidance. It is only two classes and should be a short putt.<br>
>>>><br>
>>>> - Wes<br>
>>>><br>
>>>>><br>
>>>>> For visualization in SimpleITK we have a primitive sitk.Show method.<br>
>>>>> This method currently just writes the image out to disk and then loads is up<br>
>>>>> in ImageJ. To use the, you need a recent version of ImageJ. We hope to make<br>
>>>>> this methods more configurable in the future, and take advantage built in<br>
>>>>> language specific visualization tools. However, with SimpleITK supporting<br>
>>>>> 2D, 3D image, along with all the vector pixel types, and complex pixel types<br>
>>>>> etc... many existing tools don't have the needs support for all these<br>
>>>>> possibilities.<br>
>>>>><br>
>>>>> Enjoy,<br>
>>>>><br>
>>>>> Brad<br>
>>>>><br>
>>>>><br>
>>>>> ========================================================<br>
>>>>> Bradley Lowekamp<br>
>>>>> Medical Science and Computing for<br>
>>>>> Office of High Performance Computing and Communications<br>
>>>>> National Library of Medicine<br>
>>>>> <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><br>
>>>>><br>
>>>>> On Jan 2, 2012, at 3:46 AM, Brandon Whitcher wrote:<br>
>>>>><br>
>>>>> Following up on my previous message I found a copy of cthead1.png at<br>
>>>>><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 "out.png" file from<br>
>>>>> your example code.<br>
>>>>><br>
>>>>> > source("load.R")<br>
>>>>><br>
>>>>> Creating a generic function for ‘print’ from package ‘base’ in the<br>
>>>>> global environment<br>
>>>>> > img <- ReadImage( "Input/cthead1.png" )<br>
>>>>> > (pid <- Image_GetPixelIDValue( img ))<br>
>>>>> [1] 1<br>
>>>>><br>
>>>>> > simg <- SmoothingRecursiveGaussian( img, 4 )<br>
>>>>> > cimg <- Cast( simg, pid )<br>
>>>>> > WriteImage( cimg, "out.png" )<br>
>>>>><br>
>>>>> Success!<br>
>>>>><br>
>>>>> Now I need to read up on ITK functions and how to take an array in R<br>
>>>>> (containing ANALYZE or NIfTI data) and pass it into ITK, process it and<br>
>>>>> bring it back in order to visualize/manipulate in R. I have a package that<br>
>>>>> performs basic I/O for ANALYZE and NIfTI using S4 objects in R (called<br>
>>>>> oro.nifti) and it would be great to pass these arrays (along with the<br>
>>>>> metadata) back-and-forth with SimpleITK.<br>
>>>>><br>
>>>>> cheers...<br>
>>>>><br>
>>>>> Brandon<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On 2 January 2012 08:37, Brandon Whitcher <<a href="mailto:bwhitcher@gmail.com">bwhitcher@gmail.com</a>> wrote:<br>
>>>>>><br>
>>>>>> Brad, as you can tell I'm completely new to ITK... thank-you for your<br>
>>>>>> patience. My SimpleITK (source) Testing/Data directory is empty from my<br>
>>>>>> "clone-ing" via Git (I am also a Git novice, sorry). Looking at the version<br>
>>>>>> control tree at<br>
>>>>>><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>
>>>>>> m--------- - Data history<br>
>>>>>><br>
>>>>>> ...which doesn't look too promising from my knowledge of file<br>
>>>>>> permissions. How can I overcome this? May I ask for "cthead1.png" via<br>
>>>>>> email to try this example ASAP?<br>
>>>>>><br>
>>>>>> cheers...<br>
>>>>>><br>
>>>>>> Brandon<br>
>>>>>><br>
>>>>>><br>
>>>>>> On 2 January 2012 04:21, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>
>>>>>> wrote:<br>
>>>>>>><br>
>>>>>>> Hello Brandon,<br>
>>>>>>><br>
>>>>>>> As is frequently the case the first exception is the cause of the<br>
>>>>>>> remainder. To understand the first error message some explanation of the how<br>
>>>>>>> SimpleITK manages image types is needed.<br>
>>>>>>><br>
>>>>>>> There may be some relevant information in the SimpleITK presentation<br>
>>>>>>> from MICCAI 2011:<br>
>>>>>>><br>
>>>>>>> <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><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> The sitk::Image class is a typeless image class which wraps numerous<br>
>>>>>>> ITK image types. Externally the sitk::Image class presents the same<br>
>>>>>>> interface for all images, wether it is a scalar itk::Image, a multicomponent<br>
>>>>>>> itk::VectorImage, or even a run-line compressed itk::LabelMap. And then each<br>
>>>>>>> of these ITK image types are templated over the dimension and the pixel<br>
>>>>>>> type. So SimpleITK presents dozens of itk images types through a single<br>
>>>>>>> sitk::Image object.<br>
>>>>>>><br>
>>>>>>> So SimpelITK is not strongly typed on these individual image types,<br>
>>>>>>> but it is type aware.<br>
>>>>>>><br>
>>>>>>> ITK filters are also templated on the input, and output image types.<br>
>>>>>>> But SimpleITK again type not expose the details of all the templated types,<br>
>>>>>>> and instead just exposes a generic interface to the image filter, and<br>
>>>>>>> internally is instantiates the image filter with all the plausible input<br>
>>>>>>> image types, and the sensible corresponding output image types.<br>
>>>>>>><br>
>>>>>>> There are a few methods which can be used to interrogate the image<br>
>>>>>>> after it's loaded:<br>
>>>>>>><br>
>>>>>>> First there is the ToString member function which just dumps out<br>
>>>>>>> bunch of information about the internal ITK object:<br>
>>>>>>><br>
>>>>>>> >cat( Image_ToString( myimage ) )<br>
>>>>>>><br>
>>>>>>> And more specific methods:<br>
>>>>>>><br>
>>>>>>> > Image_GetDimension( myimage )<br>
>>>>>>> > Image_GetPixelIDTypeAsString( myimage )<br>
>>>>>>> > Image_GetPixelIDValue( myimage )<br>
>>>>>>><br>
>>>>>>> So lets look at what happens with the image you have chosen to run<br>
>>>>>>> this script with<br>
>>>>>>><br>
>>>>>>> On Jan 1, 2012, at 9:03 AM, Brandon Whitcher wrote:<br>
>>>>>>><br>
>>>>>>> Brad,<br>
>>>>>>><br>
>>>>>>> I have attempted to run SimpleGaussian.R in an interactive R session<br>
>>>>>>> by executing<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> using the "spine1.png" image (attached, along with load.R).<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> The data used for the tests can be found in the<br>
>>>>>>> {SIMPLEITK_SOURCE}/Testing/Data.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> The code fails to produce a smoothed image, here is the output<br>
>>>>>>><br>
>>>>>>> > source("load.R") # library(SimpleITK)<br>
>>>>>>> ><br>
>>>>>>> > args <- c("spine1.png", 5, "spine1_smooth.png") # commandArgs(TRUE)<br>
>>>>>>> ><br>
>>>>>>> > myreader <- ImageFileReader()<br>
>>>>>>> > myreader <- ImageFileReader_SetFileName(myreader, args[[1]])<br>
>>>>>>> > myimage <- ImageFileReader_Execute(myreader)<br>
>>>>>>> ><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> if you run:<br>
>>>>>>> >cat( Image_ToString( myimage ) )<br>
>>>>>>><br>
>>>>>>> You should see the following line:<br>
>>>>>>><br>
>>>>>>> RTTI typeinfo: itk::VectorImage< unsigned char, 2u><br>
>>>>>>><br>
>>>>>>> Or if you run:<br>
>>>>>>><br>
>>>>>>> > Image_GetPixelIDTypeAsString( myimage )<br>
>>>>>>> [1] "vector of 8-bit unsigned integer"<br>
>>>>>>><br>
>>>>>>> So with either of these methods you see that this file is not a black<br>
>>>>>>> and white image that it first appears, but actually a RGB image loaded into<br>
>>>>>>> an Itk::VectorImage<br>
>>>>>>><br>
>>>>>>> > pixeltype <- Image_GetPixelIDValue(myimage)<br>
>>>>>>> ><br>
>>>>>>> > myfilter <- SmoothingRecursiveGaussianImageFilter()<br>
>>>>>>> > myfilter <-<br>
>>>>>>> > SmoothingRecursiveGaussianImageFilter_SetSigma(myfilter, as.double(args[2]))<br>
>>>>>>> > smoothedimage <-<br>
>>>>>>> > SmoothingRecursiveGaussianImageFilter_Execute(myfilter, myimage)<br>
>>>>>>> Warning message:<br>
>>>>>>> In f(...) :<br>
>>>>>>> Exception thrown in SimpleITK<br>
>>>>>>> SmoothingRecursiveGaussianImageFilter_Execute:<br>
>>>>>>> /srv/SimpleITK/Code/Common/include/sitkMemberFunctionFactory.txx:173:<br>
>>>>>>> sitk::ERROR: Pixel type: vector of 8-bit unsigned integer is not<br>
>>>>>>> supported in 2D byN3itk6simple37SmoothingRecursiveGaussianImageFilterE<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> While this error message could use improvement ( and will be<br>
>>>>>>> improved ). It basically says that this filter doesn't work with this<br>
>>>>>>> particular image type ( it should also list the types of images it does<br>
>>>>>>> work with ). This particular filter currently only works with scalar image<br>
>>>>>>> type. So this image with sitkVectorUInt8 pixels is not going to work.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> ><br>
>>>>>>> > mycaster <- CastImageFilter()<br>
>>>>>>> > mycaster <- CastImageFilter_SetOutputPixelType(mycaster, pixeltype)<br>
>>>>>>> > castedimage <- CastImageFilter_Execute(mycaster, soothedimage)<br>
>>>>>>> Error in CastImageFilter_Execute(mycaster, soothedimage) :<br>
>>>>>>> object 'soothedimage' not found<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> There appears to be a typeo "soothedimage" should be "smoothedimage".<br>
>>>>>>> However, I think the same error message should be generated because the<br>
>>>>>>> smoothedimage was not assigned due to the previous exception.<br>
>>>>>>><br>
>>>>>>> ><br>
>>>>>>> > mywriter <- ImageFileWriter()<br>
>>>>>>> > mywriter <- ImageFileWriter_SetFileName(mywriter, args[[3]])<br>
>>>>>>> > mywriter <- ImageFileWriter_Execute(mywriter, castedimage)<br>
>>>>>>> Error in ImageFileWriter_Execute(mywriter, castedimage) :<br>
>>>>>>> object 'castedimage' not found<br>
>>>>>>><br>
>>>>>>> I am not sure what to make of the warnings or errors (sorry). Any<br>
>>>>>>> advice or modifications would be helpful. I am using spine1.png since I<br>
>>>>>>> cannot locate STAPLE1.png in either the ITK or SimpleITK directories.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Using the functional interface the following may be simpler:<br>
>>>>>>><br>
>>>>>>> img <- ReadImage( "/src/SimpleITK/Testing/Data/Input/cthead1.png" )<br>
>>>>>>> pid <- Image_GetPixelIDValue( img )<br>
>>>>>>> simg <- SmoothingRecursiveGaussian( img, 4 )<br>
>>>>>>> cimg <- Cast( simg, pid )<br>
>>>>>>> WriteImage( cimg, "out.png" )<br>
>>>>>>><br>
>>>>>>> Good luck,<br>
>>>>>>> Brad<br>
>>>>>>><br>
>>>>>>> thanks,<br>
>>>>>>><br>
>>>>>>> Brandon<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> On 31 December 2011 18:34, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>
>>>>>>> wrote:<br>
>>>>>>>><br>
>>>>>>>> Hello again,<br>
>>>>>>>><br>
>>>>>>>> I was not able to get the R packaging to work as described in the<br>
>>>>>>>> link provided. I did find a manual way to load the SimpleITK R library.<br>
>>>>>>>><br>
>>>>>>>> Copy the SimpleITK.R file and the libSimpleITK.so ( renamed to<br>
>>>>>>>> SimpleITK.so ) into your current path, such as with the following commands:<br>
>>>>>>>><br>
>>>>>>>> cp SimpleITK/SimpleITK-build/Wrapping/SimpleITK.R<br>
>>>>>>>> cp SimpleITK/SimpleITK-build/Wrapping/SimpleITK.R ./<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> The fire up R and type:<br>
>>>>>>>><br>
>>>>>>>> $ R<br>
>>>>>>>><br>
>>>>>>>> R version 2.14.0 (2011-10-31)<br>
>>>>>>>> ...<br>
>>>>>>>><br>
>>>>>>>> > dyn.load( paste("SimpleITK", .Platform$dynlib.ext, sep="" ))<br>
>>>>>>>> > source ( "SimpleITK.R" )<br>
>>>>>>>> Creating a generic function for ‘print’ from package ‘base’ in the<br>
>>>>>>>> global environment<br>
>>>>>>>> > cacheMetaData( 1 )<br>
>>>>>>>><br>
>>>>>>>> Here is an example that was working at one point:<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> <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><br>
>>>>>>>><br>
>>>>>>>> However the "library( SimpleITK )" call is used for when SimpleITK<br>
>>>>>>>> is installed as a package not the adhoc approach used above.<br>
>>>>>>>><br>
>>>>>>>> Good Luck,<br>
>>>>>>>> Brad<br>
>>>>>>>><br>
>>>>>>>> On Dec 31, 2011, at 1:11 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C]<br>
>>>>>>>> wrote:<br>
>>>>>>>><br>
>>>>>>>> Hello Brandon,<br>
>>>>>>>><br>
>>>>>>>> The particular files you looking for are in the SimpleITK source<br>
>>>>>>>> directory not the build. You will need both the DESCRIPTION and the zzz.R<br>
>>>>>>>> files from the {SIMPLEITK_SOURCE}/Wrapping/R_Package directory.<br>
>>>>>>>><br>
>>>>>>>> We have been calling R a Tier 2 or Tier 3 language in SimpleITK<br>
>>>>>>>> because is not as well supported as the other wrapped languages such as<br>
>>>>>>>> Python, Java, CSharp or even Ruby, or TCL. The primary reason for this is<br>
>>>>>>>> that we have not gotten the automatic testing working for R, so that it will<br>
>>>>>>>> show up on the nightly dashboard. Additionally, we also are hoping for<br>
>>>>>>>> contribution from the community to get the R language specific features<br>
>>>>>>>> polished and up to the expected R standard conventions.<br>
>>>>>>>><br>
>>>>>>>> I hope this helps you with getting SimpleITK working R,<br>
>>>>>>>><br>
>>>>>>>> Brad<br>
>>>>>>>><br>
>>>>>>>> ========================================================<br>
>>>>>>>> Bradley Lowekamp<br>
>>>>>>>> Medical Science and Computing for<br>
>>>>>>>> Office of High Performance Computing and Communications<br>
>>>>>>>> National Library of Medicine<br>
>>>>>>>> <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><br>
>>>>>>>><br>
>>>>>>>> On Dec 31, 2011, at 9:28 AM, Brandon Whitcher wrote:<br>
>>>>>>>><br>
>>>>>>>> Dear ITK/SimpleITK experts,<br>
>>>>>>>><br>
>>>>>>>> I have installed SimpleITK by turning off all wrapping facilities<br>
>>>>>>>> except WRAP_R. I am now following the instructions in<br>
>>>>>>>><br>
>>>>>>>> <a href="http://www.itk.org/SimpleITKDoxygen/html/Wrapping.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/Wrapping.html</a><br>
>>>>>>>><br>
>>>>>>>> Specifically,<br>
>>>>>>>><br>
>>>>>>>> 6) Copy the file<br>
>>>>>>>><br>
>>>>>>>> SimpleITK/Wrapping/R_Package/DESCRIPTION<br>
>>>>>>>><br>
>>>>>>>> into the current<br>
>>>>>>>><br>
>>>>>>>> SimpleITK/DESCRIPTION<br>
>>>>>>>><br>
>>>>>>>> ...but I cannot find the file Wrapping/R_package/DESCRIPTION in my<br>
>>>>>>>> SimpleITK-binary installation. Where is this file?<br>
>>>>>>>><br>
>>>>>>>> thank-you,<br>
>>>>>>>><br>
>>>>>>>> Brandon<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> _____________________________________<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>
>>>><br>
>>>><br>
>>>><br>
>>>> --<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">518-881-4920</a><br>
>>><br>
>>><br>
>>><br>
>>> ========================================================<br>
>>><br>
>>> Bradley Lowekamp<br>
>>><br>
>>> Medical Science and Computing for<br>
>>><br>
>>> Office of High Performance Computing and Communications<br>
>>><br>
>>> National Library of Medicine<br>
>>><br>
>>> <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a><br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
>> --<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">518-881-4920</a><br>
><br>
><br>
><br>
> _____________________________________<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></div></blockquote></div><br>