[vtkusers] Save as vtkImageData ?

reyes mauricio mreyesa at hotmail.com
Fri Jan 30 12:58:19 EST 2004


Hi Yi-Yu Chou,

  If you want to access the data values by voxel, what I use is
	(void*)vtkImageData->GetScalarPointer(i,j,k)

casting the pointer to the specific scalar data type you are using allows 
you to read and write values.
If yours voxel values have more than one component (let's say by example, 
RGB values) you just can increment the pointer to have access to the 
different component values.

Cheers,
  Mauricio

Message: 2
     From: "Yi-Yu Chou" <chouyiyu at hotmail.com>
     To: vtkusers at vtk.org
     Date: Fri, 30 Jan 2004 06:08:12 +0000
     Subject: [vtkusers] Save as vtkImageData ?

     Hi !!

     I am trying to take out the voxel intensities from a 3D image
     (vtkImageData) to do some processes, and save
     it as the other vtkImageData ? How should I do in C++?

     vtkImageData* B;
     B = A.DeepCopy();
     Then replace the voxel data  in B ?
     Is it available ?

     Thanks in advance !!!




>From: vtkusers-request at vtk.org
>Reply-To: vtkusers at vtk.org
>To: vtkusers at vtk.org
>Subject: vtkusers digest, Vol 1 #2339 - 4 msgs
>Date: Fri, 30 Jan 2004 06:25:47 -0500
>
>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-admin 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. vtkqt pipeline update (Hari Sundar)
>    2. Save as vtkImageData ? (Yi-Yu Chou)
>    3. Trouble writing filtered image to an image file? 
>(=?iso-8859-1?q?Sentil=20Balaji?=)
>    4. How to create custom event handler (Ang Kim Hua)
>
>--__--__--
>
>Message: 1
>Date: Thu, 29 Jan 2004 21:34:24 -0500 (EST)
>From: Hari Sundar <hsundar at caip.rutgers.edu>
>To: vtkusers at vtk.org
>Subject: [vtkusers] vtkqt pipeline update
>
>Hi,
>
>I am trying to build a simple application using vtk and qt and am using
>the vtkqt widget.
>
>Everything works reasonable. I however am not able to update the pipeline
>if I make any modifications, i.e., if I add/remove actors or change
>properties.
>
>Anyone have any idea on how that is to be done using vtkqt ?
>
>thanks,
>-Hari
>
>--__--__--
>
>Message: 2
>From: "Yi-Yu Chou" <chouyiyu at hotmail.com>
>To: vtkusers at vtk.org
>Date: Fri, 30 Jan 2004 06:08:12 +0000
>Subject: [vtkusers] Save as vtkImageData ?
>
>Hi !!
>
>I am trying to take out the voxel intensities from a 3D image
>(vtkImageData) to do some processes, and save
>it as the other vtkImageData ? How should I do in C++?
>
>vtkImageData* B;
>B = A.DeepCopy();
>Then replace the voxel data  in B ?
>Is it available ?
>
>Thanks in advance !!!
>
>_________________________________________________________________
>¤U¸ü³Ì·sª©¥»ªº MSN Messenger¡G©MªB¤Í¦b½u¤W²á¤Ñ¡A¥Î¦³½ìªºªí±¡²Å¸¹¶Ç¹F¤ß·N!
>http://messenger.msn.com.tw/
>
>
>--__--__--
>
>Message: 3
>Date: Fri, 30 Jan 2004 06:33:25 +0000 (GMT)
>From: =?iso-8859-1?q?Sentil=20Balaji?= <profbalse at yahoo.co.in>
>To: vtkusers at vtk.org
>Subject: [vtkusers] Trouble writing filtered image to an image file?
>
>Hey,
>
>    I am trying to filter an input image and write in
>an output file[.bmp].The following is the code
>segement I used:
>------------------------------------
>  pw1->SetInput(idrf);
>  pw1->SetFileName("C:/VTKOUT.bmp");
>  pw1->Write();
>------------------------------------
>'idrf' is of 'vtkImageData' type.It is the output of
>vtkRFFT after filtering in the frequency domain.
>
>On execution, I get the following error.I am able to
>display the image in the render window.
>The problem is in writing to a file.
>
>--------------------------------------
>ERROR: In D:\VTK\IO\vtkBMPWriter.cxx, line 113
>vtkBMPWriter (0x01828C08): PNMWriter only accepts
>unsigned char scalars!
>---------------------------------------
>I tried "idrf->SetScalarType(VTK_UNSIGNED_CHAR)" to
>define the type.Yet, I have the same error.Please help
>me.Many Thanks.Ciao
>
>
>Cheers
>
>BeeJay
>
>
>________________________________________________________________________
>Yahoo! India Mobile: Download the latest polyphonic ringtones.
>Go to http://in.mobile.yahoo.com
>
>--__--__--
>
>Message: 4
>From: "Ang Kim Hua" <angkimhua at hotmail.com>
>To: vtkusers at vtk.org
>Date: Fri, 30 Jan 2004 17:26:51 +0800
>Subject: [vtkusers] How to create custom event handler
>
>hi all.
>vtkRenderWindowInteractor have predefined interaction behaviour, but is not
>suit for my project. can anyone tell me how to create my own event handler.
>i knew something related to vtkInteractorStyle but don't know how to 
>operate
>with it.
>
>_________________________________________________________________
>Using a handphone prepaid card? Reload your credit online!
>http://www.msn.com.my/reloadredir/default.asp
>
>
>
>--__--__--
>
>_______________________________________________
>vtkusers mailing list
>vtkusers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>End of vtkusers Digest

_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/




More information about the vtkusers mailing list