Hiding CLI from Slicer user interface

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

Hiding CLI from Slicer user interface

chribaue
Hi!

Slicer automatically generates a user interface for CLI modules which get
listed under Slicer's modules list. Is it possible to hide the CLI module
from the user interface, like it is possible for loadable modules?

My motivation for this request ist as follows: I have an extension with a
python module as user interface which calls internally a CLI for some of the
processing. For the user it doesn't make sense to access the CLI's auto
generated user interface and I would like to hide it from the user to avoid
confusion.

Thank you,
Christian




--
View this message in context: http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Hiding CLI from Slicer user interface

Steve Pieper-2
Hi Christian -

One would be to have a sub-category called Advanced in your xml.  That is, if your scripted module sets parent.categories to ["Fancy Tools"] then the xml category tag could be <category>Fancy Tools.Advanced</category>.  Or it could be a different arbitrary category the user is unlikely to find.

If that's not clean enough we could look into other mechanisms, like a hidden flag in the cli xml for example.

HTH,
Steve

On Thu, Apr 6, 2017 at 4:05 PM, chribaue <[hidden email]> wrote:
Hi!

Slicer automatically generates a user interface for CLI modules which get
listed under Slicer's modules list. Is it possible to hide the CLI module
from the user interface, like it is possible for loadable modules?

My motivation for this request ist as follows: I have an extension with a
python module as user interface which calls internally a CLI for some of the
processing. For the user it doesn't make sense to access the CLI's auto
generated user interface and I would like to hide it from the user to avoid
confusion.

Thank you,
Christian




--
View this message in context: http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


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

Re: Hiding CLI from Slicer user interface

chribaue
In reply to this post by chribaue
Hi Steve,

there's a category "Legacy" which fits my situation pretty well: The new
python module is an extension of the old CLI with some extra
functionality. I'll take this route.

Thanks,
Christian

On Thu, 2017-04-06 at 17:09 -0400, Steve Pieper wrote:

> Hi Christian -
>
>
> One would be to have a sub-category called Advanced in your xml.  That
> is, if your scripted module sets parent.categories to ["Fancy Tools"]
> then the xml category tag could be <category>Fancy
> Tools.Advanced</category>.  Or it could be a different arbitrary
> category the user is unlikely to find.
>
>
> If that's not clean enough we could look into other mechanisms, like a
> hidden flag in the cli xml for example.
>
>
> HTH,
> Steve
>
> On Thu, Apr 6, 2017 at 4:05 PM, chribaue <[hidden email]>
> wrote:
>         Hi!
>        
>         Slicer automatically generates a user interface for CLI
>         modules which get
>         listed under Slicer's modules list. Is it possible to hide the
>         CLI module
>         from the user interface, like it is possible for loadable
>         modules?
>        
>         My motivation for this request ist as follows: I have an
>         extension with a
>         python module as user interface which calls internally a CLI
>         for some of the
>         processing. For the user it doesn't make sense to access the
>         CLI's auto
>         generated user interface and I would like to hide it from the
>         user to avoid
>         confusion.
>        
>         Thank you,
>         Christian
>        
>        
>        
>        
>         --
>         View this message in context:
>         http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
>         Sent from the slicer-devel mailing list archive at Nabble.com.
>         _______________________________________________
>         slicer-devel mailing list
>         [hidden email]
>         http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>         To unsubscribe: send email to
>         [hidden email] with unsubscribe as the
>         subject
>         http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
>
>


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

Re: Hiding CLI from Slicer user interface

andrey.fedorov
In reply to this post by Steve Pieper-2
> a hidden flag in the cli xml

I much prefer a "hidden" flag instead of an "arbitrary category the
user is unlikely to find".

The question of not exposing utility CLIs to the user to avoid (err,
not possible -- "reduce" is the right word!) confusion came up before,
and it would be nice to have the "hidden" flag added. Would be great
to hear thoughts from the other developers.

Nevertheless, I agree "arbitrary category" is the most practical way
at the moment.

On Thu, Apr 6, 2017 at 5:09 PM, Steve Pieper <[hidden email]> wrote:

> Hi Christian -
>
> One would be to have a sub-category called Advanced in your xml.  That is,
> if your scripted module sets parent.categories to ["Fancy Tools"] then the
> xml category tag could be <category>Fancy Tools.Advanced</category>.  Or it
> could be a different arbitrary category the user is unlikely to find.
>
> If that's not clean enough we could look into other mechanisms, like a
> hidden flag in the cli xml for example.
>
> HTH,
> Steve
>
> On Thu, Apr 6, 2017 at 4:05 PM, chribaue <[hidden email]> wrote:
>>
>> Hi!
>>
>> Slicer automatically generates a user interface for CLI modules which get
>> listed under Slicer's modules list. Is it possible to hide the CLI module
>> from the user interface, like it is possible for loadable modules?
>>
>> My motivation for this request ist as follows: I have an extension with a
>> python module as user interface which calls internally a CLI for some of
>> the
>> processing. For the user it doesn't make sense to access the CLI's auto
>> generated user interface and I would like to hide it from the user to
>> avoid
>> confusion.
>>
>> Thank you,
>> Christian
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
>> Sent from the slicer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with
>> unsubscribe as the subject
>>
>> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
>
>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with
> unsubscribe as the subject
> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Hiding CLI from Slicer user interface

Johan Andruejol
Hello Christian,

Looking at the code for the module selector toolbar[1] & [2], you can indirectly call
the slot "onModuleRemoved(QString)" by emitting the appropriate signal on the module manager[3].
This will remove your CLI module from the toolbar.

