<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557</link>
    <title>MATLAB Central Newsreader - Created raw file cannot be read</title>
    <description>Feed for thread: Created raw file cannot be read</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.co.uk/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 05 Jul 2012 00:56:55 +0000</pubDate>
      <title>Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881907</link>
      <author>Siti_Mustaqim</author>
      <description>Hi, &lt;br&gt;
I have problem in creating raw file for image matlab file. I have CT image which has been sampled to 168x168x72 double and I would like to use elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&lt;br&gt;
fid=fopen('CTdata.raw','w+');&lt;br&gt;
fwrite(fid,CTdata,'double');&lt;br&gt;
&lt;br&gt;
Then CTdata.raw is created in my existing path. I take a 'mhd' file somewhere, delete the contents and put the information related to my data and save as CTdata.mhd. &lt;br&gt;
&lt;br&gt;
Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be read. I also tried elastix toolbox yet failed.&lt;br&gt;
&lt;br&gt;
Is my way correct? Can someone please advise?&lt;br&gt;
&lt;br&gt;
Thank you.</description>
    </item>
    <item>
      <pubDate>Thu, 05 Jul 2012 13:30:07 +0000</pubDate>
      <title>Re: Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881957</link>
      <author>dpb</author>
      <description>On 7/4/2012 7:56 PM, Siti_Mustaqim wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; I have problem in creating raw file for image matlab file. I have CT&lt;br&gt;
&amp;gt; image which has been sampled to 168x168x72 double and I would like&lt;br&gt;
&amp;gt; touse elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; fid=fopen('CTdata.raw','w+');&lt;br&gt;
&amp;gt; fwrite(fid,CTdata,'double');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Then CTdata.raw is created in my existing path. I take a 'mhd' file&lt;br&gt;
&amp;gt; somewhere, delete the contents and put the information related to my&lt;br&gt;
&amp;gt; data and save as CTdata.mhd.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be&lt;br&gt;
&amp;gt; read.I also tried elastix toolbox yet failed.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Is my way correct? Can someone please advise?&lt;br&gt;
&lt;br&gt;
I've no clue about "mha_read_volume" but it appears you're confusing &lt;br&gt;
that somehow the extension on a file has any bearing on it's content.&lt;br&gt;
&lt;br&gt;
If you wrote the file w/ fwrite() and then just (in effect) renamed it &lt;br&gt;
by the machinations to a file w/ another extension, it's still the same &lt;br&gt;
stream file fwrite() wrote.&lt;br&gt;
&lt;br&gt;
So, read it back w/ fread()&lt;br&gt;
&lt;br&gt;
fid=fopen('CTdata.mhd','r');&lt;br&gt;
x=fread(fid);&lt;br&gt;
fid=fclose(fid);&lt;br&gt;
x=reshape(x,168,168,72);&lt;br&gt;
&lt;br&gt;
If you're trying to create a file in some other specific format you'll &lt;br&gt;
have to write out whatever that format is specifically either from &lt;br&gt;
knowing it and writing the pieces-parts w/ a combination of fwrite() &lt;br&gt;
calls of the appropriate form/info or find some utility that does so.  I &lt;br&gt;
have no knowledge of what a 'mhd' file might be...&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
    <item>
      <pubDate>Thu, 05 Jul 2012 15:30:28 +0000</pubDate>
      <title>Re: Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881977</link>
      <author>Siti_Mustaqim</author>
      <description>&lt;br&gt;
