HI , I had more or less the same problem some time ago. I was reading images within OsiriX which also uses DCMTK and I ended up with the following way of reading and writing from DCMTK images to vtkImageData. In my way of doing that I have a pointer to the DCMTK pixels... note that I am programming in Objective C++ so some points may not be so clear but I think what you need to check out is the loop where I am reading the pixels from the DCMTK images with the help of the pointer (fImage) and load them in the vtkImageData by using the following line of code:<br><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->GetPointData()->GetScalars()->SetTuple1(pixelID, pixelValue);<br><br></font></font></font>for me it worked fine... this is the snippet of my code: <br> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2">vtkImageData
*image=vtkImageData::New();</font></font></font></div><br><div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->SetOrigin( [[[[filter viewerController] pixList]objectAtIndex:i]originX], [[[[filter viewerController] pixList]objectAtIndex:i]originY], [[[[filter viewerController] pixList]objectAtIndex:i]originZ]);</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> </font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->SetExtent(0,(newwidth-1),0,(newheight-1),0,0);</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->SetWholeExtent(0,(newwidth-1),0,(newheight-1),0,0);</font></font></font></div> <div style="margin-bottom:
0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->SetUpdateExtent(0,(newwidth-1),0,(newheight-1),0,0);</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->SetUpdateExtentToWholeExtent();</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->AllocateScalars();</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> </font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> int counter=0;</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> for(int
y=0;y<newheight;y++)</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> {</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> for(int x=0;x<newwidth;x++)</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> {</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->GetPointData()->GetScalars()->SetTuple1(counter, fImage[newwidth*y+x]);</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> counter++;</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font
face="Monaco, monospace"><font size="2"> }</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> }</font></font></font></div> <div style="margin-bottom: 0cm;" align="left"><font color="#236e25"><font face="Monaco, monospace"><font size="2"> image->Update();</font></font></font></div> <br>Also note that due to the different coordinate system (DICOM and VTK) the resulting image will be flipped in the Y axis... Since the origin in DICOM is the upper left corner and the VT origin the lower left corner, the first top line of pixels that will be read from the DICOM image will be placed as the first bottom line of pixels in the vtkImageData image...<br><br>HTH <br><br>Emmanouil<br><p> 
<hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell.