how to automate the execution of the Model to Model distance module

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to automate the execution of the Model to Model distance module

francesca.itta
Hi, I'm studying a mesh-based approach for the 3D Analysis of organs of
interest in radiotherapy...for this purpose I'm using Model to Model
distance in order to obtain the Hausdorff distance between the surfaces of
the organs.I need to use Model to Model module a large number of times in
order to monitor the anatomical changes of an organ within 30 days of
radiotherapy treatment.Is there a way to automate the execution of the Model
to Model without having to repeatedly select the Source and Target Model ?



--
View this message in context: http://slicer-users.65878.n3.nabble.com/how-to-automate-the-execution-of-the-Model-to-Model-distance-module-tp4029836.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply | Threaded
Open this post in threaded view
|

Re: how to automate the execution of the Model to Model distance module

Andras Lasso-2
Model to Model distance is a CLI module. You can run a CLI module form a Python script as described here:
https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Python_scripting#Running_a_CLI_from_Python

Andras

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of francesca.itta
Sent: Thursday, January 14, 2016 2:11 PM
To: SPL Slicer Users <[hidden email]>
Subject: [slicer-users] how to automate the execution of the Model to Model distance module

Hi, I'm studying a mesh-based approach for the 3D Analysis of organs of interest in radiotherapy...for this purpose I'm using Model to Model distance in order to obtain the Hausdorff distance between the surfaces of the organs.I need to use Model to Model module a large number of times in order to monitor the anatomical changes of an organ within 30 days of radiotherapy treatment.Is there a way to automate the execution of the Model to Model without having to repeatedly select the Source and Target Model ?



--
View this message in context: http://slicer-users.65878.n3.nabble.com/how-to-automate-the-execution-of-the-Model-to-Model-distance-module-tp4029836.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.

_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: how to automate the execution of the Model to Model distance module

francesca.itta
Thanks for the reply ... I'm trying to start the module ModeltoModel with
Python Interactor ... I modified the code at the suggested URL but it does
not seem to produce the desired output ... What's wrong ?


def ModeltoModel(modelNode1,modelNode2):
  parameters = {}
  parameters["Sourcemodel"] = modelNode.GetID()
  parameters["Targetmodel"] = modelNode.GetID()
  outModel = slicer.vtkMRMLModelNode()
  slicer.mrmlScene.AddNode( outModel )
  parameters["VTK Output"] = outModel.GetID()
  ModelMaker = slicer.modules.modeltomodeldistance
  return (slicer.cli.run(ModelMaker, None, parameters))

 modelNode1=getNode('Mandibola')
 modelNode2=getNode('Mandibola_CT 1->CT 2')
 OUT=ModeltoModel(modelNode1,modelNode2)



--
View this message in context: http://slicer-users.65878.n3.nabble.com/how-to-automate-the-execution-of-the-Model-to-Model-distance-module-tp4029837p4029845.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply | Threaded
Open this post in threaded view
|

Re: how to automate the execution of the Model to Model distance module

francesca.itta
This post has NOT been accepted by the mailing list yet.
In reply to this post by Andras Lasso-2
Thanks for the reply ... I'm trying to start the module ModeltoModel with Python Interactor ... I modified the code at the suggested URL but it does not seem to produce the desired output ... What's wrong ?


def ModeltoModel(modelNode1,modelNode2):
  parameters = {}
  parameters["Sourcemodel"] = modelNode.GetID()
  parameters["Targetmodel"] = modelNode.GetID()
  outModel = slicer.vtkMRMLModelNode()
  slicer.mrmlScene.AddNode( outModel )
  parameters["VTK Output"] = outModel.GetID()
  ModelMaker = slicer.modules.modeltomodeldistance
  return (slicer.cli.run(ModelMaker, None, parameters))

 modelNode1=getNode('Mandibola')
 modelNode2=getNode('Mandibola_CT 1->CT 2')
 OUT=ModeltoModel(modelNode1,modelNode2)
Reply | Threaded
Open this post in threaded view
|

Re: how to automate the execution of the Model to Model distance module

Fabien PERTUY
In reply to this post by francesca.itta
Hi Francesca,

I am not a Slicer expert, but I would say that your problem might come from your definition of the "parameters" dictionary. You use "modelNode.GetID()" for both Sourcemodel and Targetmodel keys, and the arguments you pass to your function suggest that you should use "modelNode1.GetID()" and "modelNode2.GetID()".

I also suggest that you change your arguments names to "target" and "source", which could help you to remember the order of your arguments.
This would change your function to:

def ModeltoModel(source, target):
  parameters = {}
  parameters["Sourcemodel"] = source.GetID()
  parameters["Targetmodel"] = target.GetID()
  outModel = slicer.vtkMRMLModelNode()
  slicer.mrmlScene.AddNode( outModel )
  parameters["VTK Output"] = outModel.GetID()
  ModelMaker = slicer.modules.modeltomodeldistance
  return (slicer.cli.run(ModelMaker, None, parameters))

Hope that'll help,

Fabien


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de francesca.itta
Envoyé : samedi 16 janvier 2016 18:20
À : SPL Slicer Users <[hidden email]>
Objet : Re: [slicer-users] how to automate the execution of the Model to Model distance module

Thanks for the reply ... I'm trying to start the module ModeltoModel with Python Interactor ... I modified the code at the suggested URL but it does not seem to produce the desired output ... What's wrong ?


def ModeltoModel(modelNode1,modelNode2):
  parameters = {}
  parameters["Sourcemodel"] = modelNode.GetID()
  parameters["Targetmodel"] = modelNode.GetID()
  outModel = slicer.vtkMRMLModelNode()
  slicer.mrmlScene.AddNode( outModel )
  parameters["VTK Output"] = outModel.GetID()
  ModelMaker = slicer.modules.modeltomodeldistance
  return (slicer.cli.run(ModelMaker, None, parameters))

 modelNode1=getNode('Mandibola')
 modelNode2=getNode('Mandibola_CT 1->CT 2')
 OUT=ModeltoModel(modelNode1,modelNode2)



--
View this message in context: http://slicer-users.65878.n3.nabble.com/how-to-automate-the-execution-of-the-Model-to-Model-distance-module-tp4029837p4029845.html
Sent from the slicer-users mailing list archive at Nabble.com.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ


The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