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>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
<br>Debug\mygui.exe : fatal error LNK1120: 1 unresolved externals<br></pre>Is it because of the cmakelist.txt file? <br><br>Thanks,<br>Ashish<br><br><div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">
Sharwari Mavalankar</b> <<a href="mailto:sharwari@gmail.com">sharwari@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>hi Ashish,</div>
<div>What exactly was the error?</div><div><span class="e" id="q_10e591f0611b443d_1">
<div>Sharwari<br><br> </div>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Ashish Singh</b> <<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com</a>
> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">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> <<a href="mailto:sharwari@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> sharwari@gmail.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>hi Ashish,</div>
<div>The cmake file (for vtk) should have the following two variables set to ON.</div>
<div>VTK_USE_TK 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> </div></span>
<div><span>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Ashish Singh</b> <<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com</a>
> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">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> <<a href="mailto:mrasingh@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mrasingh@gmail.com</a>
> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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> <<a href="mailto:amy.squillacote@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> amy.squillacote@kitware.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<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> <<a href="mailto:amy.squillacote@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
amy.squillacote@kitware.com</a>> wrote:</span></span></div></div>
<div><span>
<div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<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> Script: <br>vtkTkRenderWidget .1.10.18.21.22.25.100.102.104.107.108 -rw Addr=03428710<br>
Returned Error on line 1: <br>invalid command name "vtkTkRenderWidget"<br>Stack trace: <br>invalid command name "vtkTkRenderWidget"<br> while executing<br>"vtkTkRenderWidget .1.10.18.21.22.25.100.102.104.107.108 -rw Addr=03428710"
</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 "vtkTkRenderWidget"
</p>
<p>ERROR: In C:\Program Files\KWWidgets\KWWidgets-HEAD-cvs\vtkKWTkUtilities.cxx, line 221<br>vtkKWApplication (0x03414370): <br> Script: <br>grid .1.10.18.21.22.25.100.102.104.107.108 -row 0 -column 0 -sticky nsew<br>
Returned Error on line 1: <br>bad window path name ".1.10.18.21.22.25.100.102.104.107.108"<br>Stack trace: <br>bad window path name ".1.10.18.21.22.25.100.102.104.107.108"<br> while executing<br>
"grid .1.10.18.21.22.25.100.102.104.107.108 -row 0 -column 0 -sticky nsew"</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> while executing<br>"vtkTemp44 ConfigureCallback 900 668"<br> (command bound to event)</p>
<p> Here is my code</p>
<p>//The following code includes the vtk code and the KWWidgets code for the user interface.<br>#include "vtkRenderer.h"<br>#include "vtkRenderWindow.h"<br>#include "vtkRenderWindowInteractor.h"
<br>#include "vtkBMPReader.h"<br>#include "vtkPolyDataMapper.h"<br>#include "vtkActor.h"<br>#include "vtkActor2D.h"<br>#include "vtkImageActor.h"<br>#include "vtkOutlineFilter.h
"<br>#include "vtkCamera.h"<br>#include "vtkProperty.h"<br>#include "vtkPolyDataNormals.h"<br>#include "vtkContourFilter.h"<br>#include "vtkDataSetMapper.h"<br>#include "
vtkImageMapper.h"<br>#include "vtkVolumeMapper.h"<br>#include "vtkVolumeRayCastMapper.h"<br>#include "vtkVolumeRayCastCompositeFunction.h"<br>#include "vtkPiecewiseFunction.h"
<br>#include "vtkVolumeProperty.h"<br>#include "vtkColorTransferFunction.h"<br>#include "vtkLight.h"<br>#include "vtkFixedPointVolumeRayCastMapper.h"<br>#include "vtkKWApplication.h
"<br>#include "vtkKWWindowBase.h"<br>#include "vtkKWRenderWidget.h"<br>#include "vtkKWWindow.h"<br>#include "vtkKWFrame.h"</p>
<p>int main(int argc, char *argv[])<br>{<br> <br> // Initialize Tcl.This is required otherwise the program crashes.<br> <br> Tcl_Interp *interp = vtkKWApplication::InitializeTcl(argc, argv, &cerr);<br> if (!interp)<br>
{<br> cerr << "Error: InitializeTcl failed" << endl ;<br> return 1;<br> }</p>
<p><br>//using bmp to read gray image<br> vtkBMPReader *reader = vtkBMPReader::New();<br> reader->SetFilePattern("%s%d.bmp");<br> <br> reader->SetFilePrefix("C:\\Images\\PositionCReal\\Depth5mm\\slice");
<br> <br> <br> reader->SetDataExtent(0, 310, 0, 310, 1, 8);<br> reader->SetDataSpacing(1.0,1.0,20.0);<br> reader->SetDataOrigin(0.0, 0.0, 0.0);<br> reader->Update();<br> <br> <br> //vtkImageData *finalImg = reader->GetOutput();
<br> <br> <br> vtkPiecewiseFunction *tfun = vtkPiecewiseFunction::New();</p>
<p>//The following lines of code displays the copper target for position A and C<br> tfun->AddPoint(128,0.009);<br> tfun->AddPoint(180,1.0);<br> tfun->AddPoint(200,1.0);<br> tfun->AddPoint(255,0.0009);</p>
<p> vtkFixedPointVolumeRayCastMapper *volumeMapper = vtkFixedPointVolumeRayCastMapper::New();<br> <br> //volumeMapper->SetSampleDistance(1.0);</p>
<p> //volumeMapper->SetInput(finalImg);<br> volumeMapper->SetInput(reader->GetOutput());</p>
<p> vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</p>
<p> //show gray volume<br> volumeProperty->IndependentComponentsOff();<br> volumeProperty->SetScalarOpacity(tfun);<br> <br><br> <br> vtkVolume *newvol = vtkVolume::New();<br> newvol->SetMapper(volumeMapper);<br>
newvol->SetProperty(volumeProperty);</p>
<p> vtkOutlineFilter *outline = vtkOutlineFilter::New();<br> outline->SetInput((vtkDataSet *) reader->GetOutput());</p>
<p> vtkPolyDataMapper *outlineMapper = vtkPolyDataMapper::New();<br> outlineMapper->SetInput(outline->GetOutput());</p>
<p> vtkActor *outlineActor = vtkActor::New();<br> outlineActor->SetMapper(outlineMapper);<br> outlineActor->GetProperty()->SetColor(1,1,1);</p>
<p> </p>
<p> //Create a KWWidgets Application<br> vtkKWApplication *app = vtkKWApplication::New();<br> app->SetRegistryLevel(0);<br> app->PromptBeforeExitOff();</p>
<p> <br> vtkKWTopLevel *top = vtkKWTopLevel::New();<br> top->SetApplication(app);<br> top->Create(); <br> </p>
<p> //Add a window for the application<br> vtkKWWindow *win = vtkKWWindow::New();<br> app->AddWindow(win);<br> win->SecondaryPanelVisibilityOff();<br> win->MainPanelVisibilityOff();<br> win->Create();</p>
<p><br> vtkKWRenderWidget *renderwidget = vtkKWRenderWidget::New();<br> renderwidget->SetParent(win->GetViewFrame());<br> renderwidget->Create();<br> renderwidget->AddViewProp(newvol);<br> renderwidget->CornerAnnotationVisibilityOn();
<br> app->Script("pack %s -expand y -fill both -anchor c -expand y",renderwidget->GetWidgetName());<br> <br> win->Display();<br> app->Start();</p>
<p> <br> <br> win->Display();<br> app->Start();</p>
<p><br> return(0);</p>
<p>}<br></p>
<p>Can someone please help me out.</p>
<p>Thanks </p>
<p>Sharwari </p>
<p> </p>
<p><br> </p></div></span></div><pre><hr size="4" width="90%">
_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/Wiki/VTK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">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 href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
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>