# Slicer custom application deployment to many computers

**URL:** <https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019>\
**Category:** Development\
**Tags:** slicelet\
**Created:** [February 11, 2021, 3:59pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019 "2021-02-11T15:59:23Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [June 18, 2021, 2:56am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/62 "2021-06-18T02:56:30Z")

</div>

Ok, I see. I can find the names of options by looking at the Slicer CMakeList or the CMake GUI. Thanks.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [June 21, 2021, 4:57pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/63 "2021-06-21T16:57:17Z")

</div>

Good Morning @lassoan @pieper @jamesobutler @jcfr,

I was able to reduce the size of my install package by 200MB via CMake. We just want to thank you all for your help on this as we will continue to look for ways to reduce the size. If you can think of any other functions we might try to eliminate vis CMake, please do not hesitate to inform us. The smaller we can get this, the more accepting our Windows Workstation team would be willing to pre-install SlicerQREADS on all 50,000 plus systems (25,000 simultaneous users) enterprise-wide.

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:** [June 21, 2021, 5:17pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/64 "2021-06-21T17:17:56Z")

</div>

If you use a tool like [treesize](https://www.jam-software.com/treesize_free) you can figure out what’s taking up space and we can tell you which parts might be optional for you depending on your needs.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [June 30, 2021, 5:55pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/65 "2021-06-30T17:55:14Z")

</div>

> [@pieper](#):
>
> It may also be possible to start scrolling the axials as they arrive and then snap to MPR once the volume is complete (or something similar so the user doesn’t just see a blank screen and get bored).

Hello @pieper,

Is "scrolling the axials as they arrive " currently a functionality that I can enable?

Thanks

---

<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:** [June 30, 2021, 6:02pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/66 "2021-06-30T18:02:13Z")

</div>

No, this is a new feature that would need to be enabled.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [June 30, 2021, 8:32pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/67 "2021-06-30T20:32:06Z")

</div>

A great feature for users indeed. I know it’s just smoke and mirrors, but many (if not, most) vendors are doing it.

Thanks.

---

<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:** [June 30, 2021, 10:59pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/68 "2021-06-30T22:59:35Z")

</div>

Coincidentally I stated experimenting with this the other day. As you can see in the linked video it’s super fast to read and display the images if you just read them from disk and display them so we could look at offering this preview mode while the 3D/4D inspection and processing is going on in the background.

> <https://github.com/commontk/CTK/pull/979>
>
> Based on ProjectWeek discussion:
> https://projectweek.na-mic.org/PW35\_2021\_Virtu…al/Projects/mpReview/

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 1, 2021, 3:06pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/69 "2021-07-01T15:06:14Z")

</div>

Thanks @pieper,

Do you mean a kind of fancy progress bar that would automatically scroll through the images? That’s cool. In our situation, they’ve already previewed it in the host QREADS app that launched SlicerQREADS, so the previewing again might feel redundant.

I know what I’m about to say sounds ridiculous, but if I were to imaging the ideal UI, the axials would scroll while the coronal and sagittal slices would update to show the cross sections so far. The user would be able to see the image loading advancement in the orthogonal slices as they progress from top to bottom, and they would know that the axial series loading is complete when the cross section slices are visually full. The orthogonal slices act as progress bars if you will.

By the way, is there way to use just a regular progress bar for this. Anything to keep the user from wondering is SlicerQREADS has crashed.

Thanks

---

<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 1, 2021, 5:29pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/70 "2021-07-01T17:29:26Z")

</div>

In OHIF we do the incremental fill, but not in Slicer. Yes there’s a lot of room for improving the dicom experience in Slicer, ideally optimizing for the most common cases. There are a lot of non-trivial special cases being handled by all the plugins and other mechanisms that add time to the loading.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 1, 2021, 5:56pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/71 "2021-07-01T17:56:58Z")

</div>

Hold on!!! Are you guys are affiliated with OHIF?

---

<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 1, 2021, 6:25pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/72 "2021-07-01T18:25:28Z")

</div>

Yes, we work very closely with the OHIF team and have for years. One of our goals is to have smooth interoperability between web and desktop applications.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 1, 2021, 6:43pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/73 "2021-07-01T18:43:41Z")

</div>

Great! I’m so glad you guys are helping organizations like OHIF. Hopefully relationships like that is helping to sustain you existentially.

Thanks

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 1, 2021, 8:38pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/74 "2021-07-01T20:38:13Z")

</div>

@pieper

How can I use a progress bar that appears when the images are loading and terminates when image loading is done?.

Thanks.

---

<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 1, 2021, 9:03pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/75 "2021-07-01T21:03:07Z")

</div>

You can check out this discussion for options:

