[vtkusers] How to change pixel color?

yenanqu at scs.fsu.edu yenanqu at scs.fsu.edu
Mon May 19 14:54:29 EDT 2008


No, I am still trying it. if you have other way to or could make it  
work, please, please let me know.

Yenan

Quoting Romuald BERTRAND <beromuald at wanadoo.fr>:

> Hi,
>
> Thanks for your answers.
>
> I have tried but pPix = (unsigned char*)id->GetScalarPointer();   
> doesn't work for me.
>
> when I change the components, nothing change, and after I have   
> display the array and I have seen it is null.
> Know you why?
>
> Yenan: Have you arrived to manipulate it correctly?
>
> Thanks
>
>
>
>> Message du 16/05/08 21:35
>> De : "Mark Wyszomierski"
>> A : yenanqu at scs.fsu.edu
>> Copie à : "Romuald BERTRAND" , vtkusers at vtk.org
>> Objet : Re: [vtkusers] How to change pixel color?
>>
>> >>  pPix = (unsigned char*)id->GetScalarPointer();
>>
>> That should work, I've used it many times for instance in this project:
>>
>>       
>> http://devsample.org/index.php?option=com_content&task=view&id=48&Itemid=27
>>
>> I show the value of the pixel that the mouse is over. Maybe there's
>> something else going on in your pipeline?
>>
>> Mark
>>
>>
>>
>> On 5/16/08, yenanqu at scs.fsu.edu  wrote:
>> >   How to get pointer from vtkImageData is the hardest thing,which I
>> > still can not make it.
>> >
>> > //id is vtkImageData
>> > int *uExtent = id->GetUpdateExtent();
>> > pPix = (unsigned char*)id->GetScalarPointer(uExtent[0], uExtent[2],
>> > uExtent[4]);
>> >
>> >   or
>> >
>> >   pPix = (unsigned char*)id->GetScalarPointer();
>> >
>> > the only method I could find out. It didn't work for me. try it to see
>> > if it works for you.
>> >
>> > Yenan
>> >
>> > Quoting Mark Wyszomierski :
>> >
>> >> Yeah once you get a pointer to the pixel data in vtkImageData you can
>> >> manipulate it however you want. It's just an array of values.
>> >>
>> >> Mark
>> >>
>> >> On 5/16/08, yenanqu at scs.fsu.edu  wrote:
>> >>> Did you retrieve pixel data from vtkImageData seccessfully?
>> >>>
>> >>>
>> >>> Yenan
>> >>> Quoting Romuald BERTRAND :
>> >>>
>> >>>> Hi all,
>> >>>>
>> >>>> I have to display an image for my work. After, I have to change the
>> >>>> color of several pixels, I don't know why. I have a vtkImageData,
>> >>>> and I have search some methods to set the scalars of the pixels
>> >>>> which are stored in, but I don't arrived.
>> >>>>
>> >>>> Someone could help me?
>> >>>>
>> >>>> Thanks for answers.
>> >>>>
>> >>>> Romuald
>> >>>>
>> >>>> --
>> >>>> This message has been scanned for viruses and
>> >>>> dangerous content by MailScanner, and is
>> >>>> believed to be clean.
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>> ----------------------------------------------------------------
>> >>> This message was sent using IMP, the Internet Messaging Program.
>> >>>
>> >>>
>> >>> --
>> >>> This message has been scanned for viruses and
>> >>> dangerous content by MailScanner, and is
>> >>> believed to be clean.
>> >>>
>> >>> _______________________________________________
>> >>> 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
>> >>>
>> >>
>> >> --
>> >> This message has been scanned for viruses and
>> >> dangerous content by MailScanner, and is
>> >> believed to be clean.
>> >>
>> >>
>> >
>> >
>> >
>> > ----------------------------------------------------------------
>> > This message was sent using IMP, the Internet Messaging Program.
>> >
>> >
>> > --
>> > This message has been scanned for viruses and
>> > dangerous content by MailScanner, and is
>> > believed to be clean.
>> >
>> >
>>
>>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the vtkusers mailing list