# Tractography interactive seeding in CLI module

**URL:** <https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631>\
**Category:** Development\
**Created:** [July 17, 2019, 3:03pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631 "2019-07-17T15:03:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fpsiddiqui91](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Post date:** [July 17, 2019, 3:03pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/1 "2019-07-17T15:03:39Z")

</div>

Hello Developers,

First of all Thank you for the support. I made some progress in my current task. I have implemented UKF tractography and add some modifications on it which I needed.

Now I want to implement interactive seeding tractography module as CLI. I am trying to implement it like this:

```
  def dti2fibers(self,markup,b):

if not hasattr(self, 'tractography_node'):
  self.tractography_node = slicer.vtkMRMLFiberBundleNode()
  slicer.mrmlScene.AddNode(self.tractography_node)

parameters = {
  'InputVolume': self.DTISelector.currentNode(),
  'OutputFibers': self.fiberBundleSelector.currentNode(),
  'InputFiducialList':self.markupSelector.currentNode() # THIS IS THE POINT OF ERROR
}

self.seeding_parameter_node = slicer.cli.run(
slicer.modules.tractographyinteractiveseeding, None,
parameters,wait_for_completion=False)

```

I am not sure about the input parameters? how can I give my markup node as an input to the module.  
I saw the docuemntetion: [https://www.slicer.org/wiki/Documentation/Nightly/Modules/TractographyInteractiveSeeding](https://www.slicer.org/wiki/Documentation/Nightly/Modules/TractographyInteractiveSeeding)

But the inputs are not mentioned as clear as in ROI module : [https://www.slicer.org/wiki/Documentation/4.10/Modules/TractographyLabelMapSeeding](https://www.slicer.org/wiki/Documentation/4.10/Modules/TractographyLabelMapSeeding)

Can you please let me know how can I give markup node as an input to my interactive seeding module.

Thank you so much

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 17, 2019, 3:17pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/2 "2019-07-17T15:17:51Z")

</div>

> [@fpsiddiqui91](#):
>
> First of all Thank you for the support.

😄

To help people help you, could you include the specific error message? Also if you can point to a github repository of the full code it’s better than just including a snippet (so people can see where variables are defined, etc).

---

<div class="post-metadata">

**Author:** ![fpsiddiqui91](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Post date:** [July 17, 2019, 3:23pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/3 "2019-07-17T15:23:23Z")

</div>

Hello Thank you fro your response. This snippet is general implementation from my source code. I am actually asking about the CLI parameters for tractographyinteractiveseeding module.

For ROI module it is clearly mentioned in documentation with the names:

> Input DTI Volume\*\* (InputVolume): DTI volume in which to seed (generate) tractography.  
> Input Label Map\*\* (InputROI): Label map defining region for seeding tractography.  
> Output Fiber Bundle\*\* (OutputFibers): Tractography result

But for Interative seeding module there is no such thing mentioned in the documentation.

I hope I am clear with my question. Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [July 17, 2019, 3:24pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/4 "2019-07-17T15:24:52Z")

</div>

What is your goal? Have you looked at the interactive UKF module?

> **[pnlbwh/ukftractography](https://github.com/pnlbwh/ukftractography/tree/master/InteractiveUKF)**
>
> Contribute to pnlbwh/ukftractography development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![fpsiddiqui91](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Post date:** [July 17, 2019, 3:51pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/5 "2019-07-17T15:51:19Z")

</div>

I actually want to make a simple interactive tractography with simple mouse clicking which I have already implemented with ukf tractography.  
Now I want to implement the same thing with interactive seeding module as ukf is computationally expensive.

I want to learn how to use interactive seeding module in CLI. I have tried to make a function but I dont know the CLI parameters it needs.

---

<div class="post-metadata">

**Author:** ![ljod](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ljod/32/652_2.png) [@ljod](https://discourse.slicer.org/u/ljod)\
**Post date:** [July 17, 2019, 4:06pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/6 "2019-07-17T16:06:28Z")

</div>

But does the Interactive UKF module already work for your needs?

Also, all CLIs should be able to print their help information when run on the command line with -h. This should help understand inputs.

---

<div class="post-metadata">

**Author:** ![fpsiddiqui91](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Post date:** [July 17, 2019, 4:11pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/7 "2019-07-17T16:11:07Z")

</div>

It worked but it might be computationally expensive,

Also, I want to run tractography module on background. I could not figure out a way to run the whole UKF tracktography on background,

Typically on any CLI module we can this flag: set wait\_for\_completion=False

Thank you for your response.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 17, 2019, 4:39pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/8 "2019-07-17T16:39:32Z")

</div>

Did you try the autorun options for the CLI?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/2/e2b96a837ff90431e75f383b69966d34b495716e.png)

---

<div class="post-metadata">

**Author:** ![fpsiddiqui91](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@fpsiddiqui91](https://discourse.slicer.org/u/fpsiddiqui91)\
**Post date:** [July 17, 2019, 4:45pm UTC](https://discourse.slicer.org/t/tractography-interactive-seeding-in-cli-module/7631/9 "2019-07-17T16:45:35Z")

</div>

Thank you for your response, I have implemented UKF on my own application. I will try to activate it pragmatically. Thank you