> <https://github.com/Slicer/Slicer/pull/5716>
>
> These are some potentially useful utils coming from https://github.com/fepegar/S…licerParcellation/blob/master/lib/GeneralUtils.py.
> 
> @lassoan's comments were:
> 
> \> There is indeed some repeating code pattern with the waitcursor and printing of exception messages which would be nice to simplify. Please send a pull request to Slicer core with the content of GeneralUtils.py to start a discussion. Initial comment: the overridecursor has to be restored when an exception occurs ("finally" is too late because the popup window is displayed in "except" and it is not nice if the waitcursor is still shown when the user gets the error popup). messageContextManager: It seems that it is intended for progress reporting, but for thatyou can already use the statusbar or delaydisplay. A context manager for error messages could be more useful: it would take a general error message (that it would display if there is an exception) and would offer to show the exception text if user clicks "Details" button. Something like this: https://github.com/Slicer/Slicer/blob/aaa9f918a4ee4f35bf09e05c5d7e53d083b2e4e3/Modules/Scripted/DICOMLib/DICOMSendDialog.py#L91-L99
> 
> My replies:
> 
> \> the overridecursor has to be restored when an exception occurs ("finally" is too late because the popup window is displayed in "except" and it is not nice if the waitcursor is still shown when the user gets the error popup)
> 
> I'm not sure which popup window you mean. Something created by the user? \`showWaitCursor\` doesn't show a popup window.
> 
> \> messageContextManager: It seems that it is intended for progress reporting, but for that you can already use the statusbar or delaydisplay.
> 
> The status bar might not be very obvious. This is how I've used this in a module (0:35, here being played at x2): https://youtu.be/Gg02F9DGDc4?t=35. Not sure how I would use delayDisplay with the context manager. I wouldn't like buttons in the window.
> 
> \> A context manager for error messages could be more useful: it would take a general error message (that it would display if there is an exception) and would offer to show the exception text if user clicks "Details" button. 
> 
> Thanks. I have added a \`tryWithErrorDisplay\` context manager.
> 
> Comments:
> 
> 1. Maybe the names can be improved
> 1. The goal of these is two remove a bit of verbosity from users' code.
> 1. I imported \`contextmanager\` to be able to use the decorator. This seems forbidden in \`slicer.util\`, though. Another option is to use the class syntax for context managers. Why are all the imports inside the functions? Why are many of them in one line, this is against \[PEP8\](https://www.python.org/dev/peps/pep-0008/#imports).
> 1. Why is the file so long? Why not splitting it into different submodules and importing everything here if necessary?
> 
> Here are some snippets to try these:
> 
> \`\`\`python
> import time
> import random
> 
> def work():
> time.sleep(random.randrange(1, 3))
> 
> def fail():
> work()
> int('Szia')
> 
> showThings = True
> 
> \#
> with showWaitCursor(show=showThings):
> work()
> 
> \#
> with showWaitCursor(show=showThings):
> fail()
> 
> \#
> with messageContextManager('¡Hola!', show=showThings):
> work()
> 
> \#
> with messageContextManager('¡Hola!', show=showThings):
> fail()
> 
> \#
> with tryWithErrorDisplay(show=showThings):
> work()
> 
> \#
> with tryWithErrorDisplay(show=showThings):
> fail()
> 
> \#
> getPythonConsoleWidget().show()
> with peakPythonConsole(show=showThings):
> print('This should just wait a bit')
> slicer.app.processEvents()
> work()
> 
> \# This one needs to be pasted with a blank line at the end so it runs
> getPythonConsoleWidget().hide()
> slicer.app.processEvents()
> time.sleep(2)
> with peakPythonConsole(show=showThings):
> print('I will close soon!')
> slicer.app.processEvents()
> work()
> 
> 
> \`\`\`

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 2, 2021, 2:55pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/76 "2021-07-02T14:55:51Z")

</div>

OK, is this available to use right now and is it possible to somehow sync it up with the image load process? Yet another rabbit hole? 😑

Thanks @pieper

---

<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 2, 2021, 5:20pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/77 "2021-07-02T17:20:18Z")

</div>

I don’t think it’s a rabbit hole, but it’s just a work in progress. Right now that PR just implements the ability to look at the images as part of the metadata preview. It’s probably useful as-is but it also demonstrates that it should be possible to do something much faster in terms of presenting the images to the user. As usual it’s a SMOP\* to make it happen.

\* SMOP == “simple matter of programming”

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 2, 2021, 6:20pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/78 "2021-07-02T18:20:57Z")

</div>

Oh, my apologies @pieper, I didn’t mean that as an offense to you guys, but to mainly my own inexperience and incompetence. It seems to takes me weeks sometimes to accomplish very simple tasks. I’ll get there eventually. Just feels like rabbit holes from my current inadequate Slicer-programming skills and lack of experience. I’m sure eventually, it will get better. 🙂

---

<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 2, 2021, 6:25pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/79 "2021-07-02T18:25:16Z")

</div>

No offense taken at all! Just wanted to set expectations with respect to that particular feature. I’m sure we’ve all spent time in “rabbitholes” or even worse chasing after bugs and otherwise spinning our wheels in unfamiliar environments.

---

<div class="post-metadata">

**Author:** ![spycolyf](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spycolyf](https://discourse.slicer.org/u/spycolyf)\
**Post date:** [July 2, 2021, 6:54pm UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/80 "2021-07-02T18:54:48Z")

</div>

So, to answer my question. Is this feature currently available? I would like to use the wait cursor to show progress while loading images. It would need to know how many images to expect and the current number of images loaded so far. Or is this a future feature?

Thanks

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 13, 2021, 3:16am UTC](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019/81 "2021-07-13T03:16:50Z")

</div>

Progressive loading is not available yet.

Pre-allocation of volume and progressive loading of slices on a few threads would make a huge difference when loading the images from a remote server. However, if the images are already on the local file system (and recently accessed by QREADS) then I’m not sure ​it would help much.

For example, I did a quick test and importing and loading of a CT images series of 512x512x681 voxels took 8 seconds in total. 2-3 seconds were spent with importing (parse the header of 681 files and store the results in the DICOM database) and 5-6 was to load the series.

Do you use the DICOM module for loading images?  
How long does DICOM import take (populating Slicer’s DICOM database with files of the selected study)?  
How long does DICOM loading take (loading an image series into the scene)?

[Previous page](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019.md?page=3)

[Next page](https://discourse.slicer.org/t/slicer-custom-application-deployment-to-many-computers/18019.md?page=5)
