<div>hi,</div>
<div>It should be </div>
<div>renderer-&gt;AddVolume(vol);</div>
<div>and not&nbsp;</div>
<div>renderer-&gt;AddVolume(newvol);&nbsp;</div>
<div>Sorry about that.</div>
<div>Sharwari&nbsp;<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/18/06, <b class="gmail_sendername">Sharwari Mavalankar</b> &lt;<a href="mailto:sharwari@gmail.com">sharwari@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>hi Ashish,</div>
<div>Try and add this to your code after the line&nbsp; </div>
<div>................</div><span class="q">
<div><font color="#550055">app-&gt;Script(&quot;pack %s -expand y -fill both -anchor c -expand y&quot;,renderwidget-&gt;GetWidgetName()); </font></div></span>
<div>&nbsp;vtkRenderer *renderer = renderwidget-&gt;GetRenderer();<br>&nbsp;renderer-&gt;AddVolume(newvol); </div>
<div>&nbsp;renderer-&gt;SetBackground(1.0,1.0,1.0);</div><span class="q">
<div><font color="#550055">win-&gt;Display();<br>&nbsp;app-&gt;Start();<br></font>&nbsp;return(0);<br>}</div>
<div>&nbsp;</div>
<div>&nbsp;</div></span>
<div>let me know if it works.</div>
<div><span class="e" id="q_10e5df8db7875c1e_5">
<div>Sharwari</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><font color="#550055"></font><br><br><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/18/06, <b class="gmail_sendername">Ashish Singh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mrasingh@gmail.com" target="_blank">mrasingh@gmail.com</a>
&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Sharwari,<br><br>I was able to get rid of that error, it's because of some subsytem settings in linker configuration in visual studio 2005. 
<br>Now I can see the widget, but my volume doesn't show up in it.<br><br>Here's my code: <br>----<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkCamera.h&quot;<br>#include &quot;vtkActor.h&quot;<span> <br>
#include &quot;vtkImageActor.h&quot;<br>#include &quot;vtkOutlineFilter.h&quot;<br></span><span>#include &quot; vtkProperty.h&quot;<br>#include &quot;vtkPolyDataNormals.h&quot;<br>#include &quot;vtkContourFilter.h &quot;<br>
#include &quot;vtkDataSetMapper.h&quot;<br>#include &quot;vtkImageMapper.h&quot;<br></span><span>#include &quot;vtkPiecewiseFunction.h &quot;<br>#include &quot;vtkVolumeProperty.h&quot;<br></span>#include &quot; vtkRenderer.h
&quot;<br>#include &quot;conio.h&quot;<br>#include &quot;vtkDICOMImageReader.h&quot;<br>#include &quot;vtkImageViewer2.h&quot;<br>#include &quot; vtkJPEGReader.h&quot;<br>#include &quot;vtkRenderWindowInteractor.h &quot;<br>
#include &quot;vtkVolumeMapper.h&quot;<br>#include &quot;vtkActor2D.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>#include &quot;vtkVolumeRayCastCompositeFunction.h &quot;<br>#include &quot;vtkFixedPointVolumeRayCastMapper.h
 &quot;<br>#include &quot;vtkColorTransferFunction.h&quot;<br>#include &quot;vtkLookupTable.h&quot;<br>#include &quot;vtkImageData.h&quot;<br>#include &quot;vtkImageMapToColors.h &quot;<br>#include &quot;vtkImageActor.h&quot; 
