<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Imaging and a little bit of OSS &#187; image processing</title>
	<atom:link href="http://nuclear-imaging.info/site_content/tag/image-processing/feed/" rel="self" type="application/rss+xml" />
	<link>http://nuclear-imaging.info/site_content</link>
	<description>Yet another techno blog</description>
	<lastBuildDate>Wed, 04 Jan 2012 18:29:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Converting .hdr/.img files to .nii</title>
		<link>http://nuclear-imaging.info/site_content/2010/03/08/converting-hdrimg-files-to-nii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=converting-hdrimg-files-to-nii</link>
		<comments>http://nuclear-imaging.info/site_content/2010/03/08/converting-hdrimg-files-to-nii/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 20:10:28 +0000</pubDate>
		<dc:creator>slash_boot</dc:creator>
				<category><![CDATA[Imaging]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[mri]]></category>
		<category><![CDATA[segmentation]]></category>

		<guid isPermaLink="false">http://nuclear-imaging.info/site_content/?p=323</guid>
		<description><![CDATA[In order to convert files in .img and .hdr format to a single .nii file, we first need to install the nifti tools toolbox for matlab. nifti tools Once the path for nifti tools has been set in matlab, the files in .hdr and .img format can be combined to create a .nii file by <a href='http://nuclear-imaging.info/site_content/2010/03/08/converting-hdrimg-files-to-nii/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>In order to convert files in .img and .hdr format to a single .nii file, we first need to install the nifti tools toolbox for matlab.</p>
<p><a title="Download niftitools" href="http://www.rotman-baycrest.on.ca/~jimmy/NIFTI/" target="_blank">nifti tools</a></p>
<p>Once the path for nifti tools has been set in matlab, the files in .hdr and .img format can be combined to create a .nii file by running the following two commands:</p>
<blockquote><p>nii=load_nii(&#8216;filename_with_hdr_extension&#8217;);<br />
save_nii(nii, &#8216;desired_filename_for_niftifile.nii&#8217;);</p></blockquote>
<p>If you have freesurfer installed, you can convert between the files types with mri_convert by specifying the input (-it) and the output (-ot) type.</p>
<blockquote><p>mri_convert -i <em>name_of_input_file</em> -it <em>nifti1</em> -ot <em>nii</em> -o <em>name_of_output_file</em></p></blockquote>
<p>If you have functional dataset with several volumes over the course of your experiment, you can use the fslmerge function available in FSL to combine all the nifti files into a single 4D file.</p>
<blockquote><p>fslmerge -t output_name.nii *.nii</p></blockquote>
<p>Where *.nii would cover the entire set of nifti files if they are arranged sequentially.</p>
<p>Its not required to type in the extension .hdr or .img for the input image or output image if you have specified the input and the output types. By specifying the input type of nifti1, you tell the program that it will be a .hdr/.img pair, and specifying output type as nii goes for having your output with .nii extension.</p>
<p>To gzip the nifti file for use in freesurfer:</p>
<blockquote><p>gzip filename.nii filename1.nii.gz</p></blockquote>
<p>This will create a gzipped nifti file.</p>
<p>To automatically segment the structural volume:</p>
<blockquote><p>recon_all -i filename1.nii.gz -subjid SUBJID -all</p></blockquote>
<p>This will segment the structures containing in the structural file filename.nii.gz. Complete information on using recon-all for freesurfer can be found at <a title="FreeSurfer Wiki" href="https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all" target="_blank">FreeSurfer Wiki</a>.</p>
<p>For some reason, Freesurfer seems to work well in tcsh. I&#8217;ve often encountered problems of weird nature when running it under bash. In order to run your autosegmentation with freesurfer type in tcsh at the terminal, since by default it is set to bash in most linux distros.</p>
]]></content:encoded>
			<wfw:commentRss>http://nuclear-imaging.info/site_content/2010/03/08/converting-hdrimg-files-to-nii/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

