<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=How_to_read_.mnc_files_using_ITK</id>
	<title>How to read .mnc files using ITK - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=How_to_read_.mnc_files_using_ITK"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=How_to_read_.mnc_files_using_ITK&amp;action=history"/>
	<updated>2026-05-08T03:24:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=How_to_read_.mnc_files_using_ITK&amp;diff=19179&amp;oldid=prev</id>
		<title>Fedorov at 18:10, 16 February 2011</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=How_to_read_.mnc_files_using_ITK&amp;diff=19179&amp;oldid=prev"/>
		<updated>2011-02-16T18:10:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:10, 16 February 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*5 recompile ITK -- you should be able to read .mnc files now using itkImageFileReader&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*5 recompile ITK -- you should be able to read .mnc files now using itkImageFileReader&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* I found that BrainWeb template files are not readable &amp;quot;as is&amp;quot; even after this change, but they are readable by minc-tools. If you apply mincconvert first, you can read the file it produces with ITK:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* I found that BrainWeb template files are not readable &amp;quot;as is&amp;quot; even after this change&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, since they are in MINC 1 format&lt;/ins&gt;, but they are readable by minc-tools. If you apply mincconvert first &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to save them in MINC 2&lt;/ins&gt;, you can read the file it produces with ITK:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   mincconvert -2 brainweb.mnc brainweb-fixed.mnc&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   mincconvert -2 brainweb.mnc brainweb-fixed.mnc&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=How_to_read_.mnc_files_using_ITK&amp;diff=19176&amp;oldid=prev</id>
		<title>Fedorov: Created page with 'Recently, I needed to read .mnc files provided by BrainWeb available here: http://mouldy.bic.mni.mcgill.ca/brainweb/anatomic_normal.html. As it turned out, the format used to sto…'</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=How_to_read_.mnc_files_using_ITK&amp;diff=19176&amp;oldid=prev"/>
		<updated>2011-02-16T00:24:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;Recently, I needed to read .mnc files provided by BrainWeb available here: http://mouldy.bic.mni.mcgill.ca/brainweb/anatomic_normal.html. As it turned out, the format used to sto…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Recently, I needed to read .mnc files provided by BrainWeb available here: http://mouldy.bic.mni.mcgill.ca/brainweb/anatomic_normal.html. As it turned out, the format used to store these files is not supported by either Slicer or ITK out of the box. Here are the instructions how to get around this limitation.&lt;br /&gt;
&lt;br /&gt;
ITK 3.18 provides MINC2ImageIO in the review mode, however enabling it does not register the MINC2 IO factory, and some additional hacks are needed. Assuming you have Slicer built from source, you can use the following instructions to be able to read MINC2 files using ITK. This was tested on Ubuntu 10.04 x64:&lt;br /&gt;
&lt;br /&gt;
*1 you need to have MINC2 and NETCDF4 installed (on Ubuntu, install minc-tools, libminc2-1, libminc-dev, libnetcdf4, libnetcdf-dev)&lt;br /&gt;
*2 in Insight-build directory, run &amp;quot;ccmake .&amp;quot;, enable ITK_USE_MINC2. If the previous step completed correctly, the dependency libraries will be found, and ccmake configuration will succeed&lt;br /&gt;
*3 next is the hack part: copy MINC sources to the ITK IO directory &lt;br /&gt;
 cp Code/Review/*MINC2* Code/IO&lt;br /&gt;
*4 patch Code/IO/itkImageIOFactory.cxx and Code/IO/CMakeLists.txt to provide support for MINC2&lt;br /&gt;
&lt;br /&gt;
 ===================================================================&lt;br /&gt;
 RCS file: /cvsroot/Insight/Insight/Code/IO/CMakeLists.txt,v&lt;br /&gt;
 retrieving revision 1.98&lt;br /&gt;
 diff -r1.98 CMakeLists.txt&lt;br /&gt;
 61a62,63&lt;br /&gt;
 &amp;gt;   itkMINC2ImageIO.cxx&lt;br /&gt;
 &amp;gt;   itkMINC2ImageIOFactory.cxx&lt;br /&gt;
 93c95,97&lt;br /&gt;
 &amp;lt; ITKniftiio)&lt;br /&gt;
 ---&lt;br /&gt;
 &amp;gt; ITKniftiio&lt;br /&gt;
 &amp;gt; ${MINC2_LIB} ${HDF5_LIB} ${NETCDF_LIB}&lt;br /&gt;
 &amp;gt; )&lt;br /&gt;
 Index: itkImageIOFactory.cxx&lt;br /&gt;
 ===================================================================&lt;br /&gt;
 RCS file: /cvsroot/Insight/Insight/Code/IO/itkImageIOFactory.cxx,v&lt;br /&gt;
 retrieving revision 1.37&lt;br /&gt;
 diff -r1.37 itkImageIOFactory.cxx&lt;br /&gt;
 39a40&lt;br /&gt;
 &amp;gt; #include &amp;quot;itkMINC2ImageIOFactory.h&amp;quot;&lt;br /&gt;
 122a124&lt;br /&gt;
 &amp;gt;       ObjectFactoryBase::RegisterFactory( MINC2ImageIOFactory::New() );&lt;br /&gt;
&lt;br /&gt;
*5 recompile ITK -- you should be able to read .mnc files now using itkImageFileReader&lt;br /&gt;
&lt;br /&gt;
* I found that BrainWeb template files are not readable &amp;quot;as is&amp;quot; even after this change, but they are readable by minc-tools. If you apply mincconvert first, you can read the file it produces with ITK:&lt;br /&gt;
&lt;br /&gt;
  mincconvert -2 brainweb.mnc brainweb-fixed.mnc&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
</feed>