[vtkusers] New feature: vtkImageDataToTkPhoto

Blezek, Daniel J (Research) blezek at crd.ge.com
Fri Aug 30 16:13:52 EDT 2002


Ooops, forgot the example code.

-dan


--
Daniel Blezek, Ph.D.
blezek at crd.ge.com
Visualization and Computer Vision Lab, Imaging Technologies
GE Global Research Center


> -----Original Message-----
> From: Blezek, Daniel J (Research) 
> Sent: Friday, August 30, 2002 4:11 PM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] New feature: vtkImageDataToTkPhoto
> 
> 
> Hi all,
> 
>   I won't go into the rational behind this feature, rather 
> I'll just expalain.
> 
>   I've added new Tcl and Python(Tk) commands into VTK.  The 
> command is called vtkImageDataToTkPhoto.
> 
> Usage: vtkImageDataToTkPhoto image photo z
> image - in Tcl image is a vtkImageData, in Python it is the 
> address string image.__this__[:-2]
> photo - the name of the photo widget returned from [image 
> create photo] or Tkinter.PhotoImage()
> z - the z slice to take from the image data
> 
> The command only handles 1,3, & 4 component unsigned char 
> vtkImageData types.
> 
> For python, I added a class called vtkTkPhotoImage as a 
> wrapper class around this command.  Since the
> Python code took a bit more "hack"ing, you can use 
> vktTkPhotoImage wherever you need a
> Tkinter.PhotoImage.  vtkTkPhotoImage has a new method 
> PutImageData that takes a vtkImageData and a z
> slice, effectively hiding the call to vtkImageDataToTkPhoto.
> 
> Please let me know if you have questions or comments,
> -dan
> 
> --
> Daniel Blezek, Ph.D.
> blezek at crd.ge.com
> Visualization and Computer Vision Lab, Imaging Technologies
> GE Global Research Center
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: 
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


begin 600 Foo.tcl
M<&%C:V%G92!R97%U:7)E('9T:PH*"G=M('=I=&AD<F%W("X*(R!);6%G92!P
M:7!E;&EN90H*=G1K1T53:6=N85)E861E<B!R96%D97(*<F5A9&5R(%-E=$9I
M;&5.86UE("165$M?1$%405]23T]4+T1A=&$O13`W-S,S4S`P,DDP,#DN35(*
M"G9T:TEM86=E1W)A9&EE;G1-86=N:71U9&4 at 9W)A9&EE;G0*9W)A9&EE;G0@
M4V5T1&EM96YS:6]N86QI='D@, at IG<F%D:65N="!3971);G!U="!;<F5A9&5R
M($=E=$]U='!U=%T*"@IV=&M);6%G95-H:69T4V-A;&4 at 8V%S=`IC87-T(%-E
M=$EN<'5T(%MR96%D97(@1V5T3W5T<'5T70IC87-T(%-E=$]U='!U=%-C86QA
M<E1Y<&54;U5N<VEG;F5D0VAA<@IC87-T($-L86UP3W9E<F9L;W=/;@IC87-T
M(%5P9&%T90IS970@<&AO=&\@6VEM86=E(&-R96%T92!P:&]T;UT*=G1K26UA
M9V5$871A5&]4:U!H;W1O(%MC87-T($=E=$]U='!U=%T@)'!H;W1O(#`*"G-E
M="!R86YG92!;6W)E861E<B!'971/=71P=71=($=E=%-C86QA<E)A;F=E70IS
M970@;"!;;&EN9&5X("1R86YG92`P70IS970@:"!;;&EN9&5X("1R86YG92`Q
M70IS970 at 97AT96YT<R!;6V-A<W0 at 1V5T3W5T<'5T72!'971%>'1E;G1="@IT
M;W!L979E;"`N8PIW;2!T:71L92`N8R`B5&-L(%9E<G-I;VX@;V8@=G1K26UA
M9V5$871A5&]4:U!H;W1O(@IP86-K(%MB=71T;VX at +F,N8B`M:6UA9V4@)'!H
M;W1O70IP86-K(%MS8V%L92`N8RYW("UL86)E;"!7:6YD;W<@+6]R:65N="!H
M;W)I>F]N=&%L("UF<F]M(#$@+71O(%ME>'!R("@D:"`M("1L*2`O(#)=("UC
M;VUM86YD(%-E=%=I;F1O=R!=("UF:6QL('@@+65X<&%N9"`Q"G!A8VL at 6W-C
M86QE("YC+FP at +6QA8F5L($QE=F5L("UO<FEE;G0@:&]R:7IO;G1A;"`M9G)O
M;2`D;"`M=&\@)&@@+6-O;6UA;F0 at 4V5T5VEN9&]W(%T at +69I;&P@>"`M97AP
M86YD(#$*"G!A8VL at 6W-C86QE("YC+GH at +6QA8F5L(%H at +6]R:65N="!H;W)I
M>F]N=&%L("UF<F]M(%ML:6YD97@@)&5X=&5N=', at -%T at +71O(%ML:6YD97@@
M)&5X=&5N=', at -5T@+6-O;6UA;F0 at 4V5T5VEN9&]W(%T at +69I;&P@>"`M97AP
M86YD(#$*"BYC+G<@<V5T(#4P,`HN8RYL('-E="`Q-3,*"B, at 4V-A;&4@/2`R
M-34 at +R!W:6YD;W<*(R!3:&EF="`](%=I;F1O=R`O(#(@+2!L979E;`IP<F]C
M(%-E=%=I;F1O=R![(&9O;R!]('L*("!G;&]B86P at 8V%S="!P:&]T;PH@('-E
M="!7:6YD;W<@6RYC+G<@9V5T70H@('-E="!,979E;"!;+F,N;"!G971="B`@
M8V%S="!397138V%L92!;97AP<B`R-34N,"`O("17:6YD;W=="B`@8V%S="!3
M9713:&EF="!;97AP<B`D5VEN9&]W("\@,BXP("T@)$QE=F5L70H@('9T:TEM
M86=E1&%T851O5&M0:&]T;R!;8V%S="!'971/=71P=71=("1P:&]T;R!;+F,N
)>B!G971="GT*
`
end



More information about the vtkusers mailing list