<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi, it could be as follows:<BR><FONT size=2>
<P align=left>vtkImageData blankImage=</FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkImageData();</P>
<P align=left>blankImage.SetScalarTypeToDouble();</FONT><FONT color=#3f7f5f size=2>//con este tipo funciona bien :)</P></FONT><FONT size=2>
<P align=left>blankImage.SetDimensions(dim ,dim, 1);</P>
<P align=left>blankImage.SetOrigin(0,0,0);</P>
blankImage.SetNumberOfScalarComponents(3);<BR></FONT><B><FONT color=#7f0055 size=2>
<P align=left>for</B></FONT><FONT color=#000000 size=2> (</FONT><B><FONT color=#7f0055 size=2>int</B></FONT><FONT size=2><FONT color=#000000> i = 0; i < dim; i++) {</FONT></P>
<P align=left></FONT><B><FONT color=#7f0055 size=2> for</B></FONT><FONT size=2> (</FONT><B><FONT color=#7f0055 size=2>int</B></FONT><FONT size=2> j = 0; j < dim; j++) {</P>
<P align=left> blankImage.SetScalarComponentFromDouble(i,j,0,0, 1);</FONT><FONT color=#3f7f5f size=2>//R</P></FONT><FONT size=2>
<P align=left> blankImage.SetScalarComponentFromDouble(i,j,0,1, 0);</FONT><FONT color=#3f7f5f size=2>//G</P></FONT><FONT size=2>
<P align=left> blankImage.SetScalarComponentFromDouble(i,j,0,2, 0);</FONT><FONT color=#3f7f5f size=2>//B</P></FONT><FONT size=2>
<P align=left> }</P>
<P align=left>}</P>
blankImage.AllocateScalars();<BR>
</FONT>...<BR>There are others forms.<BR>
<BR>
Regards<BR>
<BR>
José<BR>
<BR>> Date: Sun, 2 Nov 2008 10:13:15 -0800<BR>> From: florysf@gmail.com<BR>> To: vtkusers@vtk.org<BR>> Subject: [vtkusers] Change pixel value from vtkImageData<BR>> <BR>> <BR>> Hello,<BR>> <BR>> I want to change the value of a pixel given its coordinates(x, y, z). I am<BR>> using VTK with Java wrapping. I have tried to set the value with<BR>> img.SetScalarComponentFromDouble(x, y, z, 0, value);<BR>> but the value is not changed.<BR>> Unfortunately in Java the GetScalarPointer is not available so I cannot use<BR>> this solution.<BR>> Has anyone tried to do this before?<BR>> I would appreciate any help or suggestion.<BR>> <BR>> Regards,<BR>> Flory<BR>> <BR>> -- <BR>> View this message in context: http://www.nabble.com/Change-pixel-value-from-vtkImageData-tp20292218p20292218.html<BR>> Sent from the VTK - Users mailing list archive at Nabble.com.<BR>> <BR>> _______________________________________________<BR>> This is the private VTK discussion list.<BR>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>> Follow this link to subscribe/unsubscribe:<BR>> http://www.vtk.org/mailman/listinfo/vtkusers<BR><BR><br /><hr />La cartera, las gafas. ¿te falta algo? <a href='http://www.vivelive.com/abecedario' target='_new'>Ahora llévate Messenger en tu móvil</a></body>
</html>