[vtkusers] vtkusers Digest, Vol 49, Issue 16

Peter Methfessel PeterMethfessel at gmx.de
Sat May 17 13:21:50 EDT 2008


Send vtkusers mailing list submissions to
vtkusers at vtk.org

To subscribe or unsubscribe via the World Wide Web, visit
http://www.vtk.org/mailman/listinfo/vtkusers
or, via email, send a message with subject or body 'help' to
vtkusers-request at vtk.org

You can reach the person managing the list at
vtkusers-owner at vtk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of vtkusers digest..."


Today's Topics:

   1. 3D morphing of polygonal surface (Andrea Bottino)
   2. How to change pixel color? (Romuald BERTRAND)
   3. Re: How to change pixel color? (yenanqu at scs.fsu.edu)
   4. Re: How to change pixel color? (Mark Wyszomierski)
   5. Re: How to change pixel color? (yenanqu at scs.fsu.edu)
   6. Re: How to change pixel color? (Mark Wyszomierski)
   7. Re: How to converting coordinates from dataset to view? -
      Part two (Wagner Sales)
   8. How to save the stenciled images? ( Mark Jefferson )
   9. Re: Modifying sphere radius from actor (Kenneth Evans, Jr.)
  10. Link between ITK and VTK (C. Hiba)
  11. Link between ITK and VTK (C. Hiba)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 May 2008 19:00:40 +0200
From: Andrea Bottino <andrea.bottino at polito.it>
Subject: [vtkusers] 3D morphing of polygonal surface
To: VTK Users <vtkusers at vtk.org>
Message-ID: <482C6C38.8020404 at polito.it>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

(I apologize for multiple copies, but my previous msg apparently never
reached the list)

one question before reinventing the wheel...
I have to morph a 3D polygonal model into another. I've been able to do
it by constraining a transformation choosing a set of correspondences on
the two surfaces. However, these were selected at hand. I need something
that does the morphing automatically.
I've read that some derivations of the iterative closest point
(considering non affine transformations) does this, however in VTK only
affine transformations are coded. The 3Dmorph test program also was not
of any help.
Does anybody have some suggestions?


-- 
Andrea Bottino
Politecnico di Torino, DAUIN
Corso Duca degli Abruzzi, 24
10129 Torino ITALY
Tel +39 011 5647175 / Fax +39 011 5647099
http://www.polito.it/cgvg



------------------------------

Message: 2
Date: Fri, 16 May 2008 15:02:17 +0200 (CEST)
From: Romuald BERTRAND <beromuald at wanadoo.fr>
Subject: [vtkusers] How to change pixel color?
To: vtkusers at vtk.org
Message-ID: <17686669.642951210942937001.JavaMail.www at wwinf1510>
Content-Type: text/plain; charset="utf-8"

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.vtk.org/pipermail/vtkusers/attachments/20080516/a9c356b6/attachment-0001.htm>

------------------------------

Message: 3
Date: Fri, 16 May 2008 14:03:03 -0400
From: yenanqu at scs.fsu.edu
Subject: Re: [vtkusers] How to change pixel color?
To: Romuald BERTRAND <beromuald at wanadoo.fr>
Cc: vtkusers at vtk.org
Message-ID: <20080516140303.p3babges8c4kss00 at email.scs.fsu.edu>
Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes";
format="flowed"

Did you retrieve pixel data from vtkImageData seccessfully?


Yenan
Quoting Romuald BERTRAND <beromuald at wanadoo.fr>:

> 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.



------------------------------

Message: 4
Date: Fri, 16 May 2008 14:14:13 -0400
From: "Mark Wyszomierski" <markww at gmail.com>
Subject: Re: [vtkusers] How to change pixel color?
To: yenanqu at scs.fsu.edu
Cc: vtkusers at vtk.org
Message-ID:
<dfdfe01e0805161114t59d4564es626ea057e4b7ca3b at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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 <yenanqu at scs.fsu.edu> wrote:
> Did you retrieve pixel data from vtkImageData seccessfully?
>
>
> Yenan
> Quoting Romuald BERTRAND <beromuald at wanadoo.fr>:
>
>> 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
>


------------------------------