<br><span><br>#include &quot;vtkKWApplication.h&quot;<br>#include &quot;vtkKWWindowBase.h&quot;<br>#include &quot;vtkKWRenderWidget.h&quot;<br>#include &quot;vtkKWWindow.h&quot;<br>#include &quot;vtkKWFrame.h&quot; <br><br>
int main(int argc, char *argv[])<br>{<br><br>&nbsp;// Initialize Tcl.This is required otherwise the program crashes.<br><br>&nbsp;Tcl_Interp *interp = vtkKWApplication::InitializeTcl(argc, argv, &amp;cerr); <br>&nbsp; if (!interp) <br>&nbsp; {
<br>&nbsp; cerr &lt;&lt; &quot;Error: InitializeTcl failed&quot; &lt;&lt; endl ;<br>&nbsp; return 1;<br>&nbsp; }<br><br></span>//my old volume render code<br>&nbsp;// vtkRenderer *arenderer = vtkRenderer::New();<br>&nbsp;// vtkRenderWindow *renwin = vtkRenderWindow::New(); 
<br>&nbsp; vtkDICOMImageReader *img1=vtkDICOMImageReader::New();<br><br>&nbsp; img1-&gt;SetDirectoryName(&quot;D:\\testimages\\dicomset\\SE1&quot;);<br>&nbsp; img1-&gt;Update();<br><br>&nbsp; vtkPiecewiseFunction *opacityTransferFunction =vtkPiecewiseFunction::New(); 
<br>&nbsp;//opacityTransferFunction-&gt;AddPoint(20.0,0.0);<br>&nbsp;//opacityTransferFunction-&gt;AddPoint(255.0,0.2);<br>&nbsp;&nbsp; opacityTransferFunction-&gt;AddPoint(100.0,0.0);<br>&nbsp;&nbsp; opacityTransferFunction-&gt;AddPoint(200.0,1.0);<br>
&nbsp;&nbsp; opacityTransferFunction-&gt;AddPoint(500.0,1.0);<br>&nbsp;&nbsp; opacityTransferFunction-&gt;AddPoint(510.0,0.0);<br>&nbsp;&nbsp; //opacityTransferFunction-&gt;AddPoint(300,0.4);<br>&nbsp;&nbsp; //opacityTransferFunction-&gt;AddPoint(350,0.4);<br>&nbsp;&nbsp;&nbsp; vtkColorTransferFunction * color = vtkColorTransferFunction::New(); 
<br>&nbsp;&nbsp;&nbsp; color-&gt;AddRGBPoint(100.0, 1.0, 0.16, 0.18);<br>&nbsp;&nbsp;&nbsp; color-&gt;AddRGBPoint(200.0, 1.0, 0.94, 0.85);<br>&nbsp;&nbsp;&nbsp; color-&gt;AddRGBPoint(500.0, 1.0, 0.8, 0.98);<br>&nbsp;&nbsp;&nbsp; color-&gt;AddRGBPoint(510.0, 1.0, 0.63, 0.27);<br>&nbsp;vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New(); 
<br>&nbsp;volumeProperty-&gt;SetScalarOpacity(opacityTransferFunction);<br>&nbsp; //volumeProperty-&gt;SetColor(color);<br>&nbsp; //volumeProperty-&gt;ShadeOn();<br>&nbsp;<br>&nbsp;vtkVolume *vol=vtkVolume::New();<br>&nbsp; vtkFixedPointVolumeRayCastMapper *volumemapper = vtkFixedPointVolumeRayCastMapper::New(); 
<br>&nbsp; //vtkVolumeRayCastCompositeFunction *rcf=vtkVolumeRayCastCompositeFunction::New();<br>&nbsp; //volumemapper-&gt;SetVolumeRayCastFunction(rcf);<br>&nbsp; volumemapper-&gt;SetInput(img1-&gt;GetOutput());<br>&nbsp; vol-&gt;SetProperty(volumeProperty); 
<br>&nbsp; vol-&gt;SetMapper(volumemapper);&nbsp; <br><br>&nbsp; vtkCamera *cam=vtkCamera::New();<br>&nbsp; cam-&gt;SetViewUp(0,0,-1);<br>&nbsp; cam-&gt;SetPosition(0,1,0);<br>&nbsp; cam-&gt;SetFocalPoint(0,0,0);<br>&nbsp; cam-&gt;ComputeViewPlaneNormal(); 
<br>&nbsp; //cam-&gt;ParallelProjectionOn();<br>&nbsp; cam-&gt;Dolly(1.5);<br><br>// my old code till here<span><br><br>&nbsp;//Create a KWWidgets Application<br>&nbsp;vtkKWApplication *app = vtkKWApplication::New();<br>&nbsp;app-&gt;SetRegistryLevel(0); 
<br>&nbsp;app-&gt;PromptBeforeExitOff();<br><br>&nbsp;vtkKWTopLevel *top = vtkKWTopLevel::New();<br>&nbsp;top-&gt;SetApplication(app);<br>&nbsp;top-&gt;Create();<br><br>&nbsp;//Add a window for the application<br>&nbsp;vtkKWWindow *win = vtkKWWindow::New(); 
<br>&nbsp;app-&gt;AddWindow(win);<br>&nbsp;win-&gt;SecondaryPanelVisibilityOff();<br>&nbsp;win-&gt;MainPanelVisibilityOff();<br>&nbsp;win-&gt;Create();<br><br>&nbsp;vtkKWRenderWidget *renderwidget = vtkKWRenderWidget::New();<br>&nbsp;renderwidget-&gt;SetParent(win-&gt;GetViewFrame()); 
<br>&nbsp;renderwidget-&gt;Create();<br></span>&nbsp;renderwidget-&gt;AddViewProp(vol);<span><br>&nbsp;renderwidget-&gt;CornerAnnotationVisibilityOn();<br>&nbsp;app-&gt;Script(&quot;pack %s -expand y -fill both -anchor c -expand y&quot;,renderwidget-&gt;GetWidgetName()); 
<br><br>&nbsp;win-&gt;Display();<br>&nbsp;app-&gt;Start();<br></span>&nbsp;return(0);<br><br>}<br>-------<br>Most of it is the same as yours, except for my dicom volume generation part. Can you figure out what is wrong here?<br><br>Thanks, 
<br><span>Ashish</span> 
<div><span><br><br><br>
<div><span class="gmail_quote">On 10/18/06, <b class="gmail_sendername">Sharwari Mavalankar</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sharwari@gmail.com" target="_blank">sharwari@gmail.com 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>hi Ashish,</div>
<div>I dont think it's because of the cmakelist.txt file.</div>
<div>I dont know what is causing this error.</div>
<div>How does your code look?</div><span>
<div>Sharwari<br><br>&nbsp;</div></span>
<div><span>
<div><span class="gmail_quote">On 10/18/06, <b class="gmail_sendername">Ashish Singh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mrasingh@gmail.com" target="_blank">mrasingh@gmail.com</a>
 &gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi Sharwari,<br><br>The errors I am getting are:<br><pre>Linking...<br>   Creating library Debug\mygui.lib and object Debug\mygui.exp