Thank you for your reply,&lt;br&gt;
Actually I follow the instruction in this link;&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.itk.org/pipermail/insight-users/2007-November/024337.html"&gt;http://www.itk.org/pipermail/insight-users/2007-November/024337.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
mhd image and raw file is for medical images. I want to use them for ITK appication which is new to me.&lt;br&gt;
&lt;br&gt;
Thanks again.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Thursday, 5 July 2012 21:30:07 UTC+8, dpb  wrote:&lt;br&gt;
&amp;gt; On 7/4/2012 7:56 PM, Siti_Mustaqim wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; I have problem in creating raw file for image matlab file. I have CT&lt;br&gt;
&amp;gt; &amp;gt; image which has been sampled to 168x168x72 double and I would like&lt;br&gt;
&amp;gt; &amp;gt; touse elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; fid=fopen('CTdata.raw','w+');&lt;br&gt;
&amp;gt; &amp;gt; fwrite(fid,CTdata,'double');&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Then CTdata.raw is created in my existing path. I take a 'mhd' file&lt;br&gt;
&amp;gt; &amp;gt; somewhere, delete the contents and put the information related to my&lt;br&gt;
&amp;gt; &amp;gt; data and save as CTdata.mhd.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be&lt;br&gt;
&amp;gt; &amp;gt; read.I also tried elastix toolbox yet failed.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Is my way correct? Can someone please advise?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I've no clue about "mha_read_volume" but it appears you're confusing &lt;br&gt;
&amp;gt; that somehow the extension on a file has any bearing on it's content.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you wrote the file w/ fwrite() and then just (in effect) renamed it &lt;br&gt;
&amp;gt; by the machinations to a file w/ another extension, it's still the same &lt;br&gt;
&amp;gt; stream file fwrite() wrote.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So, read it back w/ fread()&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; fid=fopen('CTdata.mhd','r');&lt;br&gt;
&amp;gt; x=fread(fid);&lt;br&gt;
&amp;gt; fid=fclose(fid);&lt;br&gt;
&amp;gt; x=reshape(x,168,168,72);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If you're trying to create a file in some other specific format you'll &lt;br&gt;
&amp;gt; have to write out whatever that format is specifically either from &lt;br&gt;
&amp;gt; knowing it and writing the pieces-parts w/ a combination of fwrite() &lt;br&gt;
&amp;gt; calls of the appropriate form/info or find some utility that does so.  I &lt;br&gt;
&amp;gt; have no knowledge of what a 'mhd' file might be...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; --</description>
    </item>
    <item>
      <pubDate>Thu, 05 Jul 2012 15:42:26 +0000</pubDate>
      <title>Re: Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881980</link>
      <author>dpb</author>
      <description>On 7/5/2012 10:30 AM, Siti_Mustaqim wrote:&lt;br&gt;
&lt;br&gt;
...[top posting repaired.  Please don't do that--hard follow &lt;br&gt;
conversation makes]...&lt;br&gt;
&lt;br&gt;
&amp;gt; On Thursday, 5 July 2012 21:30:07 UTC+8, dpb  wrote:&lt;br&gt;
&amp;gt;&amp;gt; On 7/4/2012 7:56 PM, Siti_Mustaqim wrote:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Hi,&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; I have problem in creating raw file for image matlab file. I have CT&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; image which has been sampled to 168x168x72 double and I would like&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; touse elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; fid=fopen('CTdata.raw','w+');&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; fwrite(fid,CTdata,'double');&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Then CTdata.raw is created in my existing path. I take a 'mhd' file&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; somewhere, delete the contents and put the information related to my&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; data and save as CTdata.mhd.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; read.I also tried elastix toolbox yet failed.&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; Is my way correct? Can someone please advise?&lt;br&gt;
...&lt;br&gt;
&amp;nbsp;&amp;gt; Thank you for your reply,&lt;br&gt;
&amp;nbsp;&amp;gt; Actually I follow the instruction in this link;&lt;br&gt;
&amp;nbsp;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;gt; &lt;a href="http://www.itk.org/pipermail/insight-users/2007-November/024337.html"&gt;http://www.itk.org/pipermail/insight-users/2007-November/024337.html&lt;/a&gt;&lt;br&gt;
&amp;nbsp;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;gt; mhd image and raw file is for medical images. I want to use them for &lt;br&gt;
ITK appication which is new to me.&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
&amp;nbsp;From you description, it sounded like you simply copied the image data &lt;br&gt;
into the other file; you didn't show/say anything about writing a header &lt;br&gt;
so there's no way to know what may be the problem.&lt;br&gt;
&lt;br&gt;
It could be you didn't format the header-file information correctly or &lt;br&gt;
something else.&lt;br&gt;
&lt;br&gt;
Did you look at the content of the created .mhd file?  Does it appear to &lt;br&gt;
follow the correct form?  What kind of an error message, if any, did you &lt;br&gt;
get trying to load it?&lt;br&gt;
&lt;br&gt;
The crystal ball doesn't have much to go on here...&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
    <item>
      <pubDate>Thu, 05 Jul 2012 16:33:55 +0000</pubDate>
      <title>Re: Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881991</link>
      <author>Siti_Mustaqim</author>
      <description>I have overlooked the responses in the cited ITK discussion, there is a matlab file to convert mat to mhd;&lt;br&gt;