Message: 5
Date: Fri, 16 May 2008 14:27:11 -0400
From: yenanqu at scs.fsu.edu
Subject: Re: [vtkusers] How to change pixel color?
To: Mark Wyszomierski <markww at gmail.com>
Cc: vtkusers at vtk.org
Message-ID: <20080516142711.y23bvz6sgg8sc4cc at email.scs.fsu.edu>
Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes";
format="flowed"

  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 <markww at gmail.com>:

> 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 <yenanqu at scs.fsu.edu> wrote:
>> Did you retrieve pixel data from vtkImageData seccessfully?
>>
>>
>> Yenan
>> Quoting Romuald BERTRAND <beromuald at wanadoo.fr>:
>>
>>> 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.



------------------------------

Message: 6
Date: Fri, 16 May 2008 15:35:05 -0400
From: "Mark Wyszomierski" <markww at gmail.com>
Subject: Re: [vtkusers] How to change pixel color?
To: yenanqu at scs.fsu.edu
Cc: vtkusers at vtk.org
Message-ID:
<dfdfe01e0805161235q1f5d4825j2011f051b9c61233 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

>>  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 <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 <markww at gmail.com>:
>
>> 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 <yenanqu at scs.fsu.edu> wrote:
>>> Did you retrieve pixel data from vtkImageData seccessfully?
>>>
>>>
>>> Yenan
>>> Quoting Romuald BERTRAND <beromuald at wanadoo.fr>:
>>>
>>>> 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.
>
>


------------------------------

Message: 7
Date: Fri, 16 May 2008 19:43:14 -0300
From: "Wagner Sales" <wsales at gmail.com>
Subject: Re: [vtkusers] How to converting coordinates from dataset to
view? - Part two
To: vtkusers at vtk.org
Message-ID:
<11b83aa60805161543o6fedae2asbcb884a7054408e9 at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi all,

This answer are just for future searches in the list.
The code and approach are right. The problem was other, that's don't need to
be mentioned here since aren't VTK related.

Regards,

Wagner Sales

2008/5/14 Wagner Sales <wsales at gmail.com>:

> Hi all,
>
> The following message was sent in some minutes ago.
> I'm trying to show marked points in a 2D view from a dataset in 3D view of
> segmented data from this dataset. To explain more:
> a) I have a DICOM dataset
> b) In 2D view I was marked some points to use in segmentation, done by 
> ITK.
> The segmentation works fine, then I think my points are marked ok.
> c) After segmentation, I extract the polydata and show in a 3D view.
> d) Then, I try to create new points in 2D view and show in 3D. The points
> are created, but in 3D appears in a different location.
> Well, I think I need to convert the coordinates from the point and after
> that set manually the position of the point (a vtkActor) in 3D view.
>
> Are I'm correct? If yes, how to convert these coordinates? Are another 
> more
> simple approach?
>
> Well, taking a look at my VTK book and some examples, I think I need to
> translate the dataset to global coordinates. This are done by the 
> following
> code:
>
> double *Point::translateCoordinates(int x, int y, int z)
> {
>        // m_CurrentImageData are a vtkImageData instance
>         if(!m_CurrentImageData)
>         {
>                 xyzCoords[0] = 0.0;
>                 xyzCoords[1] = 0.0;
>                 xyzCoords[2] = 0.0;
>                 return xyzCoords;
>         }
>         q[0] = x;
>         q[1] = y;
>         q[2] = z;
>         cellNum = m_CurrentImageData->ComputeCellId(q);
>         subID = m_CurrentImageData->GetCell( cellNum
> )->GetParametricCenter(paraCoords);
>         int &subIDadd = subID;
>         m_CurrentImageData->GetCell(cellNum)->EvaluateLocation(subIDadd,
> paraCoords,
>         xyzCoords, vtkcellweights);
>         return xyzCoords;
> }
>
> Then I'm trying to set the actor position using xyzCoords, but not working
> ( the point are in wrong position yet ). Any help?
>
> Thks in advance,
>
> Wagner Sales
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.vtk.org/pipermail/vtkusers/attachments/20080516/7674afbb/attachment-0001.htm>

------------------------------

