[vtkusers] Change pixel value from vtkImageData

Jose Ernesto Pfuturi Huisa daviddarkzero at hotmail.com
Sun Nov 2 23:39:54 EST 2008


Hi, it could be as follows:
vtkImageData blankImage=new vtkImageData();
blankImage.SetScalarTypeToDouble();//con este tipo funciona bien :)
blankImage.SetDimensions(dim ,dim, 1);
blankImage.SetOrigin(0,0,0);
blankImage.SetNumberOfScalarComponents(3);
for (int i = 0; i < dim; i++) {
  for (int j = 0; j < dim; j++) {
    blankImage.SetScalarComponentFromDouble(i,j,0,0, 1);//R
    blankImage.SetScalarComponentFromDouble(i,j,0,1, 0);//G
    blankImage.SetScalarComponentFromDouble(i,j,0,2, 0);//B
 }
}
blankImage.AllocateScalars();
...There are others forms.
 
Regards
 
José
> Date: Sun, 2 Nov 2008 10:13:15 -0800> From: florysf at gmail.com> To: vtkusers at vtk.org> Subject: [vtkusers] Change pixel value from vtkImageData> > > Hello,> > I want to change the value of a pixel given its coordinates(x, y, z). I am> using VTK with Java wrapping. I have tried to set the value with> img.SetScalarComponentFromDouble(x, y, z, 0, value);> but the value is not changed.> Unfortunately in Java the GetScalarPointer is not available so I cannot use> this solution.> Has anyone tried to do this before?> I would appreciate any help or suggestion.> > Regards,> Flory> > -- > View this message in context: http://www.nabble.com/Change-pixel-value-from-vtkImageData-tp20292218p20292218.html> Sent from the VTK - Users mailing list archive at Nabble.com.> > _______________________________________________> This is the private VTK discussion list.> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ> Follow this link to subscribe/unsubscribe:> http://www.vtk.org/mailman/listinfo/vtkusers
_________________________________________________________________
Llega la nueva temporada. Consulta las nuevas tendencias en MSN Estilo
http://estilo.es.msn.com/moda/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081103/ee2f02b0/attachment.htm>


More information about the vtkusers mailing list