&lt;br&gt;
&lt;a href="http://old.nabble.com/How-to-read-.Mat-File-using-ITK-%2B-C%2B%2B-td30402760.html"&gt;http://old.nabble.com/How-to-read-.Mat-File-using-ITK-%2B-C%2B%2B-td30402760.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
by:&lt;br&gt;
&lt;br&gt;
----------------- &lt;br&gt;
Jean-Pierre Roux&lt;br&gt;
CNRS UMR 5220, INSERM U1440&lt;br&gt;
&lt;br&gt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
Then after editing the mha_read_volume; I can get the image back in mat from created mhd and raw files; In the mha_read_volume function; it implements this command; &lt;br&gt;
&lt;br&gt;
datasize=prod(info.Dimensions)*info.BitDepth/8;&lt;br&gt;
&lt;br&gt;
where my mhd file generated BitDepth=0 causing the datasize to be 0; and fail to create the matrix. Many thanks to both of them Dr. Roux and Dr. Dirk-Jan.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Thursday, 5 July 2012 23:30:28 UTC+8, Siti_Mustaqim  wrote:&lt;br&gt;
&amp;gt; Thank you for your reply,&lt;br&gt;
&amp;gt; Actually I follow the instruction in this link;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href="http://www.itk.org/pipermail/insight-users/2007-November/024337.html"&gt;http://www.itk.org/pipermail/insight-users/2007-November/024337.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; mhd image and raw file is for medical images. I want to use them for ITK appication which is new to me.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks again.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; On Thursday, 5 July 2012 21:30:07 UTC+8, dpb  wrote:&lt;br&gt;
&amp;gt; &amp;gt; On 7/4/2012 7:56 PM, Siti_Mustaqim wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have problem in creating raw file for image matlab file. I have CT&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; image which has been sampled to 168x168x72 double and I would like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; touse elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fid=fopen('CTdata.raw','w+');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fwrite(fid,CTdata,'double');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Then CTdata.raw is created in my existing path. I take a 'mhd' file&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; somewhere, delete the contents and put the information related to my&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; data and save as CTdata.mhd.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; read.I also tried elastix toolbox yet failed.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Is my way correct? Can someone please advise?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I've no clue about "mha_read_volume" but it appears you're confusing &lt;br&gt;
&amp;gt; &amp;gt; that somehow the extension on a file has any bearing on it's content.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If you wrote the file w/ fwrite() and then just (in effect) renamed it &lt;br&gt;
&amp;gt; &amp;gt; by the machinations to a file w/ another extension, it's still the same &lt;br&gt;
&amp;gt; &amp;gt; stream file fwrite() wrote.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; So, read it back w/ fread()&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; fid=fopen('CTdata.mhd','r');&lt;br&gt;
&amp;gt; &amp;gt; x=fread(fid);&lt;br&gt;
&amp;gt; &amp;gt; fid=fclose(fid);&lt;br&gt;
&amp;gt; &amp;gt; x=reshape(x,168,168,72);&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If you're trying to create a file in some other specific format you'll &lt;br&gt;
&amp;gt; &amp;gt; have to write out whatever that format is specifically either from &lt;br&gt;
&amp;gt; &amp;gt; knowing it and writing the pieces-parts w/ a combination of fwrite() &lt;br&gt;
&amp;gt; &amp;gt; calls of the appropriate form/info or find some utility that does so.  I &lt;br&gt;
&amp;gt; &amp;gt; have no knowledge of what a 'mhd' file might be...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; --</description>
    </item>
    <item>
      <pubDate>Thu, 05 Jul 2012 16:42:42 +0000</pubDate>
      <title>Re: Created raw file cannot be read</title>
      <link>http://www.mathworks.co.uk/matlabcentral/newsreader/view_thread/321557#881992</link>
      <author>Siti_Mustaqim</author>
      <description>&lt;br&gt;
