<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-126825683890303246</id><updated>2011-12-31T00:19:23.698Z</updated><category term='imaging'/><category term='rstats'/><category term='mri'/><title type='text'>dcemri</title><subtitle type='html'>An R Package for the Quantitative Analysis of Dynamic Contrast-Enhanced MRI</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-5857316867265952020</id><published>2011-12-29T16:27:00.002Z</published><updated>2011-12-29T16:27:38.171Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='mri'/><category scheme='http://www.blogger.com/atom/ns#' term='imaging'/><category scheme='http://www.blogger.com/atom/ns#' term='rstats'/><title type='text'>dcemriS4 0.46</title><content type='html'>The R package &lt;a href="http://cran.r-project.org/web/packages/dcemriS4/index.html" target="_blank"&gt;dcemriS4&lt;/a&gt; provides routines for the quantitative analysis of dynamic contrast-enhanced magnetic resonance imaging (DCE-MRI), along with quantification of diffusion-weighted MRI (ADC = apparent diffusion coefficient) and quantitative T2 maps from &lt;span class="sico_header_f18"&gt;Carr-Purcell-Meiboom-Gill (CPMG) sequences.&amp;nbsp; The latest version (0.46) has been submitted to CRAN and will hopefully be available for download soon.&lt;/span&gt;&lt;br /&gt;&lt;span class="sico_header_f18"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-jhEgIWbfjy8/TvyQI1mmOEI/AAAAAAAACjQ/ZUp31-8K9xc/s1600/281949_19040721_perfusion_ktrans_bayes.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-jhEgIWbfjy8/TvyQI1mmOEI/AAAAAAAACjQ/ZUp31-8K9xc/s400/281949_19040721_perfusion_ktrans_bayes.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Voxel-wise posterior median values of Ktrans (volume transfer constant&lt;br /&gt;between the plasma and the extravascular extracellular space) using an MCMC algorithm.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="sico_header_f18"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="sico_header_f18"&gt;Improvements or modifications from previous versions include:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Added dependence on R (&amp;gt;=2.14.0) so that the "parallel" package is used instead of the "multicore" package.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Added functions aifParameters() and compartmentalModel() to standardize the output in parameter estimation functions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Allow the user to specify initial guesses for the &lt;a href="http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm" target="_blank"&gt;Levenberg-Marquardt&lt;/a&gt; optimization in order to estimate the kinetic parameters.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Improved the implementation of CA.fast2 to estimate the T1 relaxation time and corresponding contrast agent concentration when only two flip angles are acquired.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Bug fix in dcemri.lm() when user-specified arterial input function (AIF) is provided.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sico_header_f18"&gt;Added cerebral blood volume (CBV) estimation functionality.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="sico_header_f18"&gt;Please post any questions or suggestions to &lt;a href="mailto:dcemri-help@lists.sourceforge.net"&gt;dcemri-help@lists.sourceforge.net&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-5857316867265952020?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/5857316867265952020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcemri.blogspot.com/2011/12/dcemris4-046.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/5857316867265952020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/5857316867265952020'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2011/12/dcemris4-046.html' title='dcemriS4 0.46'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-jhEgIWbfjy8/TvyQI1mmOEI/AAAAAAAACjQ/ZUp31-8K9xc/s72-c/281949_19040721_perfusion_ktrans_bayes.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-2225088761260810671</id><published>2010-12-22T17:45:00.086Z</published><updated>2011-12-29T15:31:22.609Z</updated><title type='text'>Data-driven arterial input functions</title><content type='html'>I haven't devoted any time/effort/code to the extraction and parameter estimation of arterial input functions (AIFs) for DCE-MRI in either the vignette or the submission to &lt;a href="http://www.jstatsoft.org/"&gt;&lt;i&gt;JSS&lt;/i&gt;&lt;/a&gt;.&amp;nbsp; Frankly, I wanted to communicate the main features of the &lt;b&gt;&lt;span style="font-family: inherit;"&gt;R&lt;/span&gt;&lt;/b&gt; package &lt;b&gt;dcemriS4&lt;/b&gt; and data-driven AIFs just haven't made the list... up 'til now.&amp;nbsp; So let's assume one wants to fit a parametric model to observed contrast-agent concentration time curves (CTCs) obtained from a DCE-MRI acquisition.&lt;br /&gt;&lt;br /&gt;The function &lt;span style="font-family: 'Courier New',Courier,monospace;"&gt;extract.aif()&lt;/span&gt; requires a seed voxel to perform a three-dimensional region-growing algorithm based on correlation.&amp;nbsp; I use &lt;a href="http://fsl.fmrib.ox.ac.uk/fsl/fslview/"&gt;FSLView&lt;/a&gt;, but feel free to select the voxel using your favorite piece of software.&amp;nbsp; The code below uses the &lt;a href="https://wiki.nci.nih.gov/display/CIP/RIDER"&gt;RIDER Neuro MRI&lt;/a&gt; data from the NBIA (National Biomedical Imaging Archive) that has been (a) converted from DICOM to NIfTI, (b) brain extracted by applying &lt;a href="http://www.fmrib.ox.ac.uk/fsl/bet2/"&gt;BET&lt;/a&gt; on the 15-degree multiple flip-angle acquisition and (c) converted from signal intensity to contrast agent concentration in all brain voxels.&amp;nbsp; The main steps in estimating a parametric AIF are&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Read in the contrast-agent CTCs (a four-dimensional NIfTI file)&lt;/li&gt;&lt;li&gt;Read in the acquisition times (obtained from the DICOM data)&lt;/li&gt;&lt;li&gt;Use &lt;span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"&gt;extract.aif() &lt;/span&gt;with the seed voxel and correlation threshold&lt;/li&gt;&lt;li&gt;Fit a parametric model (&lt;a href="http://dx.doi.org/10.1088/0031-9155/53/5/005"&gt;Orton et al. 2008&lt;/a&gt;) to the average CTC from the seed-growing algorithm&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;script class="brush: R" type="syntaxhighlighter"&gt;&lt;![CDATA[library("oro.dicom")library("dcemriS4")path &lt;- "/data/NBIA"ax15 &lt;- paste("281949", "19040721", "ax15flip", sep="_")acqtimes &lt;- str2time(unique(sort(scan(file.path(path, "rawtimes.txt"),                                      quiet=TRUE))))$timeacqtimes &lt;- (acqtimes - acqtimes[9]) / 60 # minutesconc &lt;- readNIfTI(file.path(path, paste(perf, "gdconc", sep="_")))voxel &lt;- c(128,75,9) # from FSLViewex &lt;- extract.aif(conc, voxel[1], voxel[2], voxel[3], 0.975)matplot(acqtimes, t(ex$conc), type="l", lty=1, col=1,        xlab="Time (minutes)", ylab="Gadolinium concentration",        main="extract.aif()")lines(acqtimes, colMeans(ex$conc), lwd=2, col=2)fit.aif &lt;- orton.exp.lm(acqtimes, colMeans(ex$conc))lines(acqtimes, aif.orton.exp(acqtimes, fit.aif$AB, fit.aif$muB,                               fit.aif$AG, fit.aif$muG),       lwd=2, col=3)]]&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;The thin black lines correspond to individual CTCs from the voxels, the red line is the average CTC used to fit the parametric model and the green curve is the fitted model.  Note, in order to fit the entire time series a compromise was struck between fitting the first pass of the contrast versus the tail.  It may be necessary to modify the range of acquisition times in order to emphasize the beginning or the end of the AIF, depending upon which aspect of the dynamic acquisition is more important.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_pHQu7Zi9BfM/TRI_QKWANFI/AAAAAAAAB4k/BAQaUZHSdpU/s1600/extract_aif.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_pHQu7Zi9BfM/TRI_QKWANFI/AAAAAAAAB4k/BAQaUZHSdpU/s1600/extract_aif.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Contrast-agent concentration time curves from voxel (128,75,9).&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The four parameters that characterize the AIF model may be obtained via&lt;br /&gt;&lt;br /&gt;&lt;script class="brush: R" type="syntaxhighlighter"&gt;&lt;![CDATA[&gt; unlist(fit.aif[1:4])        AB        muB         AG        muG 9.72347151 5.88292950 0.41659791 0.03683481 ]]&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-2225088761260810671?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/2225088761260810671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcemri.blogspot.com/2010/12/data-driven-arterial-input-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/2225088761260810671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/2225088761260810671'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2010/12/data-driven-arterial-input-functions.html' title='Data-driven arterial input functions'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_pHQu7Zi9BfM/TRI_QKWANFI/AAAAAAAAB4k/BAQaUZHSdpU/s72-c/extract_aif.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-2487037181104636611</id><published>2010-11-18T16:35:00.000Z</published><updated>2011-12-29T15:33:15.448Z</updated><title type='text'>dcemriS4 0.40</title><content type='html'>The &lt;b&gt;R&lt;/b&gt; package &lt;a href="http://cran.r-project.org/package=dcemriS4"&gt;&lt;b&gt;dcemriS4&lt;/b&gt;&lt;/a&gt;  is a collection of functions, with examples and documentation, that  allows one to perform voxel-wise quantitative analysis of dynamic  contrast-enhanced MRI (DCE-MRI) or diffusion-weighted imaging (DWI)  data.&amp;nbsp; The primary application of this methodology is oncology, but  applications to other therapeutic areas (such as neuroscience or  inflammation) are equally possible.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="post-header"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_pHQu7Zi9BfM/TOVTbdNnSkI/AAAAAAAAB34/i1BYWnpWETY/s1600/281949_19040721_axtensor_D.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/_pHQu7Zi9BfM/TOVTbdNnSkI/AAAAAAAAB34/i1BYWnpWETY/s400/281949_19040721_axtensor_D.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Estimated apparent diffusion coefficients (ADCs) from the RIDER Neuro MRI data.&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;The latest version of &lt;a href="http://cran.r-project.org/package=dcemriS4"&gt;&lt;b&gt;dcemriS4&lt;/b&gt;&lt;/a&gt; (0.40) has been released on CRAN.&amp;nbsp; The source code is available for download now and compiled versions should follow shortly.  New features include:&lt;/div&gt;&lt;ul style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;li&gt;All compartmental model fitting procedures use the same parametric models&lt;/li&gt;&lt;li&gt;Levenberg-Marquardt and MAP routines now take advantage of the &lt;a href="http://cran.r-project.org/package=multicore"&gt;multicore&lt;/a&gt; package&lt;/li&gt;&lt;li&gt;Added full control of input parameters to nls.lm() when executing the Levenberg-Marquardt algorithm&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Added quantitative T2 estimation from CPMG acquisitions&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;Please use the &lt;a href="mailto:dcemri-help@lists.sourceforge.net"&gt;mailing list&lt;/a&gt; for any questions/suggestions or contact me directly at &lt;a href="mailto:bjw34032@users.sourceforge.net"&gt;bjw34032@users.sourceforge.net&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-2487037181104636611?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/2487037181104636611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcemri.blogspot.com/2010/11/dcemris4-040.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/2487037181104636611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/2487037181104636611'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2010/11/dcemris4-040.html' title='dcemriS4 0.40'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_pHQu7Zi9BfM/TOVTbdNnSkI/AAAAAAAAB34/i1BYWnpWETY/s72-c/281949_19040721_axtensor_D.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-7817266840565352946</id><published>2010-10-09T23:20:00.003+01:00</published><updated>2010-10-12T09:39:02.111+01:00</updated><title type='text'>dcemriS4 0.34</title><content type='html'>&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;The &lt;b&gt;R&lt;/b&gt; package &lt;a href="http://www.dcemri.org/"&gt;&lt;b&gt;dcemriS4&lt;/b&gt;&lt;/a&gt; is a collection of functions, with examples and documentation, that allows one to perform voxel-wise quantitative analysis of dynamic contrast-enhanced MRI (DCE-MRI) or diffusion-weighted imaging (DWI) data.&amp;nbsp; The primary application of this methodology is oncology, but applications to other therapeutic areas (such as neuroscience or inflammation) are equally possible.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;The latest version of &lt;a href="http://www.dcemri.org/"&gt;&lt;b&gt;dcemriS4&lt;/b&gt;&lt;/a&gt; (0.34) has been released on CRAN.  New features include:&lt;/div&gt;&lt;ul style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;li&gt;Added &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;kety.orton.exp&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;kety.orton.cos&lt;/span&gt; models to dcemri.{bayes,lm,map}()&lt;/li&gt;&lt;li&gt;Bayesian penalized splines via dcemri.spline()&lt;/li&gt;&lt;li&gt;Deviance Information Criterion (DIC) available in dcemri.bayes()&lt;/li&gt;&lt;li&gt;New prior distribution specifications for dcemri.bayes()&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Arial,Helvetica,sans-serif;"&gt;Please use the mailing list for any suggestions or contact &lt;a href="mailto:bjw34032@users.sourceforge.net"&gt;bjw34032@users.sourceforge.net&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-7817266840565352946?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/7817266840565352946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcemri.blogspot.com/2010/10/dcemris4-034.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/7817266840565352946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/7817266840565352946'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2010/10/dcemris4-034.html' title='dcemriS4 0.34'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-345485890910484709</id><published>2010-01-21T19:03:00.000Z</published><updated>2010-01-21T20:44:32.322Z</updated><title type='text'>writeNIfTI() is fully compatible with FSLView</title><content type='html'>With the NIfTI-1 header extensions the world is your oyster.&amp;nbsp; We decided that one use for such a capability is to keep an audit trail of all operations performed on the image data volume.&amp;nbsp; This is a key feature in the &lt;b&gt;dcemriS4&lt;/b&gt; package.&amp;nbsp; There are three main components to a NIfTI-1 header extension: esize, ecode and edata.&amp;nbsp; At first we arbitrarily set ecode&amp;nbsp;=&amp;nbsp;1002 and further developed the software.&amp;nbsp; Turns out, &lt;a href="http://www.fmrib.ox.ac.uk/fsl/fslview"&gt;FSLView&lt;/a&gt; is quite strict about the numbers used in ecode and it failed to accept our NIfTI-1 header extensions saved from R.&amp;nbsp; Looking at the file nifti1_io.h, the following ecodes have been defined:&lt;br /&gt;&lt;br /&gt;&lt;script class="brush: c" type="syntaxhighlighter"&gt;&lt;![CDATA[/* NIfTI-1.1 extension codes:   see http://nifti.nimh.nih.gov/nifti-1/documentation/faq#Q21 */#define NIFTI_ECODE_IGNORE           0  /* changed from UNKNOWN, 29 June 2005 */#define NIFTI_ECODE_DICOM            2  /* intended for raw DICOM attributes  */#define NIFTI_ECODE_AFNI             4  /* Robert W Cox: rwcox@nih.gov                                           http://afni.nimh.nih.gov/afni      */#define NIFTI_ECODE_COMMENT          6  /* plain ASCII text only              */#define NIFTI_ECODE_XCEDE            8  /* David B Keator: dbkeator@uci.edu                                            http://www.nbirn.net/Resources                                                /Users/Applications/                                                /xcede/index.htm              */#define NIFTI_ECODE_JIMDIMINFO      10  /* Mark A Horsfield:                                           mah5@leicester.ac.uk                                           http://someplace/something         */#define NIFTI_ECODE_WORKFLOW_FWDS   12  /* Kate Fissell: fissell@pitt.edu                                           http://kraepelin.wpic.pitt.edu                                            /~fissell/NIFTI_ECODE_WORKFLOW_FWDS                                            /NIFTI_ECODE_WORKFLOW_FWDS.html   */#define NIFTI_ECODE_FREESURFER      14  /* http://surfer.nmr.mgh.harvard.edu  */#define NIFTI_ECODE_PYPICKLE        16  /* embedded Python objects                                           http://niftilib.sourceforge.net                                                 /pynifti                     */        /* LONI MiND codes: http://www.loni.ucla.edu/twiki/bin/view/Main/MiND */#define NIFTI_ECODE_MIND_IDENT      18  /* Vishal Patel: vishal.patel@ucla.edu*/#define NIFTI_ECODE_B_VALUE         20#define NIFTI_ECODE_SPHERICAL_DIRECTION 22#define NIFTI_ECODE_DT_COMPONENT    24#define NIFTI_ECODE_SHC_DEGREEORDER 26  /* end LONI MiND codes                */#define NIFTI_MAX_ECODE             26  /******* maximum extension code *******/]]&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Advice from the FSL team (thanks: Matt Webster and Dave Flitney) was for us to use ecode&amp;nbsp;=&amp;nbsp;6 (ASCII) since the audit trail is text in XML format.&amp;nbsp; Now one can produce an example data volume&lt;br /&gt;&lt;br /&gt;&lt;script class="brush: R" type="syntaxhighlighter"&gt;&lt;![CDATA[library("dcemriS4")norm &lt;- dnorm(seq(-5, 5, length=32), sd=2)norm &lt;- (norm - min(norm)) / max(norm - min(norm))img &lt;- outer(outer(norm, norm), norm)img &lt;- round(255 * img)img[17:32,,] &lt;- 255 - img[17:32,,]img.nifti &lt;- nifti(img) # create NIfTI objectwriteNIfTI(img.nifti, "img_nifti")]]&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;We now have a file "img_nifti.nii.gz" that is available to us and using a utility in FSL we can investigate the attributes of this file&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;% $FSLDIR/bin/fslhd img_nifti | grep 'vox_offset'&lt;br /&gt;vox_offset     1168&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;and reading the file back into R allows us to interrogate the ecode via its S4 slot&lt;br /&gt;&lt;br /&gt;&lt;script class="brush: R" type="syntaxhighlighter"&gt;&lt;![CDATA[library("dcemriS4")img.nifti &lt;- readNIfTI("img_nifti")img.nifti@"vox_offset"[1] 1168]]&gt;&lt;/script&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-345485890910484709?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dcemri.blogspot.com/feeds/345485890910484709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dcemri.blogspot.com/2010/01/writenifti-is-fully-compatible-with.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/345485890910484709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/345485890910484709'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2010/01/writenifti-is-fully-compatible-with.html' title='writeNIfTI() is fully compatible with FSLView'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-126825683890303246.post-4717573474830285876</id><published>2010-01-20T21:22:00.012Z</published><updated>2011-12-29T15:33:44.795Z</updated><title type='text'>Remote download and viewing of brain atlas</title><content type='html'>The &lt;b&gt;dcemriS4&lt;/b&gt; package allows one to easily import and display NIfTI-1 class data sets.  The following code takes the MNI152 brain atlas from the WWW and produces an orthographic display using the mid-axial, mid-sagittal and mid-coronal planes.&lt;br /&gt;&lt;br /&gt;&lt;script class="brush: R" type="syntaxhighlighter"&gt;&lt;![CDATA[library("dcemriS4")URL &lt;- "http://nifti.nimh.nih.gov/nifti-1/data/avg152T1_LR_nifti.nii.gz"FILE &lt;- system.file("nifti/mni152_LR.nii.gz", package="dcemriS4")download.file(URL, dest=FILE, quiet=FALSE, cacheOK=FALSE)mni &lt;- readNIfTI(FILE)par(bg="black")orthographic(mni)]]&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_pHQu7Zi9BfM/S1g2Kzku3cI/AAAAAAAABNM/S8UsXsJgXyk/s1600-h/example1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/_pHQu7Zi9BfM/S1g2Kzku3cI/AAAAAAAABNM/S8UsXsJgXyk/s400/example1.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/126825683890303246-4717573474830285876?l=dcemri.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/4717573474830285876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/126825683890303246/posts/default/4717573474830285876'/><link rel='alternate' type='text/html' href='http://dcemri.blogspot.com/2010/01/blog-post.html' title='Remote download and viewing of brain atlas'/><author><name>Brandon Whitcher</name><uri>https://profiles.google.com/110099336446354555254</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-ckEFWvBBHLs/AAAAAAAAAAI/AAAAAAAACkI/jxV_FqSw_mk/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_pHQu7Zi9BfM/S1g2Kzku3cI/AAAAAAAABNM/S8UsXsJgXyk/s72-c/example1.jpg' height='72' width='72'/></entry></feed>