<br><br>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup<br><br>Debug\mygui.exe : fatal error LNK1120: 1 unresolved externals<br></pre>Is it because of the 
cmakelist.txt file? <br><br>Thanks,<br><span>Ashish<br><br></span>
<div><span>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Sharwari Mavalankar</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sharwari@gmail.com" target="_blank">sharwari@gmail.com 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>hi Ashish,</div>
<div>What exactly was the error?</div>
<div><span>
<div>Sharwari<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Ashish Singh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mrasingh@gmail.com" target="_blank">mrasingh@gmail.com</a>
 &gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi Sharwari,<br><br>I have these variables set to ON. I have already build vtk and kwwidgets with TCL,TK options set to ON and tested it with examples. They run fine. 
<br><br>I think I didnt put the question correctly. What I was asking was how does the cmakelist.txt file look like for the code you posted here. I am making a GUI for my dicom volume rendering based on the code you posted and when I build this GUI code that gives me linker error. So I was thinking that maybe I am doing something wrong there. Can you please tell me how the 
cmaklist.txt file look like for kwwidget GUI code?<br><br><br>Thanks,<br><span>Ashish</span> 
<div><span><br><br>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Sharwari Mavalankar</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sharwari@gmail.com" target="_blank"> sharwari@gmail.com 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>hi Ashish,</div>
<div>The cmake file (for vtk) should have the following two variables set to ON.</div>
<div>VTK_USE_TK&nbsp; and </div>
<div>VTK_WRAP_TCL</div>
<div>So try and build vtk again using these two cmake variables to ON and then build KWWidgets again.</div>
<div>Let me know if it helps.</div>
<div>Thanks </div><span>
<div>Sharwari</div>
<div><br><br>&nbsp;</div></span>
<div><span>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Ashish Singh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mrasingh@gmail.com" target="_blank">mrasingh@gmail.com</a>
 &gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi Sharwari, I am getting a linker error for my dicom volume GUI code (using KWWidgets) which is exactly similar to ur code above. I am not sure if my cmakelist file is right. Can you plz. tell me what goes in the cmakelist file? 
<br><br>Thanks,<br><span>Ashish</span> 
<div><span><br><br>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Ashish Singh</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mrasingh@gmail.com" target="_blank">mrasingh@gmail.com</a>
 &gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi Sharwari, <br>How does the cmake file for your code look like? What all things need to go in the cmake file? is there an example you are following? 