Many thanks to you too DBP :).&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On Friday, 6 July 2012 00:33:55 UTC+8, Siti_Mustaqim  wrote:&lt;br&gt;
&amp;gt; I have overlooked the responses in the cited ITK discussion, there is a matlab file to convert mat to mhd;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href="http://old.nabble.com/How-to-read-.Mat-File-using-ITK-%2B-C%2B%2B-td30402760.html"&gt;http://old.nabble.com/How-to-read-.Mat-File-using-ITK-%2B-C%2B%2B-td30402760.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; by:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ----------------- &lt;br&gt;
&amp;gt; Jean-Pierre Roux&lt;br&gt;
&amp;gt; CNRS UMR 5220, INSERM U1440&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt; Then after editing the mha_read_volume; I can get the image back in mat from created mhd and raw files; In the mha_read_volume function; it implements this command; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; datasize=prod(info.Dimensions)*info.BitDepth/8;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where my mhd file generated BitDepth=0 causing the datasize to be 0; and fail to create the matrix. Many thanks to both of them Dr. Roux and Dr. Dirk-Jan.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; On Thursday, 5 July 2012 23:30:28 UTC+8, Siti_Mustaqim  wrote:&lt;br&gt;
&amp;gt; &amp;gt; Thank you for your reply,&lt;br&gt;
&amp;gt; &amp;gt; Actually I follow the instruction in this link;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;a href="http://www.itk.org/pipermail/insight-users/2007-November/024337.html"&gt;http://www.itk.org/pipermail/insight-users/2007-November/024337.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; mhd image and raw file is for medical images. I want to use them for ITK appication which is new to me.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Thanks again.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; On Thursday, 5 July 2012 21:30:07 UTC+8, dpb  wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; On 7/4/2012 7:56 PM, Siti_Mustaqim wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I have problem in creating raw file for image matlab file. I have CT&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; image which has been sampled to 168x168x72 double and I would like&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; touse elastix/ITK for registration. I convert them to raw file as follows:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fid=fopen('CTdata.raw','w+');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; fwrite(fid,CTdata,'double');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Then CTdata.raw is created in my existing path. I take a 'mhd' file&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; somewhere, delete the contents and put the information related to my&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; data and save as CTdata.mhd.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Then I tried to use "mha_read_volume" by Dirk-Jan; it couldnt be&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; read.I also tried elastix toolbox yet failed.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Is my way correct? Can someone please advise?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I've no clue about "mha_read_volume" but it appears you're confusing &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; that somehow the extension on a file has any bearing on it's content.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; If you wrote the file w/ fwrite() and then just (in effect) renamed it &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; by the machinations to a file w/ another extension, it's still the same &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; stream file fwrite() wrote.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; So, read it back w/ fread()&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fid=fopen('CTdata.mhd','r');&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; x=fread(fid);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; fid=fclose(fid);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; x=reshape(x,168,168,72);&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; If you're trying to create a file in some other specific format you'll &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have to write out whatever that format is specifically either from &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; knowing it and writing the pieces-parts w/ a combination of fwrite() &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; calls of the appropriate form/info or find some utility that does so.  I &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; have no knowledge of what a 'mhd' file might be...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; --</description>
    </item>
  </channel>
</rss>
