<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi,<BR>
&nbsp;<BR>
&nbsp;&nbsp; I answered my previous question in part since&nbsp;I managed to create a vtkImageData from scratch by using the following:<BR>
&nbsp;<BR><FONT size=2>
MRI-&gt;SetDimensions(...etc...);<BR>
MRI-&gt;SetScalarTypeToUnsignedShort();<BR>
MRI-&gt;SetNumberOfScalarComponents(1); </FONT><FONT color=#008000 size=2>// image holds one value intensities<BR></FONT><FONT size=2>
MRI-&gt;SetSpacing(...etc...);<BR>
MRI-&gt;SetOrigin(...etc...);<BR>
MRI-&gt;AllocateScalars(); </FONT><FONT color=#008000 size=2>// allocate storage for image data</FONT><BR>
<FONT color=#008000 size=2>&nbsp;<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>short</FONT><FONT size=2> * VolPtr = (</FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>short</FONT><FONT size=2> *) MRI-&gt;GetScalarPointer();<BR>
</FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>( i=0; i&lt;Dim0*Dim1*Dim2; i++ )<BR>
{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *VolPtr= ...etc...;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *VolPtr++;<BR>
}<BR></FONT><FONT size=2>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
But I have a question:&nbsp; how do I set the orientation of the volume? The MRI data originally has a certain orientation given by a model matrix. Do I have to apply this orientation as a transformation to vtkImageData or is there another option to set that I did not find?<BR>
&nbsp;<BR>
Thank you in advance for your help, I am still new to vtk and if someone could hint me in the right direction that would help me a lot!<BR>
&nbsp;<BR>
Pascale<BR>
&nbsp;<BR>
&nbsp;<BR>
</FONT><BR><BR><BR><BR>&nbsp;<BR>

<HR id=EC_stopSpelling>
<BR>
From: chose29@hotmail.com<BR>To: vtkusers@vtk.org<BR>Date: Sat, 2 Aug 2008 09:29:27 -0400<BR>Subject: [vtkusers] create a vtkImageData from scratch<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</STYLE>
Hi everyone,<BR>&nbsp;<BR>&nbsp;&nbsp; I am trying to create a VTK imageData from scratch. I currently have a volume in an inhouse format. I have all the information to create a new volume (voxel intensities, dimensions, spacing, origin, model matrix) but do not know what to use to transform it to vtk. The volume went through a series of transformation and the model matrix is important. How can I create a vtk volume with the same orientation, intensities, etc..? I've searched in the archives of the vtk mailing list and found nothing that could help. If someone has an example that would be very helpfull,<BR>&nbsp;<BR>Thanks in advance!<BR>Pascale<BR><BR><BR>

<HR>
<BR><A href="http:///" target=_blank></A><br /><hr /> <a href='' target='_new'></a></body>
</html>