<br>So soes your volume finally show up ?<br>I got Qt working with VTK but am stuck again with transfering data between Qt and vtk. <br><br>Thanks,<br><span>Ashish</span> 
<div><span><br><br><br>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Amy Squillacote</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:amy.squillacote@kitware.com" target="_blank"> amy.squillacote@kitware.com 
</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div bgcolor="#ffffff" text="#000000">Hi Sharwari,<br><br>I'm copying this back to the vtkusers list so other people can see the resolution of your problem.<br><br>- Amy<br><br>Sharwari Mavalankar wrote: 
<blockquote cite="http://mid2462f9f80610170846t83fdfb8xbb2a9e20a226e21d@mail.gmail.com" type="cite">
<div>hi Amy,</div>
<div>Thanks for your email.</div>
<div>yes I have turned both the CMAKE variables to bool value =ON.</div>
<div>But I realized that there were some .dll and .lib files that had to be updated.</div>
<div>I did that and now that error is gone.</div>
<div>but thanks anyways!</div>
<div>Sharwari 
<div><span><br><br><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Amy Squillacote</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:amy.squillacote@kitware.com" target="_blank">
 amy.squillacote@kitware.com</a>&gt; wrote:</span></span></div></div>
<div><span>
<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div bgcolor="#ffffff" text="#000000">Hi Sharwari,<br><br>In the VTK that you're using with KWWidgets, did you turn on both of the following CMake variables: VTK_USE_RENDERING and VTK_WRAP_TCL? Both of them are required in order for vtkTkRenderWidget to be built. 
<br><br>- Amy<br><br>Sharwari Mavalankar wrote: 
<blockquote cite="http://mid2462f9f80610161638n44f0c3d6t98d8207f9bbf1d5e@mail.gmail.com" type="cite">
<div><span>
<div>hi all,</div>
<div>I am working on creating a UI using KWWidgets.</div>
<div>I want to display a 3D volume in this UI from 2D BMP slices.</div>
<div>The volume rendering is working fine without the UI.But I seem to have some problem with the UI.</div>
<div>It displays the UI window, but I cannot see the 3D volume inside it.</div>
<div>Addionally on running the program I get the following error on the vtkoutput window.</div>
<div>
<p>ERROR: In C:\Program Files\KWWidgets\KWWidgets-HEAD-cvs\vtkKWTkUtilities.cxx, line 221<br>vtkKWApplication (0x03414370): <br>&nbsp;&nbsp;&nbsp; Script: <br>vtkTkRenderWidget .1.10.18.21.22.25.100.102.104.107.108 -rw Addr=03428710<br>
&nbsp;&nbsp;&nbsp; Returned Error on line 1: <br>invalid command name &quot;vtkTkRenderWidget&quot;<br>Stack trace: <br>invalid command name &quot;vtkTkRenderWidget&quot;<br>&nbsp;&nbsp;&nbsp; while executing<br>&quot;vtkTkRenderWidget .1.10.18.21.22.25.100.102.104.107.108 -rw Addr=03428710&quot; 
</p>
<p><br>ERROR: In C:\Program Files\KWWidgets\KWWidgets-HEAD-cvs\vtkKWWidget.cxx, line 301<br>vtkKWCoreWidget (0x03428990): Error creating the widget .1.10.18.21.22.25.100.102.104.107.108 of type vtkTkRenderWidget: invalid command name &quot;vtkTkRenderWidget&quot; 
</p>
<p>ERROR: In C:\Program Files\KWWidgets\KWWidgets-HEAD-cvs\vtkKWTkUtilities.cxx, line 221<br>vtkKWApplication (0x03414370): <br>&nbsp;&nbsp;&nbsp; Script: <br>grid .1.10.18.21.22.25.100.102.104.107.108 -row 0 -column 0 -sticky nsew<br>
&nbsp;&nbsp;&nbsp; Returned Error on line 1: <br>bad window path name &quot;.1.10.18.21.22.25.100.102.104.107.108&quot;<br>Stack trace: <br>bad window path name &quot;.1.10.18.21.22.25.100.102.104.107.108&quot;<br>&nbsp;&nbsp;&nbsp; while executing<br>
&quot;grid .1.10.18.21.22.25.100.102.104.107.108 -row 0 -column 0 -sticky nsew&quot;</p>
<p><br>ERROR: In C:\Program Files\KWWidgets\KWWidgets-HEAD-cvs\vtkKWApplication.cxx, line 999<br>vtkKWApplication (0x03414370): TclTk error: Object named: vtkTemp44, could not find requested method: ConfigureCallback<br>
or the method was called with incorrect arguments.</p>
<p>Object named: vtkTemp44, could not find requested method: ConfigureCallback<br>or the method was called with incorrect arguments.</p>
<p>&nbsp;&nbsp;&nbsp; while executing<br>&quot;vtkTemp44 ConfigureCallback 900 668&quot;<br>&nbsp;&nbsp;&nbsp; (command bound to event)</p>
<p>&nbsp;Here is my code</p>
<p>//The following code includes the vtk code and the KWWidgets code for the user interface.<br>#include &quot;vtkRenderer.h&quot;<br>#include &quot;vtkRenderWindow.h&quot;<br>#include &quot;vtkRenderWindowInteractor.h&quot; 
<br>#include &quot;vtkBMPReader.h&quot;<br>#include &quot;vtkPolyDataMapper.h&quot;<br>#include &quot;vtkActor.h&quot;<br>#include &quot;vtkActor2D.h&quot;<br>#include &quot;vtkImageActor.h&quot;<br>#include &quot;vtkOutlineFilter.h
 &quot;<br>#include &quot;vtkCamera.h&quot;<br>#include &quot;vtkProperty.h&quot;<br>#include &quot;vtkPolyDataNormals.h&quot;<br>#include &quot;vtkContourFilter.h&quot;<br>#include &quot;vtkDataSetMapper.h&quot;<br>#include &quot; 