This is a obviously a hack, I would recommend going Steve's route, but if you want to try it, you can do this:
>>> moduleManager = slicer.app.moduleManager()
>>>
moduleManager.moduleAboutToBeUnloaded('GaussianBlurImageFilter')

Gaussian Blur Image Filter is now removed from the module selector.

Thanks !

P.S:  Note that a persistent user may still be able to get to the module through python.

On Thu, Apr 6, 2017 at 5:36 PM, Andrey Fedorov <[hidden email]> wrote:
> a hidden flag in the cli xml

I much prefer a "hidden" flag instead of an "arbitrary category the
user is unlikely to find".

The question of not exposing utility CLIs to the user to avoid (err,
not possible -- "reduce" is the right word!) confusion came up before,
and it would be nice to have the "hidden" flag added. Would be great
to hear thoughts from the other developers.

Nevertheless, I agree "arbitrary category" is the most practical way
at the moment.

On Thu, Apr 6, 2017 at 5:09 PM, Steve Pieper <[hidden email]> wrote:
> Hi Christian -
>
> One would be to have a sub-category called Advanced in your xml.  That is,
> if your scripted module sets parent.categories to ["Fancy Tools"] then the
> xml category tag could be <category>Fancy Tools.Advanced</category>.  Or it
> could be a different arbitrary category the user is unlikely to find.
>
> If that's not clean enough we could look into other mechanisms, like a
> hidden flag in the cli xml for example.
>
> HTH,
> Steve
>
> On Thu, Apr 6, 2017 at 4:05 PM, chribaue <[hidden email]> wrote:
>>
>> Hi!
>>
>> Slicer automatically generates a user interface for CLI modules which get
>> listed under Slicer's modules list. Is it possible to hide the CLI module
>> from the user interface, like it is possible for loadable modules?
>>
>> My motivation for this request ist as follows: I have an extension with a
>> python module as user interface which calls internally a CLI for some of
>> the
>> processing. For the user it doesn't make sense to access the CLI's auto
>> generated user interface and I would like to hide it from the user to
>> avoid
>> confusion.
>>
>> Thank you,
>> Christian
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
>> Sent from the slicer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with
>> unsubscribe as the subject
>>
>> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
>
>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with
> unsubscribe as the subject
> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
Johan Andruejol
R&D Engineer, Kitware Inc.
http://www.kitware.com/
Phone: (919) 869-8860

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

Re: Hiding CLI from Slicer user interface

lasso2

You can also place your module into the Testing category. Testing modules are only shown if developer mode is enabled, so you could still have the option of troubleshooting your module using GUI, if needed.

 

Andras

 

From: [hidden email]
Sent: Thursday, April 6, 2017 5:39 PM
To: [hidden email]
Cc: [hidden email]; [hidden email]
Subject: Re: [slicer-devel] Hiding CLI from Slicer user interface

 

Hello Christian,

Looking at the code for the module selector toolbar[1] & [2], you can indirectly call
the slot "onModuleRemoved(QString)" by emitting the appropriate signal on the module manager[3].
This will remove your CLI module from the toolbar.

This is a obviously a hack, I would recommend going Steve's route, but if you want to try it, you can do this:
>>> moduleManager = slicer.app.moduleManager()
>>>
moduleManager.moduleAboutToBeUnloaded('GaussianBlurImageFilter')

Gaussian Blur Image Filter is now removed from the module selector.

Thanks !

P.S:  Note that a persistent user may still be able to get to the module through python.

On Thu, Apr 6, 2017 at 5:36 PM, Andrey Fedorov <[hidden email]> wrote:
> a hidden flag in the cli xml

I much prefer a "hidden" flag instead of an "arbitrary category the
user is unlikely to find".

The question of not exposing utility CLIs to the user to avoid (err,
not possible -- "reduce" is the right word!) confusion came up before,
and it would be nice to have the "hidden" flag added. Would be great
to hear thoughts from the other developers.

Nevertheless, I agree "arbitrary category" is the most practical way
at the moment.

On Thu, Apr 6, 2017 at 5:09 PM, Steve Pieper <[hidden email]> wrote:
> Hi Christian -
>
> One would be to have a sub-category called Advanced in your xml.  That is,
> if your scripted module sets parent.categories to ["Fancy Tools"] then the
> xml category tag could be <category>Fancy Tools.Advanced</category>.  Or it
> could be a different arbitrary category the user is unlikely to find.
>
> If that's not clean enough we could look into other mechanisms, like a
> hidden flag in the cli xml for example.
>
> HTH,
> Steve
>
> On Thu, Apr 6, 2017 at 4:05 PM, chribaue <[hidden email]> wrote:
>>
>> Hi!
>>
>> Slicer automatically generates a user interface for CLI modules which get
>> listed under Slicer's modules list. Is it possible to hide the CLI module
>> from the user interface, like it is possible for loadable modules?
>>
>> My motivation for this request ist as follows: I have an extension with a
>> python module as user interface which calls internally a CLI for some of
>> the
>> processing. For the user it doesn't make sense to access the CLI's auto
>> generated user interface and I would like to hide it from the user to
>> avoid
>> confusion.
>>
>> Thank you,
>> Christian
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://slicer-devel.65872.n3.nabble.com/Hiding-CLI-from-Slicer-user-interface-tp4038451.html
>> Sent from the slicer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with
>> unsubscribe as the subject
>>
>> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
>
>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with
> unsubscribe as the subject
> http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
Johan Andruejol
R&D Engineer, Kitware Inc.
http://www.kitware.com/
Phone: (919) 869-8860

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