Message: 8
Date: Sat, 17 May 2008 11:25:58 +0800
From: " Mark Jefferson " <mark.jefferson at qq.com>
Subject: [vtkusers] How to save the stenciled images?
To: " vtkusers " <vtkusers at vtk.org>
Message-ID: <tencent_53933BF70D2FC11F5176AE23 at qq.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi, vtkusers,
   I have stenciled one CT image successfully, and I want to extract a ROI 
in another CT image. but how to save the stenciled images? of course, I 
could use vtkBMPWriter or vtkJPEGWriter to save the stenciled images to be 
.bmp or .jpg images, but this is not the best method, I think.
   on the one hand, if I save the stenciled images to be .bmp images, there 
would be many many many images that I need to save, and some message would 
be lost, because the pixel's range in CT image is 0-4095 while in bmp image 
is 0-255. on the other hand, if I want to see the prior image before I 
extract another image, I should read the images, it is very complex.
   so I want to know, is there any class in VTK that could save the images 
temporarily and then save them to be one .vtk file after I have extracted 
all the images?
   if there is no, could you give me any better suggestion? thank you very 
much!
   M.J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.vtk.org/pipermail/vtkusers/attachments/20080517/5f67554d/attachment-0001.htm>

------------------------------

Message: 9
Date: Sat, 17 May 2008 08:01:51 -0500
From: "Kenneth Evans, Jr." <evans at aps.anl.gov>
Subject: Re: [vtkusers] Modifying sphere radius from actor
To: "'VTK Users'" <vtkusers at vtk.org>
Message-ID: <DCF91C86A1ED48A1B9B1E4466E3F6EEE at CICADA>
Content-Type: text/plain; charset="us-ascii"

Andrea,

>> If you are on Windows, you should see something printed in the command
window when you press whatever key you want.

Nothing happened when I pressed any keys.  I noticed later that I got all
the output when the program closes.  I am not experienced with events in VTK
(but wouldn't mind learning).  It turned out this was actually because
stdout wasn't being flushed, not the events.  (I wasn't running it directly
from a console.)  My fault, but I haven't had trouble before with printing
debug statements.

However, in looking at things now that I can print, what I find is that:

vtkPloyDataMapper.GetInput is a vtkPolyData which is a vtkDataObject
which has a GetSouce which returns a vtkSource
but a vtkSphereSource is not a vtkSource

So I would not expect this to work, or at least not be surprised that it
isn't.  (Assuming I did all the tracing right ;-)

In any event, if you print the vtkPolyDataMapper.GetInput() when it is
created, then the source is None at that time.  You can't even use SetSource
because the vtkSphereSource is not a vtkSource.

>> The main problem is not the colour, ...

I understand.  However, I don't then know exactly what you are trying to
accomplish.  It looks as though you are trying to change the sphere.  Why
not keep a reference to the sphere (which you have to do anyway to keep it
from being garbage collected) instead of (or in addition to) the
sphereMapper?  It does look to me as though this approach won't work.

        -Ken



------------------------------

Message: 10
Date: Sat, 17 May 2008 13:28:32 +0000 (GMT)
From: "C. Hiba" <hiba_vtk at yahoo.fr>
Subject: [vtkusers] Link between ITK and VTK
To: vtk <vtkusers at vtk.org>
Message-ID: <380847.26998.qm at web28304.mail.ukl.yahoo.com>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: 
<http://www.vtk.org/pipermail/vtkusers/attachments/20080517/6d7d7e19/attachment-0001.htm>

------------------------------

Message: 11
Date: Sat, 17 May 2008 13:29:00 +0000 (GMT)
From: "C. Hiba" <hiba_vtk at yahoo.fr>
Subject: [vtkusers] Link between ITK and VTK
To: vtk <vtkusers at vtk.org>
Message-ID: <696662.19485.qm at web28308.mail.ukl.yahoo.com>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: 
<http://www.vtk.org/pipermail/vtkusers/attachments/20080517/4a4d1ffe/attachment-0001.htm>

------------------------------

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org
http://www.vtk.org/mailman/listinfo/vtkusers


End of vtkusers Digest, Vol 49, Issue 16
****************************************


-- 
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.16/1446 - Release Date: 16.05.2008 
07:42




More information about the vtkusers mailing list