[slicer-users] vmtkcenterlines input model loading problem

Daniel Haehn haehn at bwh.harvard.edu
Sun Feb 21 15:26:31 EST 2010


Hi Mohan,

please excuse the late reply..

After this line,
model=slicer.MRMLScene.GetNodeByID('vtkMRMLModelNode1');

please just type
model

to see how this object looks like and paste the results.

Bye,
Daniel


On Wed, 2010-02-17 at 12:50 +0530, Madan Rao wrote:
> Hello Daniel,
> 
> Thanks.
> I request the next step.
> Please find the error log in python console:
> 
> Python Console v1.4 by Ka-Ping Yee <ping at lfw.org>
> >>> import sys; from Slicer import slicer;
> >>>
> sys.path.append(str(slicer.Application.GetExtensionsInstallPath())+'/'+str(slicer.Application.GetSvnRevision())+'/VMTKCenterlines/VMTKCenterlines');
> >>> from VMTKCenterlinesGUI import *;
> >>> hidden2gui = VMTKCenterlinesGUI();
> >>> from VMTKCenterlinesLogic import *;
> >>> centerlines = VMTKCenterlinesLogic(hidden2gui);
> >>> model=slicer.MRMLScene.GetNodeByID('vtkMRMLModelNode1');
> >>> clSeeds = slicer.vtkIdList();
> >>> clTargets = slicer.vtkIdList();
> >>> pointLocator=slicer.vtkPointLocator();
> >>> pointLocator.SetDataSet(model);
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "<string>", line 1, in SetDataSet
>   File "C:\Program Files\Slicer3 3.5.2010-01-07\lib\Slicer3
> \SlicerBaseGUI\Python\Slicer.py", line 116, in <lambda>
>     return lambda *a: self.__callVTKmethod(str(name),*a)
>   File "C:\Program Files\Slicer3 3.5.2010-01-07\lib\Slicer3
> \SlicerBaseGUI\Python\Slicer.py", line 102, in __callVTKmethod
>     value = tk.tk.call(*cstring)
> TclError: Object named: vtkObj7853, could not find requested method:
> SetDataSet
> or the method was called with incorrect arguments.
> 
> >>> 
> 
> 
> Since your path is taking from exltension install path, I added the
> VMTK files in there. However, if I do not have these files
> in slicer3/modules, they will not be visible from the Slicer front
> end.
> 
> 
> 
> AM Mohan Rao
> 
> 
> On Tue, Feb 16, 2010 at 5:03 PM, Daniel Haehn <haehn at bwh.harvard.edu>
> wrote:
>         Hi Mohan,
>         
>         to debug the functionality, you can use the following code in
>         the python
>         console (it is long - sorry for that :). I assume that you
>         only have the
>         VMTKEvolutionModel in the scene. Replace X,Y,Z with the RAS
>         coordinates
>         of the seed and the target point.
>         
>         import sys; from Slicer import slicer;
>         sys.path.append(str(slicer.Application.GetExtensionsInstallPath())+'/'+str(slicer.Application.GetSvnRevision())+'/VMTKCenterlines/VMTKCenterlines');
>         from VMTKCenterlinesGUI import *;
>         hidden2gui = VMTKCenterlinesGUI();
>         from VMTKCenterlinesLogic import *;
>         centerlines = VMTKCenterlinesLogic(hidden2gui);
>         
>         model=slicer.MRMLScene.GetNodeByID('vtkMRMLModelNode1');
>         
>         clSeeds = slicer.vtkIdList();
>         clTargets = slicer.vtkIdList();
>         
>         pointLocator=slicer.vtkPointLocator();
>         pointLocator.SetDataSet(model);
>         pointLocator.BuildLocator();
>         
>         id=pointLocator.FindClosestPoint(X,Y,Z);
>         clSeeds.InsertNextId(id);
>         id=pointLocator.FindClosestPoint(X,Y,Z);
>         clTargets.InsertNextId(id);
>         
>         prepared = centerlines.prepareModel(model);
>         centerline =
>         centerlines.computeCenterlines(prepared,clSeeds,clTargets);
>         
>         This should compute a while. Then you can export the
>         centerline:
>         
>         outputFile="/home/hype/test.dat";
>         centerlines.Export(centerline,outputFile,0,0,0);
>         
>         The exported centerline is a cloud of points and can be
>         imported using
>         the VMTKCenterlines module.
>         
>         Try this and we will see where it leads us.
>         
>         HTH,
>         Daniel
>         
>         
>         On Mon, 2010-02-15 at 20:52 +0530, Madan Rao wrote:
>         > Hello Daniel,
>         >
>         > The VMTKCenterlinesGUI.py defines "Prepare Model!" button as
>         > prepButton.
>         >
>         > Clicking of this button invokes PrepCenterlines() function.
>         >
>         > After loading the VMTKEvolutionModel.vtk in InputModel I
>         open the
>         > python console and find the following observations:
>         >
>         > Python Console v1.4 by Ka-Ping Yee <ping at lfw.org>
>         > >>> from Slicer import slicer
>         > >>> result = slicer.vtkPolyData()
>         > >>> displayNode = slicer.vtkMRMLModelDisplayNode()
>         > >>> displayNode.SetColor(0, 0.8, 0)
>         > []
>         > >>> displayNode.SetVisibility(1)
>         > []
>         > >>> displayNode.SetOpacity(0.7)
>         > []
>         > >>>
>         >
>         > It seems the code seems to be running OK but I am not
>         finding the
>         > result in the VMTKCenterlines module..
>         >
>         > Please help.
>         >
>         > AM Mohan Rao
>         >
>         >
>         >
>         >
>         >
>         > On Mon, Feb 15, 2010 at 12:42 PM, Madan Rao
>         <rao.lms at gmail.com> wrote:
>         >         Hello Daniel,
>         >
>         >         Thanks.
>         >
>         >         I tried your suggestion but I am unsuccessful in
>         running the
>         >         program.
>         >
>         >         Could you please help me in debug the python code?
>         >
>         >         AM Mohan Rao
>         >
>         >         On Tue, Feb 9, 2010 at 3:06 AM, Daniel Haehn
>         >         <haehn at bwh.harvard.edu> wrote:
>         >
>         >
>         >                 Hi Mohan,
>         >
>         >                 this is a strange error. So you say when you
>         click the
>         >                 model selector in
>         >                 the panel "Input", it does not show the
>         models at all?
>         >                 They appear in
>         >                 the models module? Maybe saving the
>         Vmtkevolutionmodel
>         >                 and then exiting
>         >                 slicer and loading it will work? Once you
>         are at this
>         >                 stage of the
>         >                 processing pipeline, you only need this
>         model to
>         >                 compute the
>         >                 centerlines.
>         >
>         >                 Bye,
>         >                 Daniel
>         >
>         >
>         >                 On Sat, 2010-02-06 at 14:02 +0530, Madan Rao
>         wrote:
>         >                 > Hello,
>         >                 >
>         >                 > I am using vmtkslicermodule on a sample
>         CTA of
>         >                 coronaries following
>         >                 > Daniel Hahn's instructions. I am able to
>         >                 > work successfully upto
>         levelsetsegmentation to
>         >                 generate the
>         >                 > vmtkevolutionmodel.
>         >                 >
>         >                 > However, I am unable to run
>         vmtkcenterlines because
>         >                 input model button
>         >                 > is not able to show options.
>         >                 >
>         >                 > In the error log I find:
>         >                 >
>         >                 > ERROR: In ..\..\VTK\IO\vtkWriter.cxx, line
>         79
>         >                 > vtkPolyDataWriter (16249D58): No input
>         provided!
>         >                 >
>         >                 >
>         >                 > ERROR: In ..\KWWidgets
>         \vtkKWApplication.cxx, line
>         >                 1288
>         >                 > vtkSlicerApplication (06809CE0): TclTk
>         error:
>         >                 invalid command name
>         >                 > "vtkObj6240"
>         >                 > invalid command name "vtkObj6240"
>         >                 >     while executing
>         >                 > "vtkObj6240 UpdateMenu"
>         >                 >     (command bound to event)
>         >                 >
>         >                 >
>         >                 > ERROR: In ..\..\..\Slicer3\Libs\vtkITK
>         >                 > \vtkITKArchetypeImageSeriesReader.cxx,
>         line 1005
>         >                 > vtkITKArchetypeImageSeriesReader
>         (0C6267A8): The
>         >                 subclass has not
>         >                 > defined anything for ExecuteData!
>         >                 >
>         >                 >
>         >                 > Thanks.
>         >                 >
>         >                 > AM Mohan Rao
>         >                 >
>         >
>         >                 >
>         _______________________________________________
>         >                 > slicer-users mailing list
>         >                 > slicer-users at bwh.harvard.edu
>         >                 >
>         >
>         http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>         >                 > To unsubscribe: send email to
>         >
>         slicer-users-request at massmail.spl.harvard.edu with
>         >                 unsubscribe as the subject
>         >
>         >
>         >
>         > _______________________________________________
>         > slicer-users mailing list
>         > slicer-users at bwh.harvard.edu
>         >
>         http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>         > To unsubscribe: send email to
>         slicer-users-request at massmail.spl.harvard.edu with unsubscribe
>         as the subject
>         
>         
> 
> _______________________________________________
> slicer-users mailing list
> slicer-users at bwh.harvard.edu
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the subject




More information about the slicer-users mailing list