<div><span class="gmail_quote">On 11/25/07, <b class="gmail_sendername">Mengchen Zhu</b> <<a href="mailto:mengchen.zhu@hotmail.com">mengchen.zhu@hotmail.com</a>> wrote:</span></div>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hi,<br><br>Thanks Mathieu. The problem is, the 3D data are not "images" in the first place. The ultrasound data are reconstructed from RF signal directly; the CT, I don't know - </div></blockquote>
<div> </div>
<div>Of course, you need to find a way to interpret the data. Images are really just data stored on a regular grid.</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div><br>So the question should be, can I use the matrix in Matlab to construct image in ITK? I have the physical dimension of voxels by the way, so the data indeed can be treated as images, without header that is. </div>
</blockquote>
<div> </div>
<div>
<div>Write out the 3D image in matlab in raw format. For instance a CT image may be writtten as</div>
<div> </div>
<div>fid=fopen('image.raw','w+');<br>cnt=fwrite(fid,mymatrix,'short');<br>fclose(fid);<br> </div>
<div>Create a metaimage header in ITK for the raw data : image.mhd . Look in ITK's testing tree, you should find plenty of examples. Here's an example. </div>
<div> </div>
<div>NDims = 3<br>DimSize = 100 100 100<br>ElementSize = 4.000000e+000 4.000000e+000 4.000000e+000<br>ElementSpacing = 4.000000e+000 4.000000e+000 4.000000e+000<br>ElementType = MET_SHORT<br>ElementByteOrderMSB = False<br>
ElementDataFile = image.raw</div>
<div><br> </div>
<div>You should be able to load image.mhd in ITK.</div></div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>If no apparent way exists, I will probably use fprintf() to export the mat as text file and construct my image in ITK using the data in the text.<br><br>Thanks,<br>MC<br><br>> Date: Sun, 25 Nov 2007 18:30:26 +0100
<br>> From: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mathieu.malaterre@gmail.com" target="_blank">mathieu.malaterre@gmail.com</a><br>> To: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mengchen.zhu@hotmail.com" target="_blank">
mengchen.zhu@hotmail.com</a><br>> Subject: Re: [Insight-users] Convert 3D image data from Matlab .mat file<br>> CC: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:insight-users@itk.org" target="_blank">
insight-users@itk.org</a><br>> <br>> On Nov 25, 2007 9:19 AM, Mengchen Zhu <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mengchen.zhu@hotmail.com" target="_blank">mengchen.zhu@hotmail.com
</a>> wrote:<br>> ><br>> > Hi folks,<br>> ><br>> > I have some 3D CT and Ultrasound volume data saved as .mat files, with voxel<br>> > data type int16; what is the best way to export them into ITK for
<br>> > processing? I guess I could export them as DICOM, but not sure.<br>> <br>> Matlab has built-in support for DICOM (read/write). For writing a<br>> DICOM file, just go to:<br>> <br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/index.html?/access/helpdesk/help/toolbox/images/dicomwrite.html" target="_blank">
http://www.mathworks.com/access/helpdesk/help/toolbox/images/index.html?/access/helpdesk/help/toolbox/images/dicomwrite.html</a><br>> <br>> The question that remains, is where do these images come from ?<br>> Without knowing the modalities or the proper DICOM object you will not
<br>> be able to create the correct meta data info for the header. This<br>> would be better to investigate where is the source for those .mat<br>> files.<br>> <br>> HTH<br>> <br>> -- <br>> Mathieu
<br><br>
<hr>
Express yourself with free Messenger emoticons. <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.freemessengeremoticons.ca/?icid=EMENCA122" target="_blank">Get them today!</a></div><br>_______________________________________________
<br>Insight-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">
http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div>