vtkImageMapper.h&quot;<br>#include &quot;vtkVolumeMapper.h&quot;<br>#include &quot;vtkVolumeRayCastMapper.h&quot;<br>#include &quot;vtkVolumeRayCastCompositeFunction.h&quot;<br>#include &quot;vtkPiecewiseFunction.h&quot; 
<br>#include &quot;vtkVolumeProperty.h&quot;<br>#include &quot;vtkColorTransferFunction.h&quot;<br>#include &quot;vtkLight.h&quot;<br>#include &quot;vtkFixedPointVolumeRayCastMapper.h&quot;<br>#include &quot;vtkKWApplication.h
 &quot;<br>#include &quot;vtkKWWindowBase.h&quot;<br>#include &quot;vtkKWRenderWidget.h&quot;<br>#include &quot;vtkKWWindow.h&quot;<br>#include &quot;vtkKWFrame.h&quot;</p>
<p>int main(int argc, char *argv[])<br>{<br>&nbsp;<br>&nbsp;// Initialize Tcl.This is required otherwise the program crashes.<br>&nbsp;<br>&nbsp;Tcl_Interp *interp = vtkKWApplication::InitializeTcl(argc, argv, &amp;cerr);<br>&nbsp; if (!interp)<br>
&nbsp; {<br>&nbsp; cerr &lt;&lt; &quot;Error: InitializeTcl failed&quot; &lt;&lt; endl ;<br>&nbsp; return 1;<br>&nbsp; }</p>
<p><br>//using bmp to read gray image<br>&nbsp;vtkBMPReader *reader = vtkBMPReader::New();<br>&nbsp;reader-&gt;SetFilePattern(&quot;%s%d.bmp&quot;);<br>&nbsp;<br>&nbsp;&nbsp;reader-&gt;SetFilePrefix(&quot;C:\\Images\\PositionCReal\\Depth5mm\\slice&quot;); 
<br>&nbsp;<br>&nbsp;<br>&nbsp;reader-&gt;SetDataExtent(0, 310, 0, 310, 1, 8);<br>&nbsp;reader-&gt;SetDataSpacing(1.0,1.0,20.0);<br>&nbsp;reader-&gt;SetDataOrigin(0.0, 0.0, 0.0);<br>&nbsp;reader-&gt;Update();<br>&nbsp;<br>&nbsp; <br>&nbsp;//vtkImageData *finalImg = reader-&gt;GetOutput(); 
<br>&nbsp;<br>&nbsp; <br>&nbsp;vtkPiecewiseFunction *tfun = vtkPiecewiseFunction::New();</p>
<p>//The following lines of code displays the copper target for position A and C<br>&nbsp;tfun-&gt;AddPoint(128,0.009);<br>&nbsp;tfun-&gt;AddPoint(180,1.0);<br>&nbsp;tfun-&gt;AddPoint(200,1.0);<br>&nbsp;tfun-&gt;AddPoint(255,0.0009);</p>
<p>&nbsp;&nbsp;vtkFixedPointVolumeRayCastMapper *volumeMapper = vtkFixedPointVolumeRayCastMapper::New();<br>&nbsp;<br>&nbsp;//volumeMapper-&gt;SetSampleDistance(1.0);</p>
<p>&nbsp;//volumeMapper-&gt;SetInput(finalImg);<br>&nbsp;volumeMapper-&gt;SetInput(reader-&gt;GetOutput());</p>
<p>&nbsp;vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</p>
<p>&nbsp; //show gray volume<br>&nbsp;volumeProperty-&gt;IndependentComponentsOff();<br>&nbsp;volumeProperty-&gt;SetScalarOpacity(tfun);<br>&nbsp;&nbsp;<br><br>&nbsp;<br>&nbsp;vtkVolume *newvol = vtkVolume::New();<br>&nbsp;newvol-&gt;SetMapper(volumeMapper);<br>
&nbsp;newvol-&gt;SetProperty(volumeProperty);</p>
<p>&nbsp;vtkOutlineFilter *outline = vtkOutlineFilter::New();<br>&nbsp;outline-&gt;SetInput((vtkDataSet *) reader-&gt;GetOutput());</p>
<p>&nbsp;vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();<br>&nbsp;outlineMapper-&gt;SetInput(outline-&gt;GetOutput());</p>
<p>&nbsp;vtkActor *outlineActor = vtkActor::New();<br>&nbsp;outlineActor-&gt;SetMapper(outlineMapper);<br>&nbsp;outlineActor-&gt;GetProperty()-&gt;SetColor(1,1,1);</p>
<p>&nbsp;</p>
<p>&nbsp;//Create a KWWidgets Application<br>&nbsp;vtkKWApplication *app = vtkKWApplication::New();<br>&nbsp;app-&gt;SetRegistryLevel(0);<br>&nbsp;app-&gt;PromptBeforeExitOff();</p>
<p>&nbsp;&nbsp;&nbsp;<br>&nbsp;vtkKWTopLevel *top = vtkKWTopLevel::New();<br>&nbsp;top-&gt;SetApplication(app);<br>&nbsp;top-&gt;Create(); <br>&nbsp;</p>
<p>&nbsp;//Add a window for the application<br>&nbsp;vtkKWWindow *win = vtkKWWindow::New();<br>&nbsp;app-&gt;AddWindow(win);<br>&nbsp;win-&gt;SecondaryPanelVisibilityOff();<br>&nbsp;win-&gt;MainPanelVisibilityOff();<br>&nbsp;win-&gt;Create();</p>
<p><br>&nbsp;vtkKWRenderWidget *renderwidget = vtkKWRenderWidget::New();<br>&nbsp;renderwidget-&gt;SetParent(win-&gt;GetViewFrame());<br>&nbsp;renderwidget-&gt;Create();<br>&nbsp;renderwidget-&gt;AddViewProp(newvol);<br>&nbsp;renderwidget-&gt;CornerAnnotationVisibilityOn(); 
<br>&nbsp;app-&gt;Script(&quot;pack %s -expand y -fill both -anchor c -expand y&quot;,renderwidget-&gt;GetWidgetName());<br>&nbsp;<br>&nbsp;win-&gt;Display();<br>&nbsp;app-&gt;Start();</p>
<p>&nbsp;<br>&nbsp;<br>&nbsp;win-&gt;Display();<br>&nbsp;app-&gt;Start();</p>
<p><br>&nbsp;return(0);</p>
<p>}<br></p>
<p>Can someone please help me out.</p>
<p>Thanks&nbsp;</p>
<p>Sharwari&nbsp;</p>
<p>&nbsp;</p>
<p><br>&nbsp;</p></div></span></div><pre><hr width="90%" size="4">
_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">









http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a>
  </pre></blockquote></div></blockquote></div><br></span></div></blockquote></div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: 
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">
http://www.vtk.org/mailman/listinfo/vtkusers </a><br><br><br></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div>
<br></span></div></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div><br></span></div></blockquote></div><